[PATCH v1 0/3] Cleanup and fix tools/mm/slabinfo utility

From: wangxuewen

Date: Fri May 15 2026 - 02:57:29 EST


This series fixes one bug and cleans up two code quality issues in tools/mm/slabinfo:

1. Fix trace disable logic inversion: when the user intends to disable
tracing (!tracing) and it is currently enabled (s->trace),
set_obj() was called with 1 instead of 0, which is opposite to
the intended behavior. All other options (sanity_checks, red_zone,
poison, store_user) in the same function use 0 for the disable
case.

2. Remove dead assignment in get_obj_and_str(): `x = NULL` sets the
local parameter variable instead of `*x`, which is a no-op since
`*x` was already set to NULL on the line above.

3. Remove redundant slab->partial assignment in read_slab_dir():
slab->partial is assigned by get_obj("partial") and then
immediately overwritten by get_obj_and_str("partial", &t).

wangxuewen (3):
tools/mm/slabinfo: Fix trace disable logic inversion
tools/mm/slabinfo: remove dead assignment in get_obj_and_str()
tools/mm/slabinfo: remove redundant slab->partial assignment

tools/mm/slabinfo.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

--
2.25.1