pub enum WakeupPolicy {
EventCount(u32),
Watermark(u32),
}
Expand description
Wakeup policy for “overflow notifications”. This controls the point at
which the read
call completes. (TODO: double check this)
There are two ways to generate overflow notifications.
The first is to set a
WakeupPolicy
that will trigger if a certain number of samples or bytes have been written to the mmap ring buffer.The other way is by use of the PERF_EVENT_IOC_REFRESH ioctl. This ioctl adds to a counter that decrements each time the event overflows. When nonzero, POLLIN is indicated, but once the counter reaches 0 POLLHUP is indicated and the underlying event is disabled.
Variants§
EventCount(u32)
Wake up every time N records of type RecordType::SAMPLE
have been
written to the mmap ring buffer.
Watermark(u32)
Wake up after N bytes of any record type have been written to the mmap ring buffer.
To receive a wakeup after every single record, choose Watermark(1)
.
Watermark(0)
is treated the same as Watermark(1)
.
Trait Implementations§
Source§impl Clone for WakeupPolicy
impl Clone for WakeupPolicy
Source§fn clone(&self) -> WakeupPolicy
fn clone(&self) -> WakeupPolicy
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more