[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-599ee18f0740d7661b8711249096db94c09bc508@git.kernel.org>
Date: Fri, 21 Jun 2019 23:47:15 -0700
From: tip-bot for John Garry <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: alexander.shishkin@...ux.intel.com, john.garry@...wei.com,
ben@...adent.org.uk, will.deacon@....com, acme@...hat.com,
jolsa@...hat.com, brueckner@...ux.ibm.com,
mathieu.poirier@...aro.org, mark.rutland@....com,
tmricht@...ux.ibm.com, mingo@...nel.org,
zhangshaokun@...ilicon.com, tglx@...utronix.de, hpa@...or.com,
namhyung@...nel.org, linux-kernel@...r.kernel.org,
peterz@...radead.org, kan.liang@...ux.intel.com
Subject: [tip:perf/core] perf pmu: Fix uncore PMU alias list for ARM64
Commit-ID: 599ee18f0740d7661b8711249096db94c09bc508
Gitweb: https://git.kernel.org/tip/599ee18f0740d7661b8711249096db94c09bc508
Author: John Garry <john.garry@...wei.com>
AuthorDate: Fri, 14 Jun 2019 22:07:59 +0800
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 17 Jun 2019 15:57:19 -0300
perf pmu: Fix uncore PMU alias list for ARM64
In commit 292c34c10249 ("perf pmu: Fix core PMU alias list for X86
platform"), we fixed the issue of CPU events being aliased to uncore
events.
Fix this same issue for ARM64, since the said commit left the (broken)
behaviour untouched for ARM64.
Signed-off-by: John Garry <john.garry@...wei.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Ben Hutchings <ben@...adent.org.uk>
Cc: Hendrik Brueckner <brueckner@...ux.ibm.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Kan Liang <kan.liang@...ux.intel.com>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Shaokun Zhang <zhangshaokun@...ilicon.com>
Cc: Thomas Richter <tmricht@...ux.ibm.com>
Cc: Will Deacon <will.deacon@....com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linuxarm@...wei.com
Cc: stable@...r.kernel.org
Fixes: 292c34c10249 ("perf pmu: Fix core PMU alias list for X86 platform")
Link: http://lkml.kernel.org/r/1560521283-73314-2-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/pmu.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index e0429f4ef335..faa8eb231e1b 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -709,9 +709,7 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu)
{
int i;
struct pmu_events_map *map;
- struct pmu_event *pe;
const char *name = pmu->name;
- const char *pname;
map = perf_pmu__find_map(pmu);
if (!map)
@@ -722,28 +720,26 @@ static void pmu_add_cpu_aliases(struct list_head *head, struct perf_pmu *pmu)
*/
i = 0;
while (1) {
+ const char *cpu_name = is_arm_pmu_core(name) ? name : "cpu";
+ struct pmu_event *pe = &map->table[i++];
+ const char *pname = pe->pmu ? pe->pmu : cpu_name;
- pe = &map->table[i++];
if (!pe->name) {
if (pe->metric_group || pe->metric_name)
continue;
break;
}
- if (!is_arm_pmu_core(name)) {
- pname = pe->pmu ? pe->pmu : "cpu";
-
- /*
- * uncore alias may be from different PMU
- * with common prefix
- */
- if (pmu_is_uncore(name) &&
- !strncmp(pname, name, strlen(pname)))
- goto new_alias;
+ /*
+ * uncore alias may be from different PMU
+ * with common prefix
+ */
+ if (pmu_is_uncore(name) &&
+ !strncmp(pname, name, strlen(pname)))
+ goto new_alias;
- if (strcmp(pname, name))
- continue;
- }
+ if (strcmp(pname, name))
+ continue;
new_alias:
/* need type casts to override 'const' */
Powered by blists - more mailing lists