Expand description
A Future
based ring buffer that can receive events from eBPF programs.
AsyncPerfEventArrayBuffer
is a ring buffer that can receive events from eBPF programs that
use bpf_perf_event_output()
. It’s returned by AsyncPerfEventArray::open
.
See the AsyncPerfEventArray
documentation for an overview of how to
use perf buffers.
Implementations
sourceimpl<T: DerefMut<Target = Map>> AsyncPerfEventArrayBuffer<T>
impl<T: DerefMut<Target = Map>> AsyncPerfEventArrayBuffer<T>
sourcepub async fn read_events(
&mut self,
buffers: &mut [BytesMut]
) -> Result<Events, PerfBufferError>
pub async fn read_events(
&mut self,
buffers: &mut [BytesMut]
) -> Result<Events, PerfBufferError>
Reads events from the buffer.
This method reads events into the provided slice of buffers, filling each buffer in order stopping when there are no more events to read or all the buffers have been filled.
Returns the number of events read and the number of events lost. Events are lost when user space doesn’t read events fast enough and the ring buffer fills up.
Auto Trait Implementations
impl<T> RefUnwindSafe for AsyncPerfEventArrayBuffer<T> where
T: RefUnwindSafe,
impl<T> Send for AsyncPerfEventArrayBuffer<T> where
T: Send + Sync,
impl<T> Sync for AsyncPerfEventArrayBuffer<T> where
T: Send + Sync,
impl<T> Unpin for AsyncPerfEventArrayBuffer<T>
impl<T> UnwindSafe for AsyncPerfEventArrayBuffer<T> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more