1959826caSMatt Macy /* 2959826caSMatt Macy */ 3959826caSMatt Macy 4959826caSMatt Macy #ifndef PMU_EVENTS_H 5959826caSMatt Macy #define PMU_EVENTS_H 6959826caSMatt Macy 7*62ff619dSAlexander Motin enum aggr_mode_class { 8*62ff619dSAlexander Motin PerChip = 1, 9*62ff619dSAlexander Motin PerCore 10*62ff619dSAlexander Motin }; 11*62ff619dSAlexander Motin 12959826caSMatt Macy /* 13959826caSMatt Macy * Describe each PMU event. Each CPU has a table of PMU events. 14959826caSMatt Macy */ 15959826caSMatt Macy struct pmu_event { 16959826caSMatt Macy const char *name; 17*62ff619dSAlexander Motin const char *compat; 18959826caSMatt Macy const char *event; 19959826caSMatt Macy const char *desc; 20959826caSMatt Macy const char *topic; 21959826caSMatt Macy const char *long_desc; 22959826caSMatt Macy const char *pmu; 23959826caSMatt Macy const char *unit; 24959826caSMatt Macy const char *perpkg; 25*62ff619dSAlexander Motin const char *aggr_mode; 26959826caSMatt Macy const char *metric_expr; 27959826caSMatt Macy const char *metric_name; 28959826caSMatt Macy const char *metric_group; 29*62ff619dSAlexander Motin const char *deprecated; 30*62ff619dSAlexander Motin const char *metric_constraint; 31959826caSMatt Macy }; 32959826caSMatt Macy 33959826caSMatt Macy /* 34959826caSMatt Macy * 35959826caSMatt Macy * Map a CPU to its table of PMU events. The CPU is identified by the 36959826caSMatt Macy * cpuid field, which is an arch-specific identifier for the CPU. 37959826caSMatt Macy * The identifier specified in tools/perf/pmu-events/arch/xxx/mapfile 38*62ff619dSAlexander Motin * must match the get_cpuid_str() in tools/perf/arch/xxx/util/header.c) 39959826caSMatt Macy * 40959826caSMatt Macy * The cpuid can contain any character other than the comma. 41959826caSMatt Macy */ 42959826caSMatt Macy struct pmu_events_map { 43959826caSMatt Macy const char *cpuid; 44959826caSMatt Macy const char *version; 45959826caSMatt Macy const char *type; /* core, uncore etc */ 46*62ff619dSAlexander Motin const struct pmu_event *table; 47*62ff619dSAlexander Motin }; 48*62ff619dSAlexander Motin 49*62ff619dSAlexander Motin struct pmu_sys_events { 50*62ff619dSAlexander Motin const char *name; 51*62ff619dSAlexander Motin const struct pmu_event *table; 52959826caSMatt Macy }; 53959826caSMatt Macy 54959826caSMatt Macy /* 55959826caSMatt Macy * Global table mapping each known CPU for the architecture to its 56959826caSMatt Macy * table of PMU events. 57959826caSMatt Macy */ 58*62ff619dSAlexander Motin extern const struct pmu_events_map pmu_events_map[]; 59*62ff619dSAlexander Motin extern const struct pmu_sys_events pmu_sys_event_tables[]; 60959826caSMatt Macy 61959826caSMatt Macy #endif 62