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>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
.impl StructuralPartialEq for Timebase
Auto Trait Implementations§
impl Freeze for Timebase
impl RefUnwindSafe for Timebase
impl Send for Timebase
impl Sync for Timebase
impl Unpin for Timebase
impl UnwindSafe for Timebase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)