Re: [PATCH 2/2] scripts/gdb: slab: Update field names of struct kmem_cache

From: Vlastimil Babka (SUSE)

Date: Tue Apr 28 2026 - 04:21:48 EST


On 4/27/26 16:24, Illia Ostapyshyn wrote:
> The commit 5ba6bc27b1f9 ("slab: decouple pointer to barn from
> kmem_cache_node") reorganized the struct kmem_cache to factor out the
> per-node fields to the new struct kmem_cache_per_node_ptrs. This causes
> the gdb scripts for lx-slabinfo and lx-slabtrace fail as they still
> reference the old structure.
>
> Adjust the gdb scripts to match the current state of struct kmem_cache.
>
> Fixes: 5ba6bc27b1f9 ("slab: decouple pointer to barn from kmem_cache_node")
> Signed-off-by: Illia Ostapyshyn <illia@xxxxxxxxx>

Acked-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>

Thanks!

> ---
> scripts/gdb/linux/slab.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/gdb/linux/slab.py b/scripts/gdb/linux/slab.py
> index 0e2d93867fe2..ddde25aeca8d 100644
> --- a/scripts/gdb/linux/slab.py
> +++ b/scripts/gdb/linux/slab.py
> @@ -196,7 +196,7 @@ def slabtrace(alloc, cache_name):
>
> if target_cache['flags'] & SLAB_STORE_USER:
> for i in range(0, nr_node_ids):
> - cache_node = target_cache['node'][i]
> + cache_node = target_cache['per_node']['node'][i]
> if cache_node['nr_slabs']['counter'] == 0:
> continue
> process_slab(loc_track, cache_node['partial'], alloc, target_cache)
> @@ -300,7 +300,7 @@ def slabinfo():
> nr_free = 0
> nr_slabs = 0
> for i in range(0, nr_node_ids):
> - cache_node = cache['node'][i]
> + cache_node = cache['per_node']['node'][i]
> try:
> nr_slabs += cache_node['nr_slabs']['counter']
> nr_objs = int(cache_node['total_objects']['counter'])