Struct aya::maps::perf::AsyncPerfEventArrayBuffer [−][src]
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
pub 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.