pub struct Timebase {
pub timestamp_clock: Option<i32>,
pub name: Option<String>,
pub interval: Option<Interval>,
pub event: Option<Event>,
}
Expand description
What event to sample on, and how often. Commented from the perspective of its use in |PerfEventConfig|.
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 the per-cpu sampling will occur. Not guaranteed to be honored as the kernel can throttle the sampling rate if it’s too high. If unset, an implementation-defined default is used.
event: Option<Event>
Counting event to use as a timebase for the sampling. If unset, implies the CPU timer (SW_CPU_CLOCK) as the event, which is what you usually want. See common/perf_events.proto for the definitions.
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>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
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>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.