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 parse-events: Add debug dump of evlist if reordered

Add debug verbose output to show how evsels were reordered by
parse_events__sort_events_and_fix_groups(). For example:

```
$ perf record -v -e '{instructions,cycles}' true
Using CPUID GenuineIntel-6-B7-1
WARNING: events were regrouped to match PMUs
evlist after sorting/fixing: '{cpu_atom/instructions/,cpu_atom/cycles/},{cpu_core/instructions/,cpu_core/cycles/}'
```

Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dominique Martinet <asmadeus@codewreck.org>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Levi Yun <yeoreum.yun@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Weilin Wang <weilin.wang@intel.com>
Link: https://lore.kernel.org/r/20250402201549.4090305-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
70e21ac8 583dc500

+13 -3
+13 -3
tools/perf/util/parse-events.c
··· 28 28 #include "util/evsel_config.h" 29 29 #include "util/event.h" 30 30 #include "util/bpf-filter.h" 31 + #include "util/stat.h" 31 32 #include "util/util.h" 32 33 #include "tracepoint.h" 33 34 ··· 2201 2200 if (ret2 < 0) 2202 2201 return ret; 2203 2202 2204 - if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus) 2205 - pr_warning("WARNING: events were regrouped to match PMUs\n"); 2206 - 2207 2203 /* 2208 2204 * Add list to the evlist even with errors to allow callers to clean up. 2209 2205 */ 2210 2206 evlist__splice_list_tail(evlist, &parse_state.list); 2211 2207 2208 + if (ret2 && warn_if_reordered && !parse_state.wild_card_pmus) { 2209 + pr_warning("WARNING: events were regrouped to match PMUs\n"); 2210 + 2211 + if (verbose > 0) { 2212 + struct strbuf sb = STRBUF_INIT; 2213 + 2214 + evlist__uniquify_name(evlist); 2215 + evlist__format_evsels(evlist, &sb, 2048); 2216 + pr_debug("evlist after sorting/fixing: '%s'\n", sb.buf); 2217 + strbuf_release(&sb); 2218 + } 2219 + } 2212 2220 if (!ret) { 2213 2221 struct evsel *last; 2214 2222