summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2019-06-24 12:37:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-26 09:10:42 +0200
commitb610b5f080128142b36cda853f2add987da3faec (patch)
treea9a704bc36673574b47a9713aabfa90272fb6588 /tools
parent97ceeb9d1a5747eb236b0972515b489771b0d828 (diff)
downloadlinux-stable-b610b5f080128142b36cda853f2add987da3faec.tar.gz
linux-stable-b610b5f080128142b36cda853f2add987da3faec.tar.bz2
linux-stable-b610b5f080128142b36cda853f2add987da3faec.zip
perf stat: Don't merge events in the same PMU
[ Upstream commit 6c5f4e5cb35b4694dc035d91092d23f596ecd06a ] Event merging is mainly to collapse similar events in lots of different duplicated PMUs. It can break metric displaying. It's possible for two metrics to have the same event, and when the two events happen in a row the second wouldn't be displayed. This would also not show the second metric. To avoid this don't merge events in the same PMU. This makes sense, if we have multiple events in the same PMU there is likely some reason for it (e.g. using multiple groups) and we better not merge them. While in theory it would be possible to construct metrics that have events with the same name in different PMU no current metrics have this problem. This is the fix for perf stat -M UPI,IPC (needs also another bug fix to completely work) Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Fixes: 430daf2dc7af ("perf stat: Collapse identically named events") Link: http://lkml.kernel.org/r/20190624193711.35241-3-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/stat-display.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 4c53bae5644b..94bed4031def 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -542,7 +542,8 @@ static void collect_all_aliases(struct perf_stat_config *config, struct perf_evs
alias->scale != counter->scale ||
alias->cgrp != counter->cgrp ||
strcmp(alias->unit, counter->unit) ||
- perf_evsel__is_clock(alias) != perf_evsel__is_clock(counter))
+ perf_evsel__is_clock(alias) != perf_evsel__is_clock(counter) ||
+ !strcmp(alias->pmu_name, counter->pmu_name))
break;
alias->merged_stat = true;
cb(config, alias, data, false);