tools/perf/pmu-events/pmu-events.h
Source file repositories/reference/linux-study-clean/tools/perf/pmu-events/pmu-events.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/pmu-events/pmu-events.h- Extension
.h- Size
- 4663 bytes
- Lines
- 145
- 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
stdbool.hstddef.h
Detected Declarations
struct perf_pmustruct pmu_eventstruct pmu_metricstruct pmu_events_tablestruct pmu_metrics_tableenum aggr_mode_classenum metric_event_groups
Annotated Snippet
struct pmu_event {
const char *name;
const char *compat;
const char *event;
const char *desc;
const char *topic;
const char *long_desc;
const char *pmu;
const char *unit;
const char *retirement_latency_mean;
const char *retirement_latency_min;
const char *retirement_latency_max;
bool perpkg;
bool deprecated;
};
struct pmu_metric {
const char *pmu;
const char *metric_name;
const char *metric_group;
const char *metric_expr;
const char *metric_threshold;
const char *unit;
const char *compat;
const char *desc;
const char *long_desc;
const char *metricgroup_no_group;
const char *default_metricgroup_name;
enum aggr_mode_class aggr_mode;
enum metric_event_groups event_grouping;
bool default_show_events;
};
struct pmu_events_table;
struct pmu_metrics_table;
#define PMU_EVENTS__NOT_FOUND -1000
#define PMU_METRICS__NOT_FOUND -1000
typedef int (*pmu_event_iter_fn)(const struct pmu_event *pe,
const struct pmu_events_table *table,
void *data);
typedef int (*pmu_metric_iter_fn)(const struct pmu_metric *pm,
const struct pmu_metrics_table *table,
void *data);
int pmu_events_table__for_each_event(const struct pmu_events_table *table,
struct perf_pmu *pmu,
pmu_event_iter_fn fn,
void *data);
/*
* Search for a table and entry matching with pmu__name_wildcard_match or any
* tables if pmu is NULL. Each matching event has fn called on it. 0 implies to
* success/continue the search while non-zero means to terminate. The special
* value PMU_EVENTS__NOT_FOUND is used to indicate no event was found in one of
* the tables which doesn't terminate the search of all tables.
*/
int pmu_events_table__find_event(const struct pmu_events_table *table,
struct perf_pmu *pmu,
const char *name,
pmu_event_iter_fn fn,
void *data);
size_t pmu_events_table__num_events(const struct pmu_events_table *table,
struct perf_pmu *pmu);
int pmu_metrics_table__for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn,
void *data);
/*
* Search for a table and entry matching with pmu__name_wildcard_match or any
* tables if pmu is NULL. Each matching metric has fn called on it. 0 implies to
* success/continue the search while non-zero means to terminate. The special
* value PMU_METRICS__NOT_FOUND is used to indicate no metric was found in one
* of the tables which doesn't terminate the search of all tables.
*/
int pmu_metrics_table__find_metric(const struct pmu_metrics_table *table,
struct perf_pmu *pmu,
const char *metric,
pmu_metric_iter_fn fn,
void *data);
const struct pmu_events_table *perf_pmu__find_events_table(struct perf_pmu *pmu);
const struct pmu_events_table *perf_pmu__default_core_events_table(void);
const struct pmu_metrics_table *pmu_metrics_table__find(void);
const struct pmu_metrics_table *pmu_metrics_table__default(void);
const struct pmu_events_table *find_core_events_table(const char *arch, const char *cpuid);
const struct pmu_metrics_table *find_core_metrics_table(const char *arch, const char *cpuid);
int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data);
int pmu_for_each_core_metric(pmu_metric_iter_fn fn, void *data);
Annotation
- Immediate include surface: `stdbool.h`, `stddef.h`.
- Detected declarations: `struct perf_pmu`, `struct pmu_event`, `struct pmu_metric`, `struct pmu_events_table`, `struct pmu_metrics_table`, `enum aggr_mode_class`, `enum metric_event_groups`.
- 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.