pub struct CpuProfiler { /* private fields */ }Available on crate feature
cpu-profiling only.Expand description
Process-wide CPU profiler. Registers a perf_event_open sampler and
drains raw stack traces into the trace stream on each flush cycle.
Worker attribution is left to analysis; each sample carries only its OS
tid, which the viewer maps to a worker via park/unpark events.
Implementations§
Source§impl CpuProfiler
impl CpuProfiler
Sourcepub const SOURCE_NAME: &'static str = "cpu_profile"
pub const SOURCE_NAME: &'static str = "cpu_profile"
Source::name of the CPU profiler. The runtime builder keys off this
to decide whether the pipeline symbolizes.
Sourcepub fn start(config: CpuProfilingConfig) -> Result<CpuProfiler, Error>
pub fn start(config: CpuProfilingConfig) -> Result<CpuProfiler, Error>
Start the process-wide CPU profiler with the given config.
Trait Implementations§
Source§impl Debug for CpuProfiler
impl Debug for CpuProfiler
Source§impl Source for CpuProfiler
impl Source for CpuProfiler
Source§fn on_thread_start(&mut self) -> Result<(), Error>
fn on_thread_start(&mut self) -> Result<(), Error>
Perf samples the whole process, so this only matters for the ctimer fallback, which arms a timer per thread.
Source§fn flush(&mut self, ctx: &FlushContext<'_>)
fn flush(&mut self, ctx: &FlushContext<'_>)
Drain pending data into the trace. Called once per flush cycle.
Source§fn on_thread_stop(&mut self)
fn on_thread_stop(&mut self)
Called when a thread stops. Per-thread sources use this to stop
tracking the current thread.
Source§fn segment_processor(&mut self) -> Option<Box<dyn SegmentProcessor>>
fn segment_processor(&mut self) -> Option<Box<dyn SegmentProcessor>>
Available on crate feature
pipeline only.A segment-processing stage this source’s data needs, folded into the
recorder’s default pipeline at build. Called once, at build. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for CpuProfiler
impl !Sync for CpuProfiler
impl !UnwindSafe for CpuProfiler
impl Freeze for CpuProfiler
impl Send for CpuProfiler
impl Unpin for CpuProfiler
impl UnsafeUnpin for CpuProfiler
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
Write
value to writerSource§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
Write
value to writerSource§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
Write
value to writerSource§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
Write
value to writerSource§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
Available on non-
metrique_require_explicit_impls only.The shape of values produced by this formatter. Read more
Source§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
Write
value to writer