@@ -125,7 +125,7 @@ impl PerfRunner {
125125 "sh" ,
126126 "-c" ,
127127 & format ! (
128- "perf record {quiet_flag} --user-callchains --freq=999 --switch-output --control=fifo:{},{} --delay=-1 -g --call-graph={cg_mode} --output={} -- {bench_cmd}" ,
128+ "perf record {quiet_flag} --timestamp -k CLOCK_MONOTONIC -- user-callchains --freq=999 --switch-output --control=fifo:{},{} --delay=-1 -g --call-graph={cg_mode} --output={} -- {bench_cmd}" ,
129129 perf_fifo. ctl_fifo_path. to_string_lossy( ) ,
130130 perf_fifo. ack_fifo_path. to_string_lossy( ) ,
131131 perf_file. path( ) . to_string_lossy( ) ,
@@ -305,10 +305,11 @@ impl PerfRunner {
305305 let mut bench_order_by_pid = HashMap :: < u32 , Vec < String > > :: new ( ) ;
306306 let mut symbols_by_pid = HashMap :: < u32 , ProcessSymbols > :: new ( ) ;
307307 let mut unwind_data_by_pid = HashMap :: < u32 , Vec < UnwindData > > :: new ( ) ;
308+ let mut markers_by_pid = HashMap :: < u32 , Vec < MarkerType > > :: new ( ) ;
309+
308310 let mut integration = None ;
309311 let mut perf_ping_timeout = 5 ;
310312
311- let perf_pid = OnceCell :: new ( ) ;
312313 loop {
313314 let perf_ping =
314315 tokio:: time:: timeout ( Duration :: from_secs ( perf_ping_timeout) , perf_fifo. ping ( ) )
@@ -343,22 +344,6 @@ impl PerfRunner {
343344 runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
344345 }
345346 FifoCommand :: StartBenchmark => {
346- let perf_pid = perf_pid. get_or_init ( || {
347- let output = std:: process:: Command :: new ( "sh" )
348- . arg ( "-c" )
349- . arg ( "pidof -s perf" )
350- . output ( )
351- . expect ( "Failed to run pidof command" ) ;
352-
353- String :: from_utf8_lossy ( & output. stdout )
354- . trim ( )
355- . parse :: < u32 > ( )
356- . expect ( "Failed to parse perf pid" )
357- } ) ;
358-
359- // Split the perf.data file
360- run_with_sudo ( & [ "kill" , "-USR2" , & perf_pid. to_string ( ) ] ) ?;
361-
362347 perf_fifo. start_events ( ) . await ?;
363348 runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
364349 }
@@ -377,6 +362,10 @@ impl PerfRunner {
377362 integration = Some ( ( name, version) ) ;
378363 runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
379364 }
365+ FifoCommand :: AddMarker { pid, marker } => {
366+ markers_by_pid. entry ( pid) . or_default ( ) . push ( marker) ;
367+ runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
368+ }
380369 FifoCommand :: Ack => unreachable ! ( ) ,
381370 FifoCommand :: Err => unreachable ! ( ) ,
382371 }
0 commit comments