aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/stat-display.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/stat-display.c')
-rw-r--r--tools/perf/util/stat-display.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 138e3ab9d638..46b3dd134656 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -539,7 +539,8 @@ static void aggr_update_shadow(struct perf_stat_config *config,
}
}
-static void uniquify_event_name(struct evsel *counter)
+static void uniquify_event_name(struct evsel *counter,
+ struct perf_stat_config *stat_config)
{
char *new_name;
char *config;
@@ -558,7 +559,8 @@ static void uniquify_event_name(struct evsel *counter)
counter->name = new_name;
}
} else {
- if (perf_pmu__has_hybrid()) {
+ if (perf_pmu__has_hybrid() &&
+ stat_config->metric_events.nr_entries == 0) {
ret = asprintf(&new_name, "%s/%s/",
counter->pmu_name, counter->name);
} else {
@@ -619,7 +621,7 @@ static bool collect_data(struct perf_stat_config *config, struct evsel *counter,
return false;
cb(config, counter, data, true);
if (config->no_merge || hybrid_uniquify(counter))
- uniquify_event_name(counter);
+ uniquify_event_name(counter, config);
else if (counter->auto_merge_stats)
collect_all_aliases(config, counter, cb, data);
return true;