slabtop: let's stop always ignoring the last slab node

This patch will fix a fencepost error that has existed
since at least 2004, the result of which was to always
completely ignore that last merged / sorted slab node.

[ Of course, little harm was done since output would ]
[ have been limited to a terminal's height. Thus, it ]
[ would have required a huge display before noticed. ]

[ But, now that the run once switch shows everything ]
[ such an omission would become really unforgivable. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2017-11-30 00:00:00 -06:00 committed by Craig Small
parent 0ef497bb35
commit 1013f2719d

View File

@ -410,7 +410,7 @@ int main(int argc, char *argv[])
attroff(A_REVERSE);
curr = slab_list;
for (i = 0; i < rows - 8 && curr->next; i++) {
for (i = 0; i < rows - 8 && curr; i++) {
print_line("%6u %6u %3u%% %7.2fK %6u %8u %9uK %-23s\n",
curr->nr_objs, curr->nr_active_objs, curr->use,
curr->obj_size / 1024.0, curr->nr_slabs,