Commit e34c9402 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarNageswara R Sastry <nasastry@in.ibm.com>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarRavi 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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent fdf2460c
...@@ -2056,6 +2056,12 @@ static int setup_nodes(struct perf_session *session) ...@@ -2056,6 +2056,12 @@ static int setup_nodes(struct perf_session *session)
if (!set) if (!set)
return -ENOMEM; return -ENOMEM;
nodes[node] = set;
/* empty node, skip */
if (cpu_map__empty(map))
continue;
for (cpu = 0; cpu < map->nr; cpu++) { for (cpu = 0; cpu < map->nr; cpu++) {
set_bit(map->map[cpu], set); set_bit(map->map[cpu], set);
...@@ -2064,8 +2070,6 @@ static int setup_nodes(struct perf_session *session) ...@@ -2064,8 +2070,6 @@ static int setup_nodes(struct perf_session *session)
cpu2node[map->map[cpu]] = node; cpu2node[map->map[cpu]] = node;
} }
nodes[node] = set;
} }
setup_nodes_header(); setup_nodes_header();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment