pub struct KTraceBuffer { /* private fields */ }Expand description
A Rust implementation of percpu_writer::Buffer that wraps a static reference to an existing
spsc_buffer::Buffer and tracks dropped trace records.
Implementations§
Source§impl KTraceBuffer
impl KTraceBuffer
Sourcepub fn read<F>(&self, copy_fn: F, len: u32) -> Result<u32, Status>where
F: FnMut(u32, &[u8]) -> Result<(), Status>,
pub fn read<F>(&self, copy_fn: F, len: u32) -> Result<u32, Status>where
F: FnMut(u32, &[u8]) -> Result<(), Status>,
Copies len bytes out of the buffer using the provided copy_fn.
Sourcepub fn reserve(&mut self, header: u64) -> Result<KTraceReservation<'_>, Status>
pub fn reserve(&mut self, header: u64) -> Result<KTraceReservation<'_>, Status>
Reserves a block of the given size in the buffer, interposing to write dropped record statistics if any were tracked.
Sourcepub fn emit_drop_stats(&mut self) -> Result<(), Status>
pub fn emit_drop_stats(&mut self) -> Result<(), Status>
Emit the dropped record stats to the trace buffer if we’re currently tracking them.
Sourcepub fn reset_drop_stats(&mut self)
pub fn reset_drop_stats(&mut self)
Resets the dropped records statistics to their initial values.