[PATCH 1/4] scripts/gdb: Fix failing KGDB detection during probe

From: Florian Rommel
Date: Thu Apr 25 2024 - 12:03:55 EST


The KGDB probe function sometimes failed to detect KGDB for SMP machines as
it assumed that task 2 (kthreadd) is running on CPU 0, which is not
necessarily the case. Now, the detection is agnostic to kthreadd's CPU.

Signed-off-by: Florian Rommel <mail@xxxxxxxxxxxx>
---
scripts/gdb/linux/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gdb/linux/utils.py b/scripts/gdb/linux/utils.py
index 7d5278d815fa..245ab297ea84 100644
--- a/scripts/gdb/linux/utils.py
+++ b/scripts/gdb/linux/utils.py
@@ -196,7 +196,7 @@ def get_gdbserver_type():
def probe_kgdb():
try:
thread_info = gdb.execute("info thread 2", to_string=True)
- return "shadowCPU0" in thread_info
+ return "shadowCPU" in thread_info
except gdb.error:
return False

--
2.44.0