[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251204163425.370783-4-jremus@linux.ibm.com>
Date: Thu, 4 Dec 2025 17:34:25 +0100
From: Jens Remus <jremus@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
Jan Kiszka <jan.kiszka@...mens.com>,
Kieran Bingham <kbingham@...nel.org>
Cc: Jens Remus <jremus@...ux.ibm.com>, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>
Subject: [PATCH 3/3] scripts/gdb: add lx_cpu convenience function
lx_cpu is a convenience function to retrieve the current CPU number.
Signed-off-by: Jens Remus <jremus@...ux.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
Powered by blists - more mailing lists