pmu-events.h 1.0 KB

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