Skip to content

Commit

Permalink
Format according to ocamlformat
Browse files Browse the repository at this point in the history
  * Add a comment about printing pids without formatting
  • Loading branch information
DMaroo committed Dec 6, 2022
1 parent bb3e6a1 commit ccae11a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/perf_tool_backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ module Recording = struct
in
if debug_print_perf_commands then Core.printf "%s\n%!" (String.concat ~sep:" " argv);
(* Perf prints output we don't care about and --quiet doesn't work for some reason *)
if debug_print_pid then Core.printf "Passed PIDs to perf: %s\n%!" (String.concat~sep:"" pid_opt);
if debug_print_pid
then Core.printf "Passed PIDs to perf: %s\n%!" (String.concat ~sep:"" pid_opt);
(* No need to format `pid_opt` again, since it already is a list of comma separated PIDs *)
let perf_pid = perf_fork_exec ~env:perf_env ~prog:"perf" ~argv () in
(* This detaches the perf process from our "process group" but not our session. This
makes it so that when Ctrl-C is sent to magic_trace in the terminal to end an attach
Expand Down
14 changes: 12 additions & 2 deletions src/trace.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ let debug_print_perf_commands =

let debug_print_pid =
let open Command.Param in
flag "-z-print-pid" no_arg ~doc:"Prints the PIDs of the processes magic-trace attaches to."
flag
"-z-print-pid"
no_arg
~doc:"Prints the PIDs of the processes magic-trace attaches to."
|> debug_flag
;;

Expand Down Expand Up @@ -492,7 +495,14 @@ module Make_commands (Backend : Backend_intf.S) = struct
return pid
;;

let attach_and_record record_opts ~elf ~debug_print_perf_commands ~debug_print_pid ~collection_mode pids =
let attach_and_record
record_opts
~elf
~debug_print_perf_commands
~debug_print_pid
~collection_mode
pids
=
let%bind.Deferred.Or_error attachment =
attach
record_opts
Expand Down

0 comments on commit ccae11a

Please sign in to comment.