xref: /freebsd/lib/libpmc/pmu-events/pmu-events.h (revision fe6060f10f634930ff71b7c50291ddc610da2475)
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 *event;
14 	const char *desc;
15 	const char *topic;
16 	const char *long_desc;
17 	const char *pmu;
18 	const char *unit;
19 	const char *perpkg;
20 	const char *metric_expr;
21 	const char *metric_name;
22 	const char *metric_group;
23 };
24 
25 /*
26  *
27  * Map a CPU to its table of PMU events. The CPU is identified by the
28  * cpuid field, which is an arch-specific identifier for the CPU.
29  * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile
30  * must match the get_cpustr() in tools/perf/arch/xxx/util/header.c)
31  *
32  * The  cpuid can contain any character other than the comma.
33  */
34 struct pmu_events_map {
35 	const char *cpuid;
36 	const char *version;
37 	const char *type;		/* core, uncore etc */
38 	struct pmu_event *table;
39 };
40 
41 /*
42  * Global table mapping each known CPU for the architecture to its
43  * table of PMU events.
44  */
45 extern struct pmu_events_map pmu_events_map[];
46 
47 #endif
48