xref: /linux/tools/perf/pmu-events/pmu-events.h (revision e5c86679d5e864947a52fb31e45a425dea3e7fa9)
1 #ifndef PMU_EVENTS_H
2 #define PMU_EVENTS_H
3 
4 /*
5  * Describe each PMU event. Each CPU has a table of PMU events.
6  */
7 struct pmu_event {
8 	const char *name;
9 	const char *event;
10 	const char *desc;
11 	const char *topic;
12 	const char *long_desc;
13 	const char *pmu;
14 	const char *unit;
15 	const char *perpkg;
16 };
17 
18 /*
19  *
20  * Map a CPU to its table of PMU events. The CPU is identified by the
21  * cpuid field, which is an arch-specific identifier for the CPU.
22  * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile
23  * must match the get_cpustr() in tools/perf/arch/xxx/util/header.c)
24  *
25  * The  cpuid can contain any character other than the comma.
26  */
27 struct pmu_events_map {
28 	const char *cpuid;
29 	const char *version;
30 	const char *type;		/* core, uncore etc */
31 	struct pmu_event *table;
32 };
33 
34 /*
35  * Global table mapping each known CPU for the architecture to its
36  * table of PMU events.
37  */
38 extern struct pmu_events_map pmu_events_map[];
39 
40 #endif
41