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