pub struct TracePerformanceEventManager { /* private fields */ }Implementations§
Source§impl TracePerformanceEventManager
impl TracePerformanceEventManager
pub fn new() -> Self
Sourcepub fn start(&mut self, kernel: &Arc<Kernel>)
pub fn start(&mut self, kernel: &Arc<Kernel>)
Registers the map with the pid_table so the pid/tid to koid mappings can be recorded when new threads are created. Since processing the trace events could be done past a thread’s lifetime, no mappings are removed when a thread or process exits. Additional work may be needed to handle pid reuse (https://fxbug.dev/322874557), currently new mapping information overwrites existing mappings.
Calling |start| when this instance has already been started will panic.
NOTE: This will record all thread and process mappings until |stop| is called. The mapping will continue to exist in memory until |clear| is called. It is expected that this is a relatively short period of time, such as the time during capturing a performance trace.
Sourcepub fn stop(&mut self)
pub fn stop(&mut self)
Clears the pid to koid map reference in the kernel passed in to |start|. Stop is a no-op if start has not been called, or if stop has already been called.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the pid-koid map. After starting, call |load_pid_mappings| to initialize the table with existing task/process data.
Sourcepub fn map_pid_to_koid(&mut self, pid: pid_t) -> Koid
pub fn map_pid_to_koid(&mut self, pid: pid_t) -> Koid
Maps a “pid” to the koid. This is also referred to as the “Process Id” in Perfetto terms.
Sourcepub fn map_tid_to_koid(&mut self, tid: tid_t) -> Koid
pub fn map_tid_to_koid(&mut self, tid: tid_t) -> Koid
Maps a “tid” to the koid. This is also referred to as the “Thread Id” in Perfetto terms.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TracePerformanceEventManager
impl !RefUnwindSafe for TracePerformanceEventManager
impl Send for TracePerformanceEventManager
impl Sync for TracePerformanceEventManager
impl Unpin for TracePerformanceEventManager
impl !UnwindSafe for TracePerformanceEventManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more