Skip to main content

ProfileState

Trait ProfileState 

Source
pub trait ProfileState: Send + Sync {
    // Required methods
    fn record_new(
        &mut self,
        volume: &Arc<FxVolume>,
        name: &str,
    ) -> Box<dyn Recorder>;
    fn replay_profile(
        &mut self,
        handle: Box<dyn ReadObjectHandle>,
        volume: Arc<FxVolume>,
        guard: ActiveGuard,
    );
    fn wait_for_replay_to_finish<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn wait_for_recording_to_finish<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Holds the current profile recording and/or replay state, and provides methods for state transitions.

Required Methods§

Source

fn record_new( &mut self, volume: &Arc<FxVolume>, name: &str, ) -> Box<dyn Recorder>

Creates a new recording and returns the Recorder object to record to. The recording finalizes when the associated Recorder is dropped. Stops any recording currently in progress.

Source

fn replay_profile( &mut self, handle: Box<dyn ReadObjectHandle>, volume: Arc<FxVolume>, guard: ActiveGuard, )

Reads given handle to parse a profile and replay it by requesting pages via ZX_VMO_OP_PREFETCH in blocking background threads. Stops any replay currently in progress.

Source

fn wait_for_replay_to_finish<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for replay to finish, but does not drop the cache. The cache will be dropped when the ProfileState impl is dropped. This is fine to call multiple times.

Source

fn wait_for_recording_to_finish<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for the recording to finish.

Implementors§