diff options
-rw-r--r-- | tools/perf/bench/numa.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index cd872e9c3a9c..ba5efa4710b5 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c | |||
@@ -828,6 +828,9 @@ static int count_process_nodes(int process_nr) | |||
828 | td = g->threads + task_nr; | 828 | td = g->threads + task_nr; |
829 | 829 | ||
830 | node = numa_node_of_cpu(td->curr_cpu); | 830 | node = numa_node_of_cpu(td->curr_cpu); |
831 | if (node < 0) /* curr_cpu was likely still -1 */ | ||
832 | return 0; | ||
833 | |||
831 | node_present[node] = 1; | 834 | node_present[node] = 1; |
832 | } | 835 | } |
833 | 836 | ||
@@ -882,6 +885,11 @@ static void calc_convergence_compression(int *strong) | |||
882 | for (p = 0; p < g->p.nr_proc; p++) { | 885 | for (p = 0; p < g->p.nr_proc; p++) { |
883 | unsigned int nodes = count_process_nodes(p); | 886 | unsigned int nodes = count_process_nodes(p); |
884 | 887 | ||
888 | if (!nodes) { | ||
889 | *strong = 0; | ||
890 | return; | ||
891 | } | ||
892 | |||
885 | nodes_min = min(nodes, nodes_min); | 893 | nodes_min = min(nodes, nodes_min); |
886 | nodes_max = max(nodes, nodes_max); | 894 | nodes_max = max(nodes, nodes_max); |
887 | } | 895 | } |