public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Illia Ostapyshyn <illia@yshyn.com>
To: linux-kernel@vger.kernel.org
Cc: Hao Li <hao.li@linux.dev>, Harry Yoo <harry@kernel.org>,
	"Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
	Illia Ostapyshyn <illia@yshyn.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Seongjun Hong <hsj0512@snu.ac.kr>,
	Kieran Bingham <kbingham@kernel.org>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>
Subject: [PATCH 2/2] scripts/gdb: slab: Update field names of struct kmem_cache
Date: Mon, 27 Apr 2026 16:24:48 +0200	[thread overview]
Message-ID: <20260427142448.666117-3-illia@yshyn.com> (raw)
In-Reply-To: <20260427142448.666117-1-illia@yshyn.com>

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@yshyn.com>
---
 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'])
-- 
2.51.2


  parent reply	other threads:[~2026-04-27 14:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 14:24 [PATCH 0/2] Fixes related to lx-slabinfo, lx-slabtrace Illia Ostapyshyn
2026-04-27 14:24 ` [PATCH 1/2] scripts/gdb: mm: Cast untyped symbols in x86_page_ops Illia Ostapyshyn
2026-04-27 14:24 ` Illia Ostapyshyn [this message]
2026-04-28  6:04   ` [PATCH 2/2] scripts/gdb: slab: Update field names of struct kmem_cache Harry Yoo (Oracle)
2026-04-28  8:20   ` Vlastimil Babka (SUSE)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260427142448.666117-3-illia@yshyn.com \
    --to=illia@yshyn.com \
    --cc=akpm@linux-foundation.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=hao.li@linux.dev \
    --cc=harry@kernel.org \
    --cc=hsj0512@snu.ac.kr \
    --cc=jan.kiszka@siemens.com \
    --cc=kbingham@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox