Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf c2c: Fix c2c report for empty numa node

Ravi Bangoria reported that we fail with an empty NUMA node with the
following message:

$ lscpu
NUMA node0 CPU(s):
NUMA node1 CPU(s): 0-4

$ sudo ./perf c2c report
node/cpu topology bugFailed setup nodes

Fix this by detecting the empty node and keeping its CPU set empty.

Reported-by: Nageswara R Sastry <nasastry@in.ibm.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190305152536.21035-2-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
e34c9402 fdf2460c

+6 -2
+6 -2
tools/perf/builtin-c2c.c
··· 2056 2056 if (!set) 2057 2057 return -ENOMEM; 2058 2058 2059 + nodes[node] = set; 2060 + 2061 + /* empty node, skip */ 2062 + if (cpu_map__empty(map)) 2063 + continue; 2064 + 2059 2065 for (cpu = 0; cpu < map->nr; cpu++) { 2060 2066 set_bit(map->map[cpu], set); 2061 2067 ··· 2070 2064 2071 2065 cpu2node[map->map[cpu]] = node; 2072 2066 } 2073 - 2074 - nodes[node] = set; 2075 2067 } 2076 2068 2077 2069 setup_nodes_header();