Re: [PATCH v3 0/6] Extra verbose/perf-list details

From: Ian Rogers
Date: Tue Mar 19 2024 - 21:02:02 EST


On Fri, Mar 8, 2024 at 8:34 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> On Fri, Mar 8, 2024 at 7:39 AM Liang, Kan <kan.liang@xxxxxxxxxxxxxxx> wrote:
>>
>>
>>
>> On 2024-03-07 7:19 p.m., Ian Rogers wrote:
>> > Add more encoding detail and raw event details in perf list. Add PMU
>> > name and reverse lookup from config to event name to
>> > perf_event_attr_fprintf. This makes the verbose output easier to read,
>> > and the perf list information more specific.
>> >
>> > v3. Fix to reverse lookup to ensure or aliases are loaded and if
>> > getting the config value fails for an event/alias just continue to
>> > the next one.
>> > v2. Address feedback from Kan Liang, "Raw hardware event descriptor"
>> > becomes "Raw event descriptor" add assert to keep term numbers in
>> > sync, fix a commit message.
>> >
>> > Ian Rogers (6):
>> > perf list: Add tracepoint encoding to detailed output
>> > perf pmu: Drop "default_core" from alias names
>> > perf list: Allow wordwrap to wrap on commas
>> > perf list: Give more details about raw event encodings
>> > perf tools: Use pmus to describe type from attribute
>> > perf tools: Add/use PMU reverse lookup from config to name
>>
>> The patch series look good to me.
>> I verified it on a hybrid machine. The new format is the same as the
>> advertise.
>>
>> Tested-by: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>

Ping.

Thanks,
Ian

>
> Thanks Kan! Just to add another feature of perf_event_attr_fprintf changes is that it shows up in perf trace output:
>
> ```
> $ perf trace -e perf_event_open perf stat -e data_read true
> 0.000 ( 0.011 ms): :36857/36857 perf_event_open(attr_uptr: { type: 24 (uncore_imc_free_running_0), size: 136, config: 0x20ff (unc_mc0_rdcas_count_freerun), sample_type: IDENTIFIER, read_format: TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING, disabled: 1, inherit: 1, exclude_guest: 1 }, pid: -1, group_fd: -1, flags: FD_CLOEXEC) = -1 EINVAL (Invalid argument)
> 0.014 ( 0.002 ms): :36857/36857 perf_event_open(attr_uptr: { type: 24 (uncore_imc_free_running_0), size: 136, config: 0x20ff (unc_mc0_rdcas_count_freerun), sample_type: IDENTIFIER, read_format: TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING, disabled: 1, inherit: 1, exclude_guest: 1 }, pid: -1, group_fd: -1) = -1 EINVAL (Invalid argument)
> 0.020 ( 0.008 ms): :36857/36857 perf_event_open(attr_uptr: { type: 24 (uncore_imc_free_running_0), size: 136, config: 0x20ff (unc_mc0_rdcas_count_freerun), sample_type: IDENTIFIER, read_format: TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING, disabled: 1, inherit: 1 }, pid: -1, group_fd: -1) = 8
> 0.031 ( 0.006 ms): :36857/36857 perf_event_open(attr_uptr: { type: 25 (uncore_imc_free_running_1), size: 136, config: 0x20ff (unc_mc1_rdcas_count_freerun), sample_type: IDENTIFIER, read_format: TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING, disabled: 1, inherit: 1, exclude_guest: 1 }, pid: -1, group_fd: -1) = -1 EINVAL (Invalid argument)
> 0.044 ( 0.004 ms): :36857/36857 perf_event_open(attr_uptr: { type: 25 (uncore_imc_free_running_1), size: 136, config: 0x20ff (unc_mc1_rdcas_count_freerun), sample_type: IDENTIFIER, read_format: TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING, disabled: 1, inherit: 1 }, pid: -1, group_fd: -1) = 9
>
> Performance counter stats for 'system wide':
>
> 5.07 MiB data_read
>
> 0.001178187 seconds time elapsed
> ```
>
> Thanks,
> Ian
>
>>
>> Thanks,
>> Kan
>> >
>> > tools/perf/builtin-list.c | 21 ++++-
>> > tools/perf/util/perf_event_attr_fprintf.c | 26 +++++--
>> > tools/perf/util/pmu.c | 82 +++++++++++++++++++-
>> > tools/perf/util/pmu.h | 4 +
>> > tools/perf/util/pmus.c | 94 +++++++++++++++++++++++
>> > tools/perf/util/pmus.h | 1 +
>> > tools/perf/util/print-events.c | 55 +++++++------
>> > 7 files changed, 242 insertions(+), 41 deletions(-)
>> >