Struct rustc_data_structures::profiling::SelfProfilerRef [−][src]
pub struct SelfProfilerRef {
profiler: Option<Arc<SelfProfiler>>,
event_filter_mask: EventFilter,
print_verbose_generic_activities: bool,
print_extra_verbose_generic_activities: bool,
}
Expand description
A reference to the SelfProfiler. It can be cloned and sent across thread boundaries at will.
Fields
profiler: Option<Arc<SelfProfiler>>
event_filter_mask: EventFilter
print_verbose_generic_activities: bool
print_extra_verbose_generic_activities: bool
Implementations
pub fn new(
profiler: Option<Arc<SelfProfiler>>,
print_verbose_generic_activities: bool,
print_extra_verbose_generic_activities: bool
) -> SelfProfilerRef
fn exec<F>(&self, event_filter: EventFilter, f: F) -> TimingGuard<'_> where
F: for<'a> FnOnce(&'a SelfProfiler) -> TimingGuard<'a>,
pub fn verbose_generic_activity<'a>(
&'a self,
event_label: &'static str
) -> VerboseTimingGuard<'a>
pub fn verbose_generic_activity<'a>(
&'a self,
event_label: &'static str
) -> VerboseTimingGuard<'a>
Start profiling a verbose generic activity. Profiling continues until the VerboseTimingGuard returned from this call is dropped. In addition to recording a measureme event, “verbose” generic activities also print a timing entry to stdout if the compiler is invoked with -Ztime or -Ztime-passes.
pub fn extra_verbose_generic_activity<'a, A>(
&'a self,
event_label: &'static str,
event_arg: A
) -> VerboseTimingGuard<'a> where
A: Borrow<str> + Into<String>,
pub fn extra_verbose_generic_activity<'a, A>(
&'a self,
event_label: &'static str,
event_arg: A
) -> VerboseTimingGuard<'a> where
A: Borrow<str> + Into<String>,
Start profiling an extra verbose generic activity. Profiling continues until the VerboseTimingGuard returned from this call is dropped. In addition to recording a measureme event, “extra verbose” generic activities also print a timing entry to stdout if the compiler is invoked with -Ztime-passes.
Start profiling a generic activity. Profiling continues until the TimingGuard returned from this call is dropped.
Start profiling with some event filter for a given event. Profiling continues until the TimingGuard returned from this call is dropped.
pub fn generic_activity_with_arg<A>(
&self,
event_label: &'static str,
event_arg: A
) -> TimingGuard<'_> where
A: Borrow<str> + Into<String>,
pub fn generic_activity_with_arg<A>(
&self,
event_label: &'static str,
event_arg: A
) -> TimingGuard<'_> where
A: Borrow<str> + Into<String>,
Start profiling a generic activity. Profiling continues until the TimingGuard returned from this call is dropped.
Record the size of an artifact that the compiler produces
artifact_kind
is the class of artifact (e.g., query_cache, object_file, etc.)
artifact_name
is an identifier to the specific artifact being stored (usually a filename)
pub fn generic_activity_with_args(
&self,
event_label: &'static str,
event_args: &[String]
) -> TimingGuard<'_>
Start profiling a query provider. Profiling continues until the TimingGuard returned from this call is dropped.
Record a query in-memory cache hit.
Start profiling a query being blocked on a concurrent execution. Profiling continues until the TimingGuard returned from this call is dropped.
Start profiling how long it takes to load a query result from the incremental compilation on-disk cache. Profiling continues until the TimingGuard returned from this call is dropped.
Start profiling how long it takes to hash query results for incremental compilation. Profiling continues until the TimingGuard returned from this call is dropped.
fn instant_query_event(
&self,
event_kind: fn(_: &SelfProfiler) -> StringId,
query_invocation_id: QueryInvocationId,
event_filter: EventFilter
)
Gets a StringId
for the given string. This method makes sure that
any strings going through it will only be allocated once in the
profiling data.
Returns None
if the self-profiling is not enabled.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SelfProfilerRef
impl Send for SelfProfilerRef
impl Sync for SelfProfilerRef
impl Unpin for SelfProfilerRef
impl !UnwindSafe for SelfProfilerRef
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes