Fix finish_stage call (#3014)

* fixer

* clp

---------

Co-authored-by: toka <toka@tokas-MacBook-Air.local>
This commit is contained in:
Dongjia "toka" Zhang 2025-02-21 12:23:00 +01:00 committed by GitHub
parent 1debeb74a7
commit d40f18f377
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 22 deletions

View File

@ -49,7 +49,7 @@ pub use verify_timeouts::{TimeoutsToVerify, VerifyTimeoutsStage};
use crate::{ use crate::{
corpus::{CorpusId, HasCurrentCorpusId}, corpus::{CorpusId, HasCurrentCorpusId},
events::SendExiting, events::SendExiting,
state::{HasCurrentStageId, HasExecutions, Stoppable}, state::{HasCurrentStageId, HasExecutions, MaybeHasClientPerfMonitor, Stoppable},
Error, HasNamedMetadata, Error, HasNamedMetadata,
}; };
@ -151,7 +151,7 @@ impl<Head, Tail, E, EM, S, Z> StagesTuple<E, EM, S, Z> for (Head, Tail)
where where
Head: Stage<E, EM, S, Z> + Restartable<S>, Head: Stage<E, EM, S, Z> + Restartable<S>,
Tail: StagesTuple<E, EM, S, Z> + HasConstLen, Tail: StagesTuple<E, EM, S, Z> + HasConstLen,
S: HasCurrentStageId + Stoppable, S: HasCurrentStageId + Stoppable + MaybeHasClientPerfMonitor,
EM: SendExiting, EM: SendExiting,
{ {
/// Performs all stages in the tuple, /// Performs all stages in the tuple,
@ -192,6 +192,10 @@ where
} }
} }
// Mark the elapsed time for the scheduler
#[cfg(feature = "introspection")]
state.introspection_stats_mut().finish_stage();
if state.stop_requested() { if state.stop_requested() {
state.discard_stop_request(); state.discard_stop_request();
manager.on_shutdown()?; manager.on_shutdown()?;

View File

@ -163,12 +163,7 @@ where
state: &mut S, state: &mut S,
manager: &mut EM, manager: &mut EM,
) -> Result<(), Error> { ) -> Result<(), Error> {
let ret = self.perform_mutational(fuzzer, executor, state, manager); self.perform_mutational(fuzzer, executor, state, manager)
#[cfg(feature = "introspection")]
state.introspection_stats_mut().finish_stage();
ret
} }
} }

View File

@ -139,9 +139,6 @@ where
fuzzer.evaluate_input(state, executor, manager, &input)?; fuzzer.evaluate_input(state, executor, manager, &input)?;
} }
#[cfg(feature = "introspection")]
state.introspection_stats_mut().finish_stage();
Ok(()) Ok(())
} }
} }
@ -307,8 +304,6 @@ where
} }
self.client.process(fuzzer, state, executor, manager)?; self.client.process(fuzzer, state, executor, manager)?;
#[cfg(feature = "introspection")]
state.introspection_stats_mut().finish_stage();
Ok(()) Ok(())
} }
} }

View File

@ -91,9 +91,6 @@ where
) -> Result<(), Error> { ) -> Result<(), Error> {
self.perform_minification(fuzzer, executor, state, manager)?; self.perform_minification(fuzzer, executor, state, manager)?;
#[cfg(feature = "introspection")]
state.introspection_stats_mut().finish_stage();
Ok(()) Ok(())
} }
} }

View File

@ -210,12 +210,7 @@ where
state: &mut S, state: &mut S,
manager: &mut EM, manager: &mut EM,
) -> Result<(), Error> { ) -> Result<(), Error> {
let ret = self.perform_mutational(fuzzer, executor, state, manager); self.perform_mutational(fuzzer, executor, state, manager)
#[cfg(feature = "introspection")]
state.introspection_stats_mut().finish_stage();
ret
} }
} }