File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/run/runner/wall_time/perf Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,7 @@ impl PerfRunner {
294294 . num_nanoseconds ( ) as u64
295295 } ;
296296
297+ let mut benchmark_started = false ;
297298 loop {
298299 let perf_ping =
299300 tokio:: time:: timeout ( Duration :: from_secs ( perf_ping_timeout) , perf_fifo. ping ( ) )
@@ -334,12 +335,25 @@ impl PerfRunner {
334335 runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
335336 }
336337 FifoCommand :: StartBenchmark => {
338+ if benchmark_started {
339+ warn ! ( "Received duplicate StartBenchmark command, ignoring" ) ;
340+ runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
341+ continue ;
342+ }
343+ benchmark_started = true ;
337344 markers. push ( MarkerType :: SampleStart ( current_time ( ) ) ) ;
338345
339346 perf_fifo. start_events ( ) . await ?;
340347 runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
341348 }
342349 FifoCommand :: StopBenchmark => {
350+ if !benchmark_started {
351+ warn ! ( "Received StopBenchmark command before StartBenchmark, ignoring" ) ;
352+ runner_fifo. send_cmd ( FifoCommand :: Ack ) . await ?;
353+ continue ;
354+ }
355+ benchmark_started = false ;
356+
343357 markers. push ( MarkerType :: SampleEnd ( current_time ( ) ) ) ;
344358
345359 perf_fifo. stop_events ( ) . await ?;
You can’t perform that action at this time.
0 commit comments