]> git.baikalelectronics.ru Git - kernel.git/commit
perf header: Add die information in CPU topology
authorKan Liang <kan.liang@linux.intel.com>
Tue, 4 Jun 2019 22:50:41 +0000 (15:50 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 10 Jun 2019 18:50:02 +0000 (15:50 -0300)
commitc0226891352a69d44a6669392915ec5741f9fc9c
tree6a8d30c8e99d174d0594264b302b6c68cd9c1628
parent37a42eef3edb2ee521fe8c5502d542962159f9de
perf header: Add die information in CPU topology

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 has_die_topology() to check if die topology information is
supported by kernel. The function only check X86 and CPU 0. Assuming
other CPUs have same topology.

Use similar method for core and socket to support die id and sibling
dies string.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1559688644-106558-2-git-send-email-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf.data-file-format.txt
tools/perf/util/cputopo.c
tools/perf/util/cputopo.h
tools/perf/util/env.c
tools/perf/util/env.h
tools/perf/util/header.c