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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KTrace
impl RefUnwindSafe for KTrace
impl Unpin for KTrace
impl UnsafeUnpin for KTrace
impl UnwindSafe for KTrace
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Init<T> for T
impl<T> Init<T> for T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more§impl<T> ToMutPtr for Twhere
T: ?Sized,
impl<T> ToMutPtr for Twhere
T: ?Sized,
§fn to_mut_ptr(&self) -> *mut T
fn to_mut_ptr(&self) -> *mut T
Casts the reference to a mutable raw pointer.