Expand description
Optional probe instrumentation. With the probe feature off this
is a tiny module of no-op stubs and pays zero cost.
Optional fine-grained timing + RSS instrumentation.
Behind the probe feature flag every [Probe::span] returns a guard
that records the elapsed wall-clock on Drop, and
[Probe::sample_rss] records a labelled RSS checkpoint. Events are
buffered in a per-thread Vec and drained by the consumer with
[Probe::drain].
With the feature off every method is a #[inline(always)] no-op so
release builds without the feature pay zero cost.
Consumer (e.g. servo-shot) groups drained events by name to produce the per-phase averages / p99s in its trace report.
Structs§
- Event
- Drained probe event.
Vec<Event>is what consumers walk to render trace summaries; the order is the order events fired in. - Probe
- Probe API. All methods are no-ops without the
probefeature. - Span
- Re-exported guard. Held by the caller of
Probe::span.
Enums§
Functions§
- detail_
enabled - emit_
phase_ heap - emit_
phase_ heap_ extra - hint_
purge_ allocator - Ask the active global allocator to return freed pages to the OS.
- malloc_
heap_ bytes - monotonic_
now_ nanos - Same monotonic clock used by
font::parsed::monotonic_now_nanosfor LRU stamping. Re-exported here so any caller that wants raw nanos without going through a span guard has one source of truth. - print_
drained_ events - Format drained probe events as a per-phase timing table to stderr.
- reset_
peak - sample_
peak_ rss - Convenience wrapper: sample the process’s current resident set
(not peak) via
task_infoon macOS //proc/self/statmon Linux and push it into the probe event buffer under the given label. - sample_
phase_ peak