]> granicus.if.org Git - procps-ng/commit
slabtop: correct the sort behavior for that NAME field
authorJim Warner <james.warner@comcast.net>
Thu, 9 Jun 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sat, 11 Jun 2016 01:50:37 +0000 (11:50 +1000)
commite80b48ce58af147824013ea426a4110f1093568d
treec8e3dcf258d2a51c9d09392529fa126253872153
parentb09014a7b629f9ac810321af4bce82b89ab95dff
slabtop: correct the sort behavior for that NAME field

When our <SLABINFO> was recently re-designed, the sort
callback functions became table driven, whereas before
a single callback used switch/case constructs based on
an 'item'. Thus, sorting was made a tad more efficient
but, it introduced a buglet into that slabtop program.

The root cause of this bug was the fact that the field
NAME required a low-to-high sort and all other slabtop
fields used high-to-low. Fortunately, along with those
<SLABINFO> table driven sort changes, that i/f offered
users the option of either low-to-high or high-to-low.

So this patch just exploits that choice. And, it means
that such responsibilities are now properly located in
calling code, not in what's a general purpose library.

Reference(s):
. most recent lib sort enhancement & breakage
commit 5d5a52a3804f912f7be8c15f18bf87fe45bbcd99

Signed-off-by: Jim Warner <james.warner@comcast.net>
slabtop.c