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