Re: [PATCH 4/6] perf/tool: Parse non-cpu pmu capabilities

From: Robert Richter
Date: Tue Apr 26 2022 - 06:43:41 EST


On 25.04.22 10:13:21, Ravi Bangoria wrote:

> diff --git a/tools/perf/Documentation/perf.data-file-format.txt b/tools/perf/Documentation/perf.data-file-format.txt
> index f56d0e0fbff6..dea3acb36558 100644
> --- a/tools/perf/Documentation/perf.data-file-format.txt
> +++ b/tools/perf/Documentation/perf.data-file-format.txt
> @@ -435,6 +435,24 @@ struct {
> } [nr_pmu];
> };
>
> + HEADER_PMU_CAPS = 32,
> +
> + List of pmu capabilities (except cpu pmu which is already
> + covered by HEADER_CPU_PMU_CAPS)
> +
> +struct {
> + u32 nr_pmus;
> + struct {
> + u8 core_type; /* For hybrid topology */
> + char pmu_name[];
> + u16 nr_caps;
> + struct {
> + char name[];
> + char value[];
> + } [nr_caps];
> + } [nr_pmus];
> +};
> +

This looks quite a bit complex and special.

Why not just reusing struct nr_cpu_pmu_caps (id 28)? Rename it and
introduce macros for backwards compatability if needed.

pmu_name is already encoded in sysfs and core_type could be a caps
value?

-Robert