pub struct Timebase {
pub timestamp_clock: Option<i32>,
pub name: Option<String>,
pub interval: Option<Interval>,
pub event: Option<Event>,
}
Expand description
The primary event to count. If recording multiple events, this counter is the “group leader”. Commented from the perspective of its use in |PerfEventConfig|. Next id: 12
Fields§
§timestamp_clock: Option<i32>
If set, samples will be timestamped with the given clock. If unset, the clock is chosen by the implementation. For software events, prefer PERF_CLOCK_BOOTTIME. However it cannot be used for hardware events (due to interrupt safety), for which the recommendation is to use one of the monotonic clocks.
name: Option<String>
Optional arbitrary name for the event, to identify it in the parsed trace. Does not affect the profiling itself. If unset, the trace parser will choose a suitable name.
interval: Option<Interval>
How often to snapshot the counter, along with any follower events and any additional sampled data such as callstacks.
This choice also controls how the readings are taken:
- With |frequency| or |period|, samples are taken by the kernel
into a ring buffer. Analogous to
perf record
. - With |poll_period_ms|, the userspace periodically snapshots
the counters using the read syscall. Analogous to
perf stat -I
. Prefer the sampling options unless you’re recording PMUs whose perf drivers only support the reading mode.
If unset, an implementation-defined sampling default is used.
event: Option<Event>
Counting event to use as the timebase. If unset, implies the CPU timer (SW_CPU_CLOCK) as the event, which is what you usually want.
Implementations§
Source§impl Timebase
impl Timebase
Sourcepub fn timestamp_clock(&self) -> PerfClock
pub fn timestamp_clock(&self) -> PerfClock
Returns the enum value of timestamp_clock
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_timestamp_clock(&mut self, value: PerfClock)
pub fn set_timestamp_clock(&mut self, value: PerfClock)
Sets timestamp_clock
to the provided enum value.
Trait Implementations§
Source§impl Message for Timebase
impl Message for Timebase
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
.