@@ -27,10 +27,6 @@ let fmt =
2727 in
2828 Arg. (value @@ opt (some formats) None @@ info [" T" ; " format" ] ~docv: " TYPE" ~doc )
2929
30- let freq =
31- let doc = " How many times per second to check for events." in
32- Arg. (value @@ opt float 100.0 @@ info [" F" ; " freq" ] ~docv: " RATE" ~doc )
33-
3430let start_time =
3531 let doc = " Seconds to skip before the section to display." in
3632 Arg. (value @@ opt (some time) None @@ info [" s" ; " start-time" ] ~doc )
@@ -39,10 +35,6 @@ let duration =
3935 let doc = " Width of the output image in seconds." in
4036 Arg. (value @@ opt (some time) None @@ info [" d" ; " duration" ] ~doc )
4137
42- let child_args =
43- let doc = " The command to be executed and monitored." in
44- Arg. (non_empty @@ pos_all string [] @@ info [] ~docv: " command" ~doc )
45-
4638let eio_trace_gtk = " eio-trace-gtk"
4739
4840let find_eio_trace_gtk () =
@@ -66,16 +58,16 @@ let exec_gtk args =
6658
6759let show tracefiles = exec_gtk (" show" :: tracefiles)
6860
69- let run ~fs ~proc_mgr freq args =
61+ let run ~fs ~proc_mgr config =
7062 let gtk_exe = find_eio_trace_gtk () in
7163 let ui tracefile =
72- Eio.Process. run proc_mgr (gtk_exe :: " run" :: tracefile :: args );
64+ Eio.Process. run proc_mgr (gtk_exe :: " run" :: tracefile :: config. Record. child_args );
7365 Ok ()
7466 in
75- Record. run ~fs ~proc_mgr ~freq ~ ui args
67+ Record. run ~fs ~proc_mgr ~ui config
7668
77- let record ~fs ~proc_mgr freq tracefile args =
78- Record. run ~fs ~proc_mgr ~freq ~ tracefile args
69+ let record ~fs ~proc_mgr tracefile config =
70+ Record. run ~fs ~proc_mgr ~tracefile config
7971
8072let ( let * ) = Result. bind
8173
@@ -104,9 +96,9 @@ let cmd env =
10496 let path = Eio.Path. ( / ) fs in
10597 Cmd. group (Cmd. info " eio-trace" )
10698 @@ List. map (fun (name , term ) -> Cmd. v (Cmd. info name) term) [
107- " record" , record ~fs ~proc_mgr $$ freq $ (path $$ tracefile) $ child_args ;
99+ " record" , record ~fs ~proc_mgr $$ (path $$ tracefile) $ Record. cmdliner ;
108100 " dump" , Dump. main Format. std_formatter $$ (List. map path $$ tracefiles);
109- " run" , run ~fs ~proc_mgr $$ freq $ child_args ;
101+ " run" , run ~fs ~proc_mgr $$ Record. cmdliner ;
110102 " show" , show $$ tracefiles;
111103 " render" , render $$ tracefiles $ imagefile $ fmt $ start_time $ duration;
112104 " gc-stats" , Gc_stats. main Format. std_formatter $$ (List. map path $$ tracefiles);
0 commit comments