Struct linux_perf_event_reader::PerfEventAttr
source · [−]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
sourceimpl Clone for PerfEventAttr
impl Clone for PerfEventAttr
sourcefn clone(&self) -> PerfEventAttr
fn clone(&self) -> PerfEventAttr
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PerfEventAttr
impl Debug for PerfEventAttr
impl Copy for PerfEventAttr
Auto Trait Implementations
impl RefUnwindSafe for PerfEventAttr
impl Send for PerfEventAttr
impl Sync for PerfEventAttr
impl Unpin for PerfEventAttr
impl UnwindSafe for PerfEventAttr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more