From a329dc681fc062c2c5ba5a6c6e8fa128617cf780 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Sat, 24 Oct 2026 12:55:36 -0400 Subject: tools r621: read_proc_va.py - read a running client's mapped words via /proc//mem (the guest-side half of the sem-write divergence comparison; pairs with the r619/r620 sema-sw witness) --- tools/guest-diag/read_proc_va.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tools/guest-diag/read_proc_va.py 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) -- cgit v1.2.3