tools/include/uapi/linux/perf_event.h
Source file repositories/reference/linux-study-clean/tools/include/uapi/linux/perf_event.h
File Facts
- System
- Linux kernel
- Corpus path
tools/include/uapi/linux/perf_event.h- Extension
.h- Size
- 46434 bytes
- Lines
- 1529
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/ioctl.hasm/byteorder.h
Detected Declarations
struct perf_event_attrstruct perf_event_query_bpfstruct perf_event_mmap_pagestruct perf_event_headerstruct perf_ns_link_infostruct perf_branch_entryenum perf_type_idenum perf_hw_idenum perf_hw_cache_idenum perf_hw_cache_op_idenum perf_hw_cache_op_result_idenum perf_sw_idsenum perf_event_sample_formatenum perf_branch_sample_type_shiftenum perf_branch_sample_typeenum perf_sample_regs_abienum perf_event_read_formatenum perf_event_ioc_flagsenum perf_event_typeenum perf_record_ksymbol_typeenum perf_bpf_event_typeenum perf_callchain_context
Annotated Snippet
context_switch : 1, /* context switch data */
write_backward : 1, /* write ring buffer from end to beginning */
namespaces : 1, /* include namespaces data */
ksymbol : 1, /* include ksymbol events */
bpf_event : 1, /* include BPF events */
aux_output : 1, /* generate AUX records instead of events */
cgroup : 1, /* include cgroup events */
text_poke : 1, /* include text poke events */
build_id : 1, /* use build ID in mmap2 events */
inherit_thread : 1, /* children only inherit if cloned with CLONE_THREAD */
remove_on_exec : 1, /* event is removed from task on exec */
sigtrap : 1, /* send synchronous SIGTRAP on event */
defer_callchain: 1, /* request PERF_RECORD_CALLCHAIN_DEFERRED records */
defer_output : 1, /* output PERF_RECORD_CALLCHAIN_DEFERRED records */
__reserved_1 : 24;
union {
__u32 wakeup_events; /* wake up every n events */
__u32 wakeup_watermark; /* bytes before wakeup */
};
__u32 bp_type;
union {
__u64 bp_addr;
__u64 kprobe_func; /* for perf_kprobe */
__u64 uprobe_path; /* for perf_uprobe */
__u64 config1; /* extension of config */
};
union {
__u64 bp_len;
__u64 kprobe_addr; /* when kprobe_func == NULL */
__u64 probe_offset; /* for perf_[k,u]probe */
__u64 config2; /* extension of config1 */
};
__u64 branch_sample_type; /* enum perf_branch_sample_type */
/*
* Defines set of user regs to dump on samples.
* See asm/perf_regs.h for details.
*/
__u64 sample_regs_user;
/*
* Defines size of the user stack to dump on samples.
*/
__u32 sample_stack_user;
__s32 clockid;
/*
* 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.
*/
__u64 sample_regs_intr;
/*
* Wakeup watermark for AUX area
*/
__u32 aux_watermark;
/*
* Max number of frame pointers in a callchain, should be
* lower than /proc/sys/kernel/perf_event_max_stack.
*
* Max number of entries of branch stack should be lower
* than the hardware limit.
*/
__u16 sample_max_stack;
__u16 __reserved_2;
__u32 aux_sample_size;
union {
__u32 aux_action;
struct {
__u32 aux_start_paused : 1, /* start AUX area tracing paused */
aux_pause : 1, /* on overflow, pause AUX area tracing */
aux_resume : 1, /* on overflow, resume AUX area tracing */
__reserved_3 : 29;
};
};
/*
* 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.
Annotation
- Immediate include surface: `linux/types.h`, `linux/ioctl.h`, `asm/byteorder.h`.
- Detected declarations: `struct perf_event_attr`, `struct perf_event_query_bpf`, `struct perf_event_mmap_page`, `struct perf_event_header`, `struct perf_ns_link_info`, `struct perf_branch_entry`, `enum perf_type_id`, `enum perf_hw_id`, `enum perf_hw_cache_id`, `enum perf_hw_cache_op_id`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.