Skip to main content

Module diagnostics

Module diagnostics 

Source
Expand description

Runtime and stack-pool diagnostics.

Diagnostic records are observations with private fields, not scheduler inputs.

ⓘ
let snapshot = vthread::diagnostics::RuntimeSnapshot { active: 0 };

Extensible diagnostic enums require a fallback arm downstream.

ⓘ
use vthread::diagnostics::CarrierStatus;
fn exhaustive(status: CarrierStatus) { match status {
    CarrierStatus::Idle | CarrierStatus::Running | CarrierStatus::Stopped | CarrierStatus::Failed => ()
} }

Modules§

evidence
Opt-in, bounded runtime evidence for qualification and exact replay.
qualification
Explicit generation-bound wake handles for runtime qualification.

Structs§

CarrierId
Stable carrier index within one runtime.
CarrierSnapshot
Owner-local scheduler counters published by a carrier.
ChannelCounters
Counts for carrier-initiated operations after their initial checkpoint. Stored counts permit writes, including rewrites of an already stored permit; it is not a count of distinct future resumptions. Closure broadcasts are included.
DumpReport
Accounting for one bounded dump write.
HandoffDuration
Fixed-size elapsed-time distribution. Counts are cumulative; total nanoseconds saturate at u64::MAX. Observations are diagnostic, not headline latency data.
HandoffProfile
Cumulative evidence attributed to the executing owner carrier. Native callers without a mounted carrier route are not counted. No new shared counter atomics or per-observation allocations are used. Active snapshots can lag; shutdown publishes final totals. Enabled clocks, TLS accesses and larger snapshots affect scheduling, so this feature cannot supply uninstrumented performance claims.
LifecycleProfile
Cumulative task lifecycle work observed by one runtime.
MutexCounters
Carrier-initiated mutex operations after the entry checkpoint. try_lock calls and producers without a mounted carrier route are not counted. Stored grants include offers to inactive generations, not unique future acquisitions.
RuntimeId
Process-unique identity; it is not a persistent identifier across process restarts.
RuntimeSnapshot
Weakly consistent diagnostic view assembled from independently observed components.
RuntimeStats
Cumulative scheduler counters.
SchedulerProfile
Cumulative activity for one carrier, available with scheduler-profiling.
ScopeId
Owned root or supervisor identity within one runtime. Pair it with RuntimeId for process-wide correlation.
ServiceSnapshot
Bounded I/O and delegated-work activity for operator diagnostics.
StackSnapshot
Bounded stack-cache counters.
StallSnapshot
Most recent automatic scope recovery, retained after its task records are reclaimed.
TaskId
Stable identity assigned by one runtime.
TaskSnapshot
Immutable operator-facing task diagnostics.
ThreadFailure
One bounded component failure; ordinary task panics are reported by their handles.
ThreadFailures
Bounded retained terminal failures; further failures contribute to a counter.

Enums§

CarrierStatus
Health of one persistent carrier.
ChannelDirection
Endpoint direction; notification counters describe the waiter being notified.
FailurePhase
Boundary at which an owned thread failure was observed.
HandoffStage
A measured region, not a disjoint CPU-time category. Nested regions overlap; elapsed time includes preemption and must not be summed as CPU consumption.
ShutdownPhase
Furthest shutdown stage reached; stages never move backward between concurrent callers.
SuspensionReason
A reason a task voluntarily returned to its carrier.
TaskFailure
Why a carrier reclaimed a task without normal completion.
TaskStatus
Current scheduler-visible task state.
ThreadComponent
Which owned runtime component failed.
WakeReason
The winner that made one parked task runnable again.

Constants§

HANDOFF_DURATION_BOUNDS_NS
Inclusive duration histogram bounds in nanoseconds; the last bin includes all larger observations. Clock overhead is not subtracted.