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