Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 2 | #ifndef PMU_EVENTS_H |
| 3 | #define PMU_EVENTS_H |
| 4 | |
| 5 | /* |
| 6 | * Describe each PMU event. Each CPU has a table of PMU events. |
| 7 | */ |
| 8 | struct pmu_event { |
| 9 | const char *name; |
| 10 | const char *event; |
| 11 | const char *desc; |
| 12 | const char *topic; |
Sukadev Bhattiprolu | 794ba54 | 2016-09-15 15:24:47 -0700 | [diff] [blame] | 13 | const char *long_desc; |
Andi Kleen | fedb2b5 | 2017-01-27 18:03:37 -0800 | [diff] [blame] | 14 | const char *pmu; |
| 15 | const char *unit; |
| 16 | const char *perpkg; |
Andi Kleen | 00636c3 | 2017-03-20 13:17:07 -0700 | [diff] [blame] | 17 | const char *metric_expr; |
Andi Kleen | 9628481 | 2017-03-20 13:17:10 -0700 | [diff] [blame] | 18 | const char *metric_name; |
Andi Kleen | 80eeb67 | 2016-09-19 17:39:33 -0300 | [diff] [blame] | 19 | }; |
| 20 | |
| 21 | /* |
| 22 | * |
| 23 | * Map a CPU to its table of PMU events. The CPU is identified by the |
| 24 | * cpuid field, which is an arch-specific identifier for the CPU. |
| 25 | * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile |
| 26 | * must match the get_cpustr() in tools/perf/arch/xxx/util/header.c) |
| 27 | * |
| 28 | * The cpuid can contain any character other than the comma. |
| 29 | */ |
| 30 | struct pmu_events_map { |
| 31 | const char *cpuid; |
| 32 | const char *version; |
| 33 | const char *type; /* core, uncore etc */ |
| 34 | struct pmu_event *table; |
| 35 | }; |
| 36 | |
| 37 | /* |
| 38 | * Global table mapping each known CPU for the architecture to its |
| 39 | * table of PMU events. |
| 40 | */ |
| 41 | extern struct pmu_events_map pmu_events_map[]; |
| 42 | |
| 43 | #endif |