Skip to content

Commit 9bb9327

Browse files
james-c-linaroacmel
authored andcommitted
perf tools: Always uniquify event names
evlist__uniquify_evsel_names() only gets called in __parse_events() if verbose is > 0. This means that the auto added "slots" events stay as "slots" rather than being expanded to "cpu_core/slots/" unless Perf is run in verbose mode. This is invisible to users when running Perf stat because evlist__print_counters() always calls it regardless of verbose mode before displaying. The only thing this seems to affect is the test "Parsing of all PMU events from sysfs" which fails when not run in verbose mode. test__checkevent_pmu_events() always expects event names to be prefixed with the pmu name, but this only happens for "slots" events after evlist__uniquify_evsel_names() is called. One fix could be to relax the test to accept the non prefixed name in normal mode. But seeing as Perf stat uniquifies unconditionally, make parse_events() do the same. This fixes the following test failure: $ perf test "Parsing of all PMU events from sysfs" 5.2: Parsing of all PMU events from sysfs : FAILED! $ Reviewed-by: Ian Rogers <[email protected]> Signed-off-by: James Clark <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent dc7fb07 commit 9bb9327

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/perf/util/parse-events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2247,12 +2247,12 @@ int __parse_events(struct evlist *evlist, const char *str, const char *pmu_filte
22472247
evlist__splice_list_tail(evlist, &parse_state.list);
22482248

22492249
if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus) {
2250+
evlist__uniquify_evsel_names(evlist, &stat_config);
22502251
pr_warning("WARNING: events were regrouped to match PMUs\n");
22512252

22522253
if (verbose > 0) {
22532254
struct strbuf sb = STRBUF_INIT;
22542255

2255-
evlist__uniquify_evsel_names(evlist, &stat_config);
22562256
evlist__format_evsels(evlist, &sb, 2048);
22572257
pr_debug("evlist after sorting/fixing: '%s'\n", sb.buf);
22582258
strbuf_release(&sb);

0 commit comments

Comments
 (0)