STRUCT PERF_PMU(9)
πΈ NAME πΈ
struct perf_pmu β and bestie, the tagline slot is literally empty in the original. No description, no subtitle, just the name and a whole lot of mystique. We move anyway π
β¨ SYNOPSIS β¨
Okay so here's the whole struct, copied exactly, no cap:
struct perf_pmu {
const char *name;
char *alias_name;
const char *id;
__u32 type;
bool selectable;
bool is_core;
bool is_uncore;
bool auxtrace;
bool formats_checked;
bool config_masks_present;
bool config_masks_computed;
int max_precise;
void (*perf_event_attr_init_default)(const struct perf_pmu *pmu,
struct perf_event_attr *attr);
struct perf_cpu_map *cpus;
struct list_head format;
struct hashmap *aliases;
const struct pmu_events_table *events_table;
uint32_t sysfs_aliases;
uint32_t cpu_json_aliases;
uint32_t sys_json_aliases;
uint32_t cpu_common_json_aliases;
bool sysfs_aliases_loaded;
bool cpu_aliases_added;
bool caps_initialized;
u32 nr_caps;
struct list_head caps;
struct list_head list;
__u64 config_masks[PERF_PMU_FORMAT_VALUE_CONFIG_END];
struct {
bool exclude_guest;
bool checked;
} missing_features;
struct perf_mem_event *mem_events;
};
(That line break in perf_event_attr_init_default's signature? That's how it is in the original, I'm not touching it π«Ά)
π Members π
Time for the member-by-member tour, grab a snack π
nameβ the name of the PMU, like"cpu".alias_nameβ optional alternate name for the PMU, determined in architecture specific code.idβ optional PMU identifier, read from<sysfs>/bus/event_source/devices/<name>/identifier.typeβ perf event attributed type value, read from<sysfs>/bus/event_source/devices/<name>/type.selectableβ can the PMU name be selected as if it were an event?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. Heads up: there may be >1 core PMU on systems like Intel hybrid πis_uncoreβ is the PMU not within the CPU core? Determined by the presence of<sysfs>/bus/event_source/devices/<name>/cpumask.auxtraceβ are events auxiliary events? Determined in architecture specific code.formats_checkedβ only check the PMU's formats are valid forperf_event_attronce. Efficiency slay β¨config_masks_presentβ are there config format values?config_masks_computedβ set when masks are lazily computed.max_preciseβ number of levels of:pppprecision supported by the PMU, read from<sysfs>/bus/event_source/devices/<name>/caps/max_precise.perf_event_attr_init_defaultβ optional function to default initialize PMU specific parts of theperf_event_attr.cpusβ empty, or the contents of either of these two:<sysfs>/bus/event_source/devices/<name>/cpumask.<sysfs>/bus/event_source/devices/<cpu>/cpus.
formatβ holds the contents of files read from<sysfs>/bus/event_source/devices/<name>/format/. Those contents specify which event parameter changes whatconfig,config1orconfig2bits.aliasesβ list ofstruct perf_pmu_alias. Each alias corresponds to an event read from<sysfs>/bus/event_source/devices/<name>/events/or from json events inpmu-events.c.events_tableβ the events table for json events inpmu-events.c.sysfs_aliasesβ number of sysfs aliases loaded.cpu_json_aliasesβ number of json event aliases loaded specific to the CPUID.sys_json_aliasesβ number of json event aliases loaded matching the PMU's identifier.cpu_common_json_aliasesβ number of json events that overlapped with sysfs when loading all sysfs events.sysfs_aliases_loadedβ are sysfs aliases loaded from disk?cpu_aliases_addedβ have all json events table entries for the PMU been added?caps_initializedβ has the listcapsbeen initialized?nr_capsβ the length of the listcaps.capsβ holds the contents of files read from<sysfs>/bus/event_source/devices/<name>/caps/.
So about those caps contents, bestie: they're pairs of the filename with the value of its contents. For example, max_precise (see above π) may have a value of 3. Periodt.
listβ element onpmuslist inpmu.c.config_masksβ derived from the PMU'sformatdata, the bits that are valid within the config value.missing_featuresβ features to inhibit when events on this PMU are opened. (It's a nested struct withexclude_guestandcheckedinside, iykyk π)mem_eventsβ list of the supported mem events.
π¦ SEE ALSO π¦
Go read these next, fr fr:
- Kernel file
./tools/perf/util/pmu.h struct perf_pmu_format(9)
Ok that's the whole thing, no notes, you ate π
Lives in ./tools/perf/util, dated October 2026 β catch you in the next manpage, mwah π§ββοΈπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms