Skip to content

Commit ccae11a

Browse files
committed
Format according to ocamlformat
* Add a comment about printing pids without formatting
1 parent bb3e6a1 commit ccae11a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/perf_tool_backend.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ module Recording = struct
393393
in
394394
if debug_print_perf_commands then Core.printf "%s\n%!" (String.concat ~sep:" " argv);
395395
(* Perf prints output we don't care about and --quiet doesn't work for some reason *)
396-
if debug_print_pid then Core.printf "Passed PIDs to perf: %s\n%!" (String.concat~sep:"" pid_opt);
396+
if debug_print_pid
397+
then Core.printf "Passed PIDs to perf: %s\n%!" (String.concat ~sep:"" pid_opt);
398+
(* No need to format `pid_opt` again, since it already is a list of comma separated PIDs *)
397399
let perf_pid = perf_fork_exec ~env:perf_env ~prog:"perf" ~argv () in
398400
(* This detaches the perf process from our "process group" but not our session. This
399401
makes it so that when Ctrl-C is sent to magic_trace in the terminal to end an attach

src/trace.ml

+12-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ let debug_print_perf_commands =
7777

7878
let debug_print_pid =
7979
let open Command.Param in
80-
flag "-z-print-pid" no_arg ~doc:"Prints the PIDs of the processes magic-trace attaches to."
80+
flag
81+
"-z-print-pid"
82+
no_arg
83+
~doc:"Prints the PIDs of the processes magic-trace attaches to."
8184
|> debug_flag
8285
;;
8386

@@ -492,7 +495,14 @@ module Make_commands (Backend : Backend_intf.S) = struct
492495
return pid
493496
;;
494497

495-
let attach_and_record record_opts ~elf ~debug_print_perf_commands ~debug_print_pid ~collection_mode pids =
498+
let attach_and_record
499+
record_opts
500+
~elf
501+
~debug_print_perf_commands
502+
~debug_print_pid
503+
~collection_mode
504+
pids
505+
=
496506
let%bind.Deferred.Or_error attachment =
497507
attach
498508
record_opts

0 commit comments

Comments
 (0)