aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/cpus.py
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-06-10 12:03:21 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-06-10 12:03:21 +0100
commit594ce0b8a998aa4d05827cd7c0d0dcec9a1e3ae2 (patch)
tree070bd60a8fda15e5f47339d3f6888a0fe2ca6fe9 /scripts/gdb/linux/cpus.py
parent616501eccb58615f8f352a29239ea6c6fc5e6546 (diff)
parente3cf20e5c68df604315ab30bdbe15dc8a5da556b (diff)
Merge topic branches 'clkdev' and 'fixes' into for-linus
Diffstat (limited to 'scripts/gdb/linux/cpus.py')
-rw-r--r--scripts/gdb/linux/cpus.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py
index cba589e5b57d..2f11c4f9c345 100644
--- a/scripts/gdb/linux/cpus.py
+++ b/scripts/gdb/linux/cpus.py
@@ -26,11 +26,7 @@ def get_current_cpu():
if utils.get_gdbserver_type() == utils.GDBSERVER_QEMU:
return gdb.selected_thread().num - 1
elif utils.get_gdbserver_type() == utils.GDBSERVER_KGDB:
- tid = gdb.selected_thread().ptid[2]
- if tid > (0x100000000 - MAX_CPUS - 2):
- return 0x100000000 - tid - 2
- else:
- return tasks.get_thread_info(tasks.get_task_by_pid(tid))['cpu']
+ return gdb.parse_and_eval("kgdb_active.counter")
else:
raise gdb.GdbError("Sorry, obtaining the current CPU is not yet "
"supported with this gdb server.")
@@ -152,9 +148,8 @@ Note that VAR has to be quoted as string."""
def __init__(self):
super(PerCpu, self).__init__("lx_per_cpu")
- def invoke(self, var_name, cpu=-1):
- var_ptr = gdb.parse_and_eval("&" + var_name.string())
- return per_cpu(var_ptr, cpu)
+ def invoke(self, var, cpu=-1):
+ return per_cpu(var.address, cpu)
PerCpu()