Expand description
Low-overhead causal profiling for KeyHog runs.
The disabled hot path performs one relaxed atomic load and does not read the clock. An enabled run records fixed scanner stages with allocation-free atomic counters. Run identity, state transitions, and process resources are sampled only at macro boundaries.
Structs§
- Resource
Sample - Process resource observation associated with a run-state boundary.
- Resource
Snapshot - Process resource observation at a macro boundary.
- Resource
Usage - Resource change across a completed profile session.
- RunIdentity
- Identity and execution choices required to compare two run records honestly.
- RunProfile
- Complete replayable profile record.
- Session
- One causal profiling session.
- Session
Active - Error returned when a process-global profile session is already active.
- Span
- Allocation-free stage guard. It contains no start timestamp while disabled.
- Stage
Measurement - One aggregate fixed-stage measurement.
- State
Transition - One run-state transition relative to session start.
Enums§
- Attribution
- Optional attribution for work performed inside a derived input.
- Cache
State - Cache state that materially changes run cost.
- Daemon
State - Daemon state that materially changes startup and resident work.
- RunState
- Coarse causal state of a profiling run.
- Stage
- Fixed measurement stages shared by scanner, source, verifier, and reporter paths.
Constants§
- PROFILE_
SCHEMA - Stable wire schema for persisted profiling records.
Functions§
- add_
input_ bytes - Add source bytes processed by the current profile.
- add_
input_ units - Add source units such as files, objects, responses, or chunks.
- enabled
- Return whether fixed-stage profiling is active.
- reset
- Discard fixed-stage counters and input totals.
- set_
attribution - Replace this thread’s attribution and return its previous value.
- set_
enabled - Enable or disable fixed-stage profiling.
- span
- Start one fixed-stage measurement.
- take_
input_ totals - Atomically read and clear aggregate input bytes and units.
- take_
stage_ measurements - Atomically read and clear all fixed-stage counters.