]>
Commit | Line | Data |
---|---|---|
04fd09d4 SL |
1 | From a6fbaf3b3a8089ef20c449314a1adba1a25412ef Mon Sep 17 00:00:00 2001 |
2 | From: Jiri Olsa <jolsa@redhat.com> | |
3 | Date: Tue, 5 Mar 2019 16:25:29 +0100 | |
4 | Subject: perf c2c: Fix c2c report for empty numa node | |
5 | ||
6 | [ Upstream commit e34c940245437f36d2c492edd1f8237eff391064 ] | |
7 | ||
8 | Ravi Bangoria reported that we fail with an empty NUMA node with the | |
9 | following message: | |
10 | ||
11 | $ lscpu | |
12 | NUMA node0 CPU(s): | |
13 | NUMA node1 CPU(s): 0-4 | |
14 | ||
15 | $ sudo ./perf c2c report | |
16 | node/cpu topology bugFailed setup nodes | |
17 | ||
18 | Fix this by detecting the empty node and keeping its CPU set empty. | |
19 | ||
20 | Reported-by: Nageswara R Sastry <nasastry@in.ibm.com> | |
21 | Signed-off-by: Jiri Olsa <jolsa@kernel.org> | |
22 | Tested-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> | |
23 | Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> | |
24 | Cc: Andi Kleen <ak@linux.intel.com> | |
25 | Cc: Jonas Rabenstein <jonas.rabenstein@studium.uni-erlangen.de> | |
26 | Cc: Namhyung Kim <namhyung@kernel.org> | |
27 | Cc: Peter Zijlstra <peterz@infradead.org> | |
28 | Link: http://lkml.kernel.org/r/20190305152536.21035-2-jolsa@kernel.org | |
29 | Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> | |
30 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
31 | --- | |
32 | tools/perf/builtin-c2c.c | 8 ++++++-- | |
33 | 1 file changed, 6 insertions(+), 2 deletions(-) | |
34 | ||
35 | diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c | |
36 | index fb76423022e8..32e64a8a6443 100644 | |
37 | --- a/tools/perf/builtin-c2c.c | |
38 | +++ b/tools/perf/builtin-c2c.c | |
39 | @@ -1935,6 +1935,12 @@ static int setup_nodes(struct perf_session *session) | |
40 | if (!set) | |
41 | return -ENOMEM; | |
42 | ||
43 | + nodes[node] = set; | |
44 | + | |
45 | + /* empty node, skip */ | |
46 | + if (cpu_map__empty(map)) | |
47 | + continue; | |
48 | + | |
49 | for (cpu = 0; cpu < map->nr; cpu++) { | |
50 | set_bit(map->map[cpu], set); | |
51 | ||
52 | @@ -1943,8 +1949,6 @@ static int setup_nodes(struct perf_session *session) | |
53 | ||
54 | cpu2node[map->map[cpu]] = node; | |
55 | } | |
56 | - | |
57 | - nodes[node] = set; | |
58 | } | |
59 | ||
60 | setup_nodes_header(); | |
61 | -- | |
62 | 2.19.1 | |
63 |