top: swat nasty obscure bug associated with numa nodes

When experimenting with two macro constants for stat.c
(#define STACKS_INCR & #define NEWOLD_INCR), a bug was
revealed in top, only surfacing if both were set to 1.

At those settings an absolute minimum number of stacks
would be allocated for CPUs & numa NODEs. This in turn
led top to overrun the lessor number of nodes since he
used the cpu index when accessing those numa stack(s).

What he should have been accessing was the cpu stacks.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2016-06-14 00:00:00 -05:00 committed by Craig Small
parent 92c72166db
commit 61647f1b95

View File

@ -4714,7 +4714,7 @@ numa_oops:
if (Numa_node_sel == CPU_VAL(stat_NU, s_int, i)) {
if (!isROOM(anyFLG, 1)) break;
snprintf(tmp, sizeof(tmp), N_fmt(WORD_eachcpu_fmt), CPU_VAL(stat_ID, s_int, i));
summary_hlp(Stat_reap->nodes->stacks[i], tmp);
summary_hlp(Stat_reap->cpus->stacks[i], tmp);
Msg_row += 1;
}
}