Skip to content

Commit

Permalink
Remove profiling support
Browse files Browse the repository at this point in the history
  • Loading branch information
gs0510 committed Dec 4, 2019
1 parent 93738dc commit 5dc0780
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 737 deletions.
12 changes: 1 addition & 11 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,8 @@
(c_names wait4)
(modules ))

(library
(name profiler)
(c_names profiler)
(c_library_flags (:include profiler_library_flags.sexp))
(modules ))

(executable
(name orun)
(public_name orun)
(libraries str cmdliner yojson unix wait4 profiler))
(libraries str cmdliner yojson unix wait4))

(rule
(targets profiler_library_flags.sexp)
(deps (:detect_os config/detect_os.sh))
(action (run %{detect_os})))
21 changes: 2 additions & 19 deletions orun.ml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,10 @@ let get_ocaml_config () =
| "ranlib"
| "asm"
| "ccomp_type"
| "cc_profile"
| "default_executable_name"
| "bytecomp_c_libraries"
| "native_c_libraries"
| "native_pack_linker"
| "profiling"
| "host" (* arch info available elsewhere *)
| "os_type" (* already have more specific "system" *)
| "target"
Expand Down Expand Up @@ -161,23 +159,8 @@ let run output input cmdline =
else prog
in
try
let profiling =
match Sys.getenv_opt "ORUN_CONFIG_PROFILE" with
| None ->
false
| Some _ ->
true
in
let exec_prog output_name prog cmdline env stdin stdout stderr =
if profiling then (
let pid, parent_ready =
Profiler.create_process_env_paused prog cmdline env stdin stdout
stderr
in
let result = Profiler.start_profiling pid parent_ready in
Profiler.write_profiling_result output_name result ;
pid )
else Unix.create_process_env prog cmdline env stdin stdout stderr
let exec_prog _ prog cmdline env stdin stdout stderr =
Unix.create_process_env prog cmdline env stdin stdout stderr
in
let before = Unix.gettimeofday () in
let captured_stderr_filename = Filename.temp_file "orun" "stderr" in
Expand Down
4 changes: 2 additions & 2 deletions orun.opam
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
opam-version: "2.0"
name: "orun"
version: "0.1"
version: "0.1.0"
synopsis: "Run benchmarks and measure performance"
maintainer: "Stephen Dolan <[email protected]>"
authors: "Stephen Dolan <[email protected]>"
license: "MIT"
dev-repo: ""
dev-repo: "git+https://github.com/ocaml-bench/orun.git"
depends: [ "ocaml" "cmdliner" "yojson" ]
build: [
["ocaml-update-c" "wait4.c"] {ocaml:update-c}
Expand Down
Loading

0 comments on commit 5dc0780

Please sign in to comment.