tools/perf/util/event.h
Source file repositories/reference/linux-study-clean/tools/perf/util/event.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/event.h- Extension
.h- Size
- 11944 bytes
- Lines
- 438
- 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
stdio.hlinux/stddef.hperf/event.hlinux/types.h
Detected Declarations
struct dsostruct machinestruct perf_event_attrstruct perf_samplestruct ip_callchainstruct branch_stackstruct perf_synth_intel_ptwritestruct perf_synth_intel_mwaitstruct perf_synth_intel_pwrestruct perf_synth_intel_exstopstruct perf_synth_intel_pwrxstruct perf_synth_intel_cbrstruct perf_synth_intel_psbstruct perf_synth_intel_evdstruct perf_synth_intel_evtstruct perf_synth_intel_iflag_chgstruct powerpc_vpadtl_entrystruct perf_cpu_mapstruct perf_record_stat_configstruct perf_stat_configstruct perf_toolenum perf_synth_idfunction perf_event_header__cpumode_is_guestfunction perf_event_header__misc_is_guestfunction perf_event_header__is_guestfunction perf_event__is_guest
Annotated Snippet
struct ip_callchain {
u64 nr;
u64 ips[];
};
struct branch_stack;
enum {
PERF_IP_FLAG_BRANCH = 1ULL << 0,
PERF_IP_FLAG_CALL = 1ULL << 1,
PERF_IP_FLAG_RETURN = 1ULL << 2,
PERF_IP_FLAG_CONDITIONAL = 1ULL << 3,
PERF_IP_FLAG_SYSCALLRET = 1ULL << 4,
PERF_IP_FLAG_ASYNC = 1ULL << 5,
PERF_IP_FLAG_INTERRUPT = 1ULL << 6,
PERF_IP_FLAG_TX_ABORT = 1ULL << 7,
PERF_IP_FLAG_TRACE_BEGIN = 1ULL << 8,
PERF_IP_FLAG_TRACE_END = 1ULL << 9,
PERF_IP_FLAG_IN_TX = 1ULL << 10,
PERF_IP_FLAG_VMENTRY = 1ULL << 11,
PERF_IP_FLAG_VMEXIT = 1ULL << 12,
PERF_IP_FLAG_INTR_DISABLE = 1ULL << 13,
PERF_IP_FLAG_INTR_TOGGLE = 1ULL << 14,
PERF_IP_FLAG_BRANCH_MISS = 1ULL << 15,
PERF_IP_FLAG_NOT_TAKEN = 1ULL << 16,
};
#define PERF_IP_FLAG_CHARS "bcrosyiABExghDtmn"
#define PERF_ADDITIONAL_STATE_MASK \
(PERF_IP_FLAG_IN_TX | \
PERF_IP_FLAG_INTR_DISABLE | \
PERF_IP_FLAG_INTR_TOGGLE)
#define PERF_BRANCH_MASK (\
PERF_IP_FLAG_BRANCH |\
PERF_IP_FLAG_CALL |\
PERF_IP_FLAG_RETURN |\
PERF_IP_FLAG_CONDITIONAL |\
PERF_IP_FLAG_SYSCALLRET |\
PERF_IP_FLAG_ASYNC |\
PERF_IP_FLAG_INTERRUPT |\
PERF_IP_FLAG_TX_ABORT |\
PERF_IP_FLAG_TRACE_BEGIN |\
PERF_IP_FLAG_TRACE_END |\
PERF_IP_FLAG_VMENTRY |\
PERF_IP_FLAG_VMEXIT)
#define PERF_IP_FLAG_BRANCH_EVENT_MASK \
(PERF_IP_FLAG_BRANCH_MISS | \
PERF_IP_FLAG_NOT_TAKEN)
#define PERF_MEM_DATA_SRC_NONE \
(PERF_MEM_S(OP, NA) |\
PERF_MEM_S(LVL, NA) |\
PERF_MEM_S(SNOOP, NA) |\
PERF_MEM_S(LOCK, NA) |\
PERF_MEM_S(TLB, NA) |\
PERF_MEM_S(LVLNUM, NA))
/* Attribute type for custom synthesized events */
#define PERF_TYPE_SYNTH (INT_MAX + 1U)
/* Attribute config for custom synthesized events */
enum perf_synth_id {
PERF_SYNTH_INTEL_PTWRITE,
PERF_SYNTH_INTEL_MWAIT,
PERF_SYNTH_INTEL_PWRE,
PERF_SYNTH_INTEL_EXSTOP,
PERF_SYNTH_INTEL_PWRX,
PERF_SYNTH_INTEL_CBR,
PERF_SYNTH_INTEL_PSB,
PERF_SYNTH_INTEL_EVT,
PERF_SYNTH_INTEL_IFLAG_CHG,
PERF_SYNTH_POWERPC_VPA_DTL,
};
/*
* Raw data formats for synthesized events. Note that 4 bytes of padding are
* present to match the 'size' member of PERF_SAMPLE_RAW data which is always
* 8-byte aligned. That means we must dereference raw_data with an offset of 4.
* Refer perf_sample__synth_ptr() and perf_synth__raw_data(). It also means the
* structure sizes are 4 bytes bigger than the raw_size, refer
* perf_synth__raw_size().
*/
struct perf_synth_intel_ptwrite {
u32 padding;
union {
struct {
Annotation
- Immediate include surface: `stdio.h`, `linux/stddef.h`, `perf/event.h`, `linux/types.h`.
- Detected declarations: `struct dso`, `struct machine`, `struct perf_event_attr`, `struct perf_sample`, `struct ip_callchain`, `struct branch_stack`, `struct perf_synth_intel_ptwrite`, `struct perf_synth_intel_mwait`, `struct perf_synth_intel_pwre`, `struct perf_synth_intel_exstop`.
- 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.