Re: [PATCH 1/3] perf header: Add die information in CPU topology

From: Jiri Olsa
Date: Tue May 28 2019 - 05:03:35 EST


On Thu, May 23, 2019 at 01:41:19PM -0700, kan.liang@xxxxxxxxxxxxxxx wrote:
> From: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
>
> With the new CPUID.1F, a new level type of CPU topology, 'die', is
> introduced. The 'die' information in CPU topology should be added in
> perf header.
>
> To be compatible with old perf.data, the patch checks the section size
> before reading the die information. The new info is added at the end of
> the cpu_topology section, the old perf tool ignores the extra data.
> It never reads data crossing the section boundary.
>
> The new perf tool with the patch can be used on legacy kernel. Add a
> new function check_x86_die_exists() to check if die topology
> information is supported by kernel. The function only check X86 and
> CPU 0. Assuming other CPUs have same topology.

[jolsa@dell-r440-01 perf]$ sudo ./perf stat -e cycles --per-die -a -I 1000
# time die cpus counts unit events
1.000526089 S0-D0 20 6,828,029 cycles
1.000526089 S1-D0 20 2,609,924 cycles
2.002578005 S0-D0 20 5,280,361 cycles


the title is shifted from the values

jirka