pub struct KTrace { /* private fields */ }Expand description
A pure Rust implementation of KTrace.
Implementations§
Source§impl KTrace
impl KTrace
Sourcepub fn get_instance() -> &'static Self
pub fn get_instance() -> &'static Self
Retrieve the global instance of KTrace.
Sourcepub unsafe fn reserve(
&self,
header: u64,
) -> Result<KTraceReservation<'_>, Status>
pub unsafe fn reserve( &self, header: u64, ) -> Result<KTraceReservation<'_>, Status>
Reserves a slot of memory to write a record into.
§Safety
This method MUST be invoked with interrupts disabled to enforce the single-writer invariant.
Sourcepub fn writes_enabled(&self) -> bool
pub fn writes_enabled(&self) -> bool
Returns true if writes are currently enabled.
Sourcepub fn categories_bitmask(&self) -> u32
pub fn categories_bitmask(&self) -> u32
Returns the categories bitmask.
Sourcepub fn is_category_enabled(&self, category: &InternedCategory) -> bool
pub fn is_category_enabled(&self, category: &InternedCategory) -> bool
Returns true if the given category is enabled.