Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <irogers@google.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
9bb93278 dc7fb075

+1 -1
+1 -1
tools/perf/util/parse-events.c
··· 2247 2247 evlist__splice_list_tail(evlist, &parse_state.list); 2248 2248 2249 2249 if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus) { 2250 + evlist__uniquify_evsel_names(evlist, &stat_config); 2250 2251 pr_warning("WARNING: events were regrouped to match PMUs\n"); 2251 2252 2252 2253 if (verbose > 0) { 2253 2254 struct strbuf sb = STRBUF_INIT; 2254 2255 2255 - evlist__uniquify_evsel_names(evlist, &stat_config); 2256 2256 evlist__format_evsels(evlist, &sb, 2048); 2257 2257 pr_debug("evlist after sorting/fixing: '%s'\n", sb.buf); 2258 2258 strbuf_release(&sb);