Re: [PATCH 2/3] perf list: Collapse similar events across PMUs
From: Leo Yan
Date: Wed Mar 05 2025 - 04:36:16 EST
On Tue, Mar 04, 2025 at 01:49:14PM +0000, James Clark wrote:
> Instead of showing multiple line items with the same event name and
> description, show a single line and concatenate all PMUs that this
> event can belong to.
>
> Don't do it for json output. Machine readable output doesn't need to be
> minimized, and changing the "Unit" field to a list type would break
> backwards compatibility.
>
> Before:
> $ perf list -v
> ...
> br_indirect_spec
> [Branch speculatively executed,indirect branch. Unit: armv8_cortex_a53]
> br_indirect_spec
> [Branch speculatively executed,indirect branch. Unit: armv8_cortex_a57]
>
> After:
>
> $ perf list -v
> ...
> br_indirect_spec
> [Branch speculatively executed,indirect branch. Unit: armv8_cortex_a53,armv8_cortex_a57]
>From my testing, based on the latest tmp.perf-tools-next branch, I
need to remove the option '-v'. Otherwise, the '-v' option will
enable long event descriptions, in this case, it does _not_ print Unit
strings at all (see default_print_event() in builtin-list.c).
default_print_event()
{
...
if (long_desc && print_state->long_desc) {
fprintf(fp, "%*s", 8, "[");
wordwrap(fp, long_desc, 8, pager_get_columns(), 0);
fprintf(fp, "]\n");
} else if (desc && print_state->desc) {
...
}
The command `perf list` would be sufficent.
Thanks,
Leo