mod emitter;
mod event;
mod recorder;
mod stream;
pub(crate) use emitter::Emitter;
pub use event::{
EventSequence, EvidenceWakeCause, QueueKind, RuntimeEvent, RuntimeEventKind, StackDisposition,
StackId, TaskOutcome, TimerRetirement, WaitKey, WakeOrigin, WakeRejection,
};
pub(crate) use recorder::{Recorder, bounded};
pub use stream::{EvidenceRecvError, EvidenceStatus, EvidenceStream};
pub const SCHEMA_VERSION: u16 = 1;
#[derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
::core::cmp::PartialEq,
::core::cmp::Eq,
)]
pub struct EvidenceCapabilities(u64);
impl EvidenceCapabilities {
pub const TOTAL_ORDER: Self = Self(1 << 0);
pub const OWNED_SCOPE_LIFECYCLE: Self = Self(1 << 1);
pub const TASK_LIFECYCLE: Self = Self(1 << 2);
pub const WAIT_GENERATIONS: Self = Self(1 << 3);
pub const WAKE_SELECTION: Self = Self(1 << 4);
pub const STACK_IDENTITIES: Self = Self(1 << 5);
pub const TIMER_LIFECYCLE: Self = Self(1 << 6);
pub const QUEUE_DEPTHS: Self = Self(1 << 7);
pub const SHUTDOWN_LIFECYCLE: Self = Self(1 << 8);
pub const CARRIER_AFFINITY: Self = Self(1 << 9);
pub const STALE_WAKE_PROBE: Self = Self(1 << 10);
pub const WAKE_ORIGINS: Self = Self(1 << 11);
fn runtime() -> Self {
let base = Self::TOTAL_ORDER.0
| Self::OWNED_SCOPE_LIFECYCLE.0
| Self::TASK_LIFECYCLE.0
| Self::WAIT_GENERATIONS.0
| Self::WAKE_SELECTION.0
| Self::STACK_IDENTITIES.0
| Self::TIMER_LIFECYCLE.0
| Self::QUEUE_DEPTHS.0
| Self::SHUTDOWN_LIFECYCLE.0
| Self::CARRIER_AFFINITY.0
| Self::WAKE_ORIGINS.0;
#[cfg(feature = "qualification")]
let base = base | Self::STALE_WAKE_PROBE.0;
Self(base)
}
pub fn contains(self, requested: Self) -> bool {
self.0 & requested.0 == requested.0
}
pub fn bits(self) -> u64 {
self.0
}
}
impl std::ops::BitOr for EvidenceCapabilities {
type Output = Self;
fn bitor(self, rhs: Self) -> Self::Output {
Self(self.0 | rhs.0)
}
}
impl std::ops::BitOrAssign for EvidenceCapabilities {
fn bitor_assign(&mut self, rhs: Self) {
self.0 |= rhs.0;
}
}
#[cfg(test)]
#[path = "evidence_test.rs"]
mod evidence_test;