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