summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-24 12:55:36 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-24 12:55:36 -0400
commita329dc681fc062c2c5ba5a6c6e8fa128617cf780 (patch)
tree0f0c104535e57c3e3b88c1001bb8d45161a16d09
parent475181f8ffedc7291e217406cb9e545a2af4c07e (diff)
downloadopen-iov-a329dc681fc062c2c5ba5a6c6e8fa128617cf780.tar.gz
open-iov-a329dc681fc062c2c5ba5a6c6e8fa128617cf780.zip
tools r621: read_proc_va.py - read a running client's mapped words via /proc/<pid>/mem (the guest-side half of the sem-write divergence comparison; pairs with the r619/r620 sema-sw witness)
-rw-r--r--tools/guest-diag/read_proc_va.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/guest-diag/read_proc_va.py b/tools/guest-diag/read_proc_va.py
new file mode 100644
index 0000000..c035840
--- /dev/null
+++ b/tools/guest-diag/read_proc_va.py
@@ -0,0 +1,16 @@
+import os, sys
+pat = sys.argv[1]
+vas = [int(a, 16) for a in sys.argv[2:]]
+pids = os.popen("pgrep -x " + pat).read().split()
+if not pids:
+ print("NO-PID"); sys.exit(0)
+pid = int(pids[0])
+print("pid", pid)
+fd = os.open("/proc/%d/mem" % pid, os.O_RDONLY)
+for a in vas:
+ try:
+ os.lseek(fd, a, 0)
+ d = os.read(fd, 4)
+ print(hex(a), d.hex())
+ except OSError as e:
+ print(hex(a), "ERR", e)