Skip to main content

KTrace

Struct KTrace 

Source
pub struct KTrace { /* private fields */ }
Expand description

A pure Rust implementation of KTrace.

Implementations§

Source§

impl KTrace

Source

pub fn get_instance() -> &'static Self

Retrieve the global instance of KTrace.

Source

pub fn get_buffer(&self, cpu: usize) -> *mut KTraceBuffer

Returns the raw pointer to the KTraceBuffer for the given CPU.

Source

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.

Source

pub fn writes_enabled(&self) -> bool

Returns true if writes are currently enabled.

Source

pub fn categories_bitmask(&self) -> u32

Returns the categories bitmask.

Source

pub fn is_category_enabled(&self, category: &InternedCategory) -> bool

Returns true if the given category is enabled.

Source

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.

Source

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§

Source§

impl Send for KTrace

Source§

impl Sync for KTrace

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Init<T> for T

§

unsafe fn __init(self, slot: *mut T) -> Result<(), Infallible>

Initializes slot. Read more
§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> PinInit<T> for T

§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>

Initializes slot. Read more
§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>
where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
§

impl<T> ToMutPtr for T
where T: ?Sized,

§

type Target = T

The target type of the pointer.
§

fn to_mut_ptr(&self) -> *mut T

Casts the reference to a mutable raw pointer.
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.