From: Jens Remus <jremus@linux.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
Jan Kiszka <jan.kiszka@siemens.com>,
Kieran Bingham <kbingham@kernel.org>
Cc: Jens Remus <jremus@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH 3/3] scripts/gdb: add lx_cpu convenience function
Date: Thu, 4 Dec 2025 17:34:25 +0100 [thread overview]
Message-ID: <20251204163425.370783-4-jremus@linux.ibm.com> (raw)
In-Reply-To: <20251204163425.370783-1-jremus@linux.ibm.com>
lx_cpu is a convenience function to retrieve the current CPU number.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
scripts/gdb/linux/cpus.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py
index 3e17550cd577..fa05fc30a090 100644
--- a/scripts/gdb/linux/cpus.py
+++ b/scripts/gdb/linux/cpus.py
@@ -119,6 +119,21 @@ def each_active_cpu():
yield cpu
+class LxCpuFunc(gdb.Function):
+ """Return current CPU number.
+
+$lx_cpu(): Return the current CPU number."""
+
+ def __init__(self):
+ super(LxCpuFunc, self).__init__("lx_cpu")
+
+ def invoke(self):
+ return get_current_cpu()
+
+
+LxCpuFunc()
+
+
class LxCpus(gdb.Command):
"""List CPU status arrays
--
2.51.0
prev parent reply other threads:[~2025-12-04 16:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-04 16:34 [PATCH 0/3] scripts/gdb: Improve s390 support Jens Remus
2025-12-04 16:34 ` [PATCH 1/3] scripts/gdb: add lx_current support for s390 Jens Remus
2025-12-04 16:34 ` [PATCH 2/3] scripts/gdb: add lx_lowcore convenience function on s390 Jens Remus
2025-12-04 16:34 ` Jens Remus [this message]
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=20251204163425.370783-4-jremus@linux.ibm.com \
--to=jremus@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=jan.kiszka@siemens.com \
--cc=kbingham@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.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
all inboxes | Powered by JetHome®