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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.