0001
0002 #ifndef PMU_EVENTS_H
0003 #define PMU_EVENTS_H
0004
0005 struct perf_pmu;
0006
0007 enum aggr_mode_class {
0008 PerChip = 1,
0009 PerCore
0010 };
0011
0012
0013
0014
0015 struct pmu_event {
0016 const char *name;
0017 const char *compat;
0018 const char *event;
0019 const char *desc;
0020 const char *topic;
0021 const char *long_desc;
0022 const char *pmu;
0023 const char *unit;
0024 const char *perpkg;
0025 const char *aggr_mode;
0026 const char *metric_expr;
0027 const char *metric_name;
0028 const char *metric_group;
0029 const char *deprecated;
0030 const char *metric_constraint;
0031 };
0032
0033 struct pmu_events_table;
0034
0035 typedef int (*pmu_event_iter_fn)(const struct pmu_event *pe,
0036 const struct pmu_events_table *table,
0037 void *data);
0038
0039 int pmu_events_table_for_each_event(const struct pmu_events_table *table, pmu_event_iter_fn fn,
0040 void *data);
0041
0042 const struct pmu_events_table *perf_pmu__find_table(struct perf_pmu *pmu);
0043 const struct pmu_events_table *find_core_events_table(const char *arch, const char *cpuid);
0044 int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data);
0045
0046 const struct pmu_events_table *find_sys_events_table(const char *name);
0047 int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data);
0048
0049 #endif