summaryrefslogtreecommitdiff
path: root/tools/perf/util/pmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/pmu.c')
-rw-r--r--tools/perf/util/pmu.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index d8717c4548a4..7874d67485ac 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -710,9 +710,9 @@ static char *perf_pmu__getcpuid(struct perf_pmu *pmu)
return cpuid;
}
-const struct pmu_events_map *perf_pmu__find_map(struct perf_pmu *pmu)
+const struct pmu_event *perf_pmu__find_table(struct perf_pmu *pmu)
{
- const struct pmu_events_map *map;
+ const struct pmu_event *table = NULL;
char *cpuid = perf_pmu__getcpuid(pmu);
int i;
@@ -724,22 +724,23 @@ const struct pmu_events_map *perf_pmu__find_map(struct perf_pmu *pmu)
i = 0;
for (;;) {
- map = &pmu_events_map[i++];
- if (!map->table) {
- map = NULL;
+ const struct pmu_events_map *map = &pmu_events_map[i++];
+
+ if (!map->table)
break;
- }
- if (!strcmp_cpuid_str(map->cpuid, cpuid))
+ if (!strcmp_cpuid_str(map->cpuid, cpuid)) {
+ table = map->table;
break;
+ }
}
free(cpuid);
- return map;
+ return table;
}
-const struct pmu_events_map *__weak pmu_events_map__find(void)
+__weak const struct pmu_event *pmu_events_table__find(void)
{
- return perf_pmu__find_map(NULL);
+ return perf_pmu__find_table(NULL);
}
/*
@@ -823,8 +824,8 @@ out:
* to the current running CPU. Then, add all PMU events from that table
* as aliases.
*/
-void pmu_add_cpu_aliases_map(struct list_head *head, struct perf_pmu *pmu,
- const struct pmu_events_map *map)
+void pmu_add_cpu_aliases_table(struct list_head *head, struct perf_pmu *pmu,
+ const struct pmu_event *table)
{
int i;
const char *name = pmu->name;
@@ -834,7 +835,7 @@ void pmu_add_cpu_aliases_map(struct list_head *head, struct perf_pmu *pmu,
i = 0;
while (1) {
const char *cpu_name = is_arm_pmu_core(name) ? name : "cpu";
- const struct pmu_event *pe = &map->table[i++];
+ const struct pmu_event *pe = &table[i++];
const char *pname = pe->pmu ? pe->pmu : cpu_name;
if (!pe->name) {
@@ -859,13 +860,13 @@ new_alias:
static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu)
{
- const struct pmu_events_map *map;
+ const struct pmu_event *table;
- map = perf_pmu__find_map(pmu);
- if (!map)
+ table = perf_pmu__find_table(pmu);
+ if (!table)
return;
- pmu_add_cpu_aliases_map(head, pmu, map);
+ pmu_add_cpu_aliases_table(head, pmu, table);
}
struct pmu_sys_event_iter_data {