pub struct PerfEventAttr {
Show 20 fields pub type_: u32, pub size: u32, pub config: u64, pub sampling_period_or_frequency: u64, pub sample_format: SampleFormat, pub read_format: ReadFormat, pub flags: AttrFlags, pub wakeup_events_or_watermark: u32, pub bp_type: HwBreakpointType, pub bp_addr_or_kprobe_func_or_uprobe_func_or_config1: u64, pub bp_len_or_kprobe_addr_or_probe_offset_or_config2: u64, pub branch_sample_format: BranchSampleFormat, pub sample_regs_user: u64, pub sample_stack_user: u32, pub clockid: ClockId, 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_: u32

Major type: hardware/software/tracepoint/etc.

size: u32

Size of the attr structure, for fwd/bwd compat.

config: u64

Type-specific configuration information.

sampling_period_or_frequency: u64

If AttrFlags::FREQ is set in flags, this is the sample frequency, otherwise it is the sample period.

union {
    /// Period of sampling
    __u64 sample_period;
    /// Frequency of sampling
    __u64 sample_freq;
};
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_events_or_watermark: u32

If AttrFlags::WATERMARK is set in flags, this is the watermark, otherwise it is the event count after which to wake up.

union {
    /// wakeup every n events
    __u32 wakeup_events;
    /// bytes before wakeup
    __u32 wakeup_watermark;
};
bp_type: HwBreakpointType

breakpoint type

bp_addr_or_kprobe_func_or_uprobe_func_or_config1: u64

Union discriminator is ???

union {
    __u64 bp_addr;
    __u64 kprobe_func; /* for perf_kprobe */
    __u64 uprobe_path; /* for perf_uprobe */
    __u64 config1; /* extension of config */
};
bp_len_or_kprobe_addr_or_probe_offset_or_config2: u64

Union discriminator is ???

union {
    __u64 bp_len; /* breakpoint length, uses HW_BREAKPOINT_LEN_* constants */
    __u64 kprobe_addr; /* when kprobe_func == NULL */
    __u64 probe_offset; /* for perf_[k,u]probe */
    __u64 config2; /* extension of config1 */
};
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.

clockid: ClockId

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

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.