Struct PerfEventAttr

Source
pub struct PerfEventAttr {
Show 15 fields pub type_: PerfEventType, pub sampling_policy: SamplingPolicy, pub sample_format: SampleFormat, pub read_format: ReadFormat, pub flags: AttrFlags, pub wakeup_policy: WakeupPolicy, pub branch_sample_format: BranchSampleFormat, pub sample_regs_user: u64, pub sample_stack_user: u32, pub clock: PerfClock, pub sample_regs_intr: u64, pub aux_watermark: u32, pub sample_max_stack: u16, pub aux_sample_size: u32, pub sig_data: u64,
}
Expand description

perf_event_attr

Fields§

§type_: PerfEventType

The type of the perf event.

§sampling_policy: SamplingPolicy

The sampling policy.

§sample_format: SampleFormat

Specifies values included in sample. (original name sample_type)

§read_format: ReadFormat

Specifies the structure values returned by read() on a perf event fd, see ReadFormat.

§flags: AttrFlags

Bitset of flags.

§wakeup_policy: WakeupPolicy

The wake-up policy.

§branch_sample_format: BranchSampleFormat

Branch-sample specific flags.

§sample_regs_user: u64

Defines set of user regs to dump on samples. See asm/perf_regs.h for details.

§sample_stack_user: u32

Defines size of the user stack to dump on samples.

§clock: PerfClock

The clock ID.

§sample_regs_intr: u64

Defines set of regs to dump for each sample state captured on:

  • precise = 0: PMU interrupt
  • precise > 0: sampled instruction

See asm/perf_regs.h for details.

§aux_watermark: u32

Wakeup watermark for AUX area

§sample_max_stack: u16

When collecting stacks, this is the maximum number of stack frames (user + kernel) to collect.

§aux_sample_size: u32

When sampling AUX events, this is the size of the AUX sample.

§sig_data: u64

User provided data if sigtrap=1, passed back to user via siginfo_t::si_perf_data, e.g. to permit user to identify the event. Note, siginfo_t::si_perf_data is long-sized, and sig_data will be truncated accordingly on 32 bit architectures.

Implementations§

Source§

impl PerfEventAttr

Source

pub fn parse<R: Read, T: ByteOrder>(reader: R) -> Result<(Self, u64), Error>

Parse from a reader. On success, this returns the parsed attribute and the number of bytes that were read from the reader. This matches the self-reported size in the attribute.

Trait Implementations§

Source§

impl Clone for PerfEventAttr

Source§

fn clone(&self) -> PerfEventAttr

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PerfEventAttr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for PerfEventAttr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.