Module trace
Expand description
The trace tap: each emit, each listener heard, each ask and its drain, reported as it happens to the sinks that observe the kernel.
Off by default and gated by one counter of observers: with none, an emit costs one relaxed atomic load more, as the timing flag does, and nothing is built or recorded. With one or more, each event goes to every sink, synchronously, on the thread that made it: a sink may read the thread’s context (which panel is drawing, which command runs) to tag the event.
The tap is a capability of the kernel (Trace, found through
Bus::capability as dyn Trace), so an
application holding an Arc<dyn Bus> reaches it with
BusTrace::trace. Its contract (CONTRACT) lives here for now:
once a second implementation offers it, it moves to a contract crate
of its own, as the timings did.
Structs§
- Observing
- Keeps a sink observing a bus (
Trace::add_trace_sink); dropping it removes the sink. - Trace
Event - One thing the bus did, as a sink receives it.
Enums§
- Outcome
- What a listener answered (
Traced::Heard), before the point’s rules judge it: a refusal on a point that is not a request counts as a failure there. - Traced
- What a
TraceEventreports.
Constants§
- CONTRACT
- The trace contract: a bus offers it by answering for
dyn TraceinBus::capability.
Traits§
- BusTrace
- The trace of a bus, found through its capability lookup.
- Trace
- A capability of a bus (
BusTrace::trace): every emit, listener run, ask and drain reported to the sinks observing it, as it happens.
Type Aliases§
- Trace
Sink - Receives each
TraceEvent, on the thread that made it.