summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/bp999.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-24 03:29:40 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-24 03:29:40 -0400
commitfedae104af9b569effa8fd3f1cecb72d46d89c16 (patch)
treee7d15971244001617d6c1ee47c0408fa57ca41b7 /tools/guest-diag/bp999.py
parent5c9d18abaac6ce45c8faec26b3f3b637cd764eb5 (diff)
downloadopen-iov-fedae104af9b569effa8fd3f1cecb72d46d89c16.tar.gz
open-iov-fedae104af9b569effa8fd3f1cecb72d46d89c16.zip
tools/guest-diag: add UVM wait diagnostics, tracker poke and VA->PA map injector
Diffstat (limited to 'tools/guest-diag/bp999.py')
-rw-r--r--tools/guest-diag/bp999.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/guest-diag/bp999.py b/tools/guest-diag/bp999.py
new file mode 100644
index 0000000..db83d7d
--- /dev/null
+++ b/tools/guest-diag/bp999.py
@@ -0,0 +1,36 @@
+# gdb script: break on the libcuda instructions that produce CUDA errors
+# 719 (0x2cf) and 999 (0x3e7), then print the stack that led there.
+# Run: sudo gdb -p <cdt-pid> -batch -x /tmp/bp999.py
+import gdb
+
+out = gdb.execute("info proc mappings", to_string=True)
+base = None
+for line in out.splitlines():
+ if "libcuda" in line and "r-xp" in line:
+ f = line.split()
+ base = int(f[0], 16) - int(f[3], 16)
+ break
+print("BASE=0x%x" % (base or 0))
+if base is None:
+ raise SystemExit
+for off in (0x44fb80, 0x44fb6c):
+ gdb.execute("break *0x%x" % (base + off))
+gdb.execute("set pagination off")
+gdb.execute("set confirm off")
+try:
+ gdb.execute("continue")
+except gdb.error as e:
+ print("CONTINUE_ERR %s" % e)
+print("HIT_OR_EXIT")
+try:
+ print(gdb.execute("bt 16", to_string=True))
+except Exception as e:
+ print("bt_fail %s" % e)
+try:
+ print(gdb.execute("info registers rdi rsi rdx rax rbx rbp rip", to_string=True))
+except Exception as e:
+ print("regs_fail %s" % e)
+try:
+ gdb.execute("detach")
+except Exception:
+ pass