perf pmu: Check .is_uncore field in pmu_add_cpu_aliases_map()
authorJohn Garry <john.garry@huawei.com>
Thu, 29 Jul 2021 13:56:21 +0000 (21:56 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 10 Aug 2021 17:44:00 +0000 (14:44 -0300)
Calling pmu_is_uncore() for fake PMUs does not work, as it checks sysfs
for the PMU details (which won't exist).

Check .is_uncore field instead, which makes sense anyway.

Signed-off-by: John Garry <john.garry@huawei.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linuxarm@huawei.com
Link: https //lore.kernel.org/r/1627566986-30605-7-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/pmu.c

index fc683bc..b1fc820 100644 (file)
@@ -843,8 +843,7 @@ void pmu_add_cpu_aliases_map(struct list_head *head, struct perf_pmu *pmu,
                        break;
                }
 
-               if (pmu_is_uncore(name) &&
-                   pmu_uncore_alias_match(pname, name))
+               if (pmu->is_uncore && pmu_uncore_alias_match(pname, name))
                        goto new_alias;
 
                if (strcmp(pname, name))