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 evlist: Make groups visible in evlist__format_evsels() output

Make groups visible in output:

Before:

{cycles,instructions} ->
cpu_atom/cycles/,cpu_atom/instructions/,cpu_core/cycles/,cpu_core/instructions/

After:

{cycles,instructions} ->
{cpu_atom/cycles/,cpu_atom/instructions/},{cpu_core/cycles/,cpu_core/instructions/}

Committer testing:

Before:

root@number:~# perf record -e '{cycles,instructions,cache-misses}' /tmp/bla
Failed to collect 'cycles,instructions,cache-misses' for the '/tmp/bla' workload: Permission denied
root@number:~#

After:

root@number:~# perf record -e '{cycles,instructions,cache-misses}' /tmp/bla
Failed to collect '{cycles,instructions,cache-misses}' for the '/tmp/bla' workload: Permission denied
root@number:~#

Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.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-5-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
583dc500 f0f245ea

+12 -1
+12 -1
tools/perf/util/evlist.c
··· 2470 2470 2471 2471 void evlist__format_evsels(struct evlist *evlist, struct strbuf *sb, size_t max_length) 2472 2472 { 2473 - struct evsel *evsel; 2473 + struct evsel *evsel, *leader = NULL; 2474 2474 bool first = true; 2475 2475 2476 2476 evlist__for_each_entry(evlist, evsel) { 2477 + struct evsel *new_leader = evsel__leader(evsel); 2478 + 2477 2479 if (evsel__is_dummy_event(evsel)) 2478 2480 continue; 2481 + 2482 + if (leader != new_leader && leader && leader->core.nr_members > 1) 2483 + strbuf_addch(sb, '}'); 2479 2484 2480 2485 if (!first) 2481 2486 strbuf_addch(sb, ','); ··· 2489 2484 strbuf_addstr(sb, "..."); 2490 2485 return; 2491 2486 } 2487 + if (leader != new_leader && new_leader->core.nr_members > 1) 2488 + strbuf_addch(sb, '{'); 2489 + 2492 2490 strbuf_addstr(sb, evsel__name(evsel)); 2493 2491 first = false; 2492 + leader = new_leader; 2494 2493 } 2494 + if (leader && leader->core.nr_members > 1) 2495 + strbuf_addch(sb, '}'); 2495 2496 } 2496 2497 2497 2498 void evlist__check_mem_load_aux(struct evlist *evlist)