diff --git a/src/perf_tool_backend.ml b/src/perf_tool_backend.ml index 60625c58dc..5f1c065e78 100644 --- a/src/perf_tool_backend.ml +++ b/src/perf_tool_backend.ml @@ -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 diff --git a/src/trace.ml b/src/trace.ml index 41244d51af..4556c1d3ce 100644 --- a/src/trace.ml +++ b/src/trace.ml @@ -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 ;; @@ -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