tools/perf/util/pmu.h
Source file repositories/reference/linux-study-clean/tools/perf/util/pmu.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/pmu.h- Extension
.h- Size
- 12080 bytes
- Lines
- 376
- 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/bitmap.hlinux/compiler.hlinux/perf_event.hlinux/list.hstdbool.hstdio.hparse-events.hpmu-events/pmu-events.hmap_symbol.hmem-events.h
Detected Declarations
struct evsel_config_termstruct hashmapstruct perf_cpu_mapstruct print_callbacksstruct perf_event_attrstruct perf_pmu_capsstruct perf_pmustruct perf_pmu_infostruct pmu_event_infostruct perf_pmu_formatenum pmu_kindfunction perf_pmu__kind
Annotated Snippet
struct perf_pmu_caps {
char *name;
char *value;
struct list_head list;
};
enum pmu_kind {
/* A perf event syscall PMU. */
PERF_PMU_KIND_PE,
/* A perf tool provided DRM PMU. */
PERF_PMU_KIND_DRM,
/* A perf tool provided HWMON PMU. */
PERF_PMU_KIND_HWMON,
/* Perf tool provided PMU for tool events like time. */
PERF_PMU_KIND_TOOL,
/* A testing PMU kind. */
PERF_PMU_KIND_FAKE
};
enum {
PERF_PMU_TYPE_PE_START = 0,
PERF_PMU_TYPE_PE_END = 0xFFFDFFFF,
PERF_PMU_TYPE_DRM_START = 0xFFFE0000,
PERF_PMU_TYPE_DRM_END = 0xFFFEFFFF,
PERF_PMU_TYPE_HWMON_START = 0xFFFF0000,
PERF_PMU_TYPE_HWMON_END = 0xFFFFFFFD,
PERF_PMU_TYPE_TOOL = 0xFFFFFFFE,
PERF_PMU_TYPE_FAKE = 0xFFFFFFFF,
};
/**
* struct perf_pmu
*/
struct perf_pmu {
/** @name: The name of the PMU such as "cpu". */
const char *name;
/**
* @alias_name: Optional alternate name for the PMU determined in
* architecture specific code.
*/
char *alias_name;
/**
* @id: Optional PMU identifier read from
* <sysfs>/bus/event_source/devices/<name>/identifier.
*/
const char *id;
/**
* @type: Perf event attributed type value, read from
* <sysfs>/bus/event_source/devices/<name>/type.
*/
__u32 type;
/**
* @selectable: Can the PMU name be selected as if it were an event?
*/
bool selectable;
/**
* @is_core: Is the PMU the core CPU PMU? Determined by the name being
* "cpu" or by the presence of
* <sysfs>/bus/event_source/devices/<name>/cpus. There may be >1 core
* PMU on systems like Intel hybrid.
*/
bool is_core;
/**
* @is_uncore: Is the PMU not within the CPU core? Determined by the
* presence of <sysfs>/bus/event_source/devices/<name>/cpumask.
*/
bool is_uncore;
/**
* @auxtrace: Are events auxiliary events? Determined in architecture
* specific code.
*/
bool auxtrace;
/**
* @formats_checked: Only check PMU's formats are valid for
* perf_event_attr once.
*/
bool formats_checked;
/** @config_masks_present: Are there config format values? */
bool config_masks_present;
/** @config_masks_computed: Set when masks are lazily computed. */
bool config_masks_computed;
/**
* @max_precise: Number of levels of :ppp precision supported by the
* PMU, read from
* <sysfs>/bus/event_source/devices/<name>/caps/max_precise.
*/
int max_precise;
/**
* @perf_event_attr_init_default: Optional function to default
* initialize PMU specific parts of the perf_event_attr.
Annotation
- Immediate include surface: `linux/bitmap.h`, `linux/compiler.h`, `linux/perf_event.h`, `linux/list.h`, `stdbool.h`, `stdio.h`, `parse-events.h`, `pmu-events/pmu-events.h`.
- Detected declarations: `struct evsel_config_term`, `struct hashmap`, `struct perf_cpu_map`, `struct print_callbacks`, `struct perf_event_attr`, `struct perf_pmu_caps`, `struct perf_pmu`, `struct perf_pmu_info`, `struct pmu_event_info`, `struct perf_pmu_format`.
- 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.