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 fn get_buffer(&self, cpu: usize) -> *mut KTraceBuffer
pub fn get_buffer(&self, cpu: usize) -> *mut KTraceBuffer
Returns the raw pointer to the KTraceBuffer for the given CPU.
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.
Sourcepub fn emit_kernel_object_outlined(
&self,
koid: u64,
obj_type: u32,
name: &InternedString,
args: &[Argument<'_>],
)
pub fn emit_kernel_object_outlined( &self, koid: u64, obj_type: u32, name: &InternedString, args: &[Argument<'_>], )
Low-level helper to write an FXT kernel object record.
This is not inlined to reduce code size at the instrumentation sites.
Sourcepub fn emit_event(
&self,
event_type: EventType,
category: &InternedCategory,
name: &InternedString,
timestamp: InstantBootTicks,
context: Context,
content: Option<u64>,
args: &[Argument<'_>],
)
pub fn emit_event( &self, event_type: EventType, category: &InternedCategory, name: &InternedString, timestamp: InstantBootTicks, context: Context, content: Option<u64>, args: &[Argument<'_>], )
Low-level helper to write a generic FXT event record.
This is not inlined to reduce code size at the instrumentation sites.