[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1602152121-240367-10-git-send-email-john.garry@huawei.com>
Date: Thu, 8 Oct 2020 18:15:17 +0800
From: John Garry <john.garry@...wei.com>
To: <acme@...nel.org>, <will@...nel.org>, <mark.rutland@....com>,
<jolsa@...hat.com>, <irogers@...gle.com>, <leo.yan@...aro.org>,
<peterz@...radead.org>, <mingo@...hat.com>,
<alexander.shishkin@...ux.intel.com>, <namhyung@...nel.org>,
<mathieu.poirier@...aro.org>
CC: <linuxarm@...wei.com>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <qiangqing.zhang@....com>,
<zhangshaokun@...ilicon.com>, <james.clark@....com>,
<linux-imx@....com>, John Garry <john.garry@...wei.com>
Subject: [PATCH RFC v4 09/13] perf metricgroup: Hack a fix for aliases when covering multiple PMUs
Function find_evsel_group() seems broken for aliases covering multiple
PMUs, as dicussed at:
https://lore.kernel.org/lkml/CAP-5=fUy6FOszNRwJF6ZNpqQSSyrnLPV6GbkEcZMqAhUp3X0ZA@mail.gmail.com/
For now, hack a fix which I only know works for me.
Signed-off-by: John Garry <john.garry@...wei.com>
---
tools/perf/util/metricgroup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
index d948a7f910cf..82ba3638f48c 100644
--- a/tools/perf/util/metricgroup.c
+++ b/tools/perf/util/metricgroup.c
@@ -213,7 +213,7 @@ static struct evsel *find_evsel_group(struct evlist *perf_evlist,
/* Ignore event if already used and merging is disabled. */
if (metric_no_merge && test_bit(ev->idx, evlist_used))
continue;
- if (!has_constraint && ev->leader != current_leader) {
+ if (!has_constraint && (!current_leader || strcmp(current_leader->name, ev->leader->name))) {
/*
* Start of a new group, discard the whole match and
* start again.
@@ -279,7 +279,7 @@ static struct evsel *find_evsel_group(struct evlist *perf_evlist,
* when then group is left.
*/
if (!has_constraint &&
- ev->leader != metric_events[i]->leader)
+ strcmp(ev->leader->name, metric_events[i]->leader->name))
break;
if (!strcmp(metric_events[i]->name, ev->name)) {
set_bit(ev->idx, evlist_used);
--
2.26.2
Powered by blists - more mailing lists