summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/push_guest_tools.sh
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 08:53:11 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 08:53:11 -0400
commit6e04a93838cdebbcf9183278cb71bdf1b4235cdc (patch)
tree219603fb2b24af8705a09558d93d8f41c33081e2 /tools/guest-diag/push_guest_tools.sh
parent6588981b619814b9c2b26130165e440f0556bdec (diff)
downloadopen-iov-6e04a93838cdebbcf9183278cb71bdf1b4235cdc.tar.gz
open-iov-6e04a93838cdebbcf9183278cb71bdf1b4235cdc.zip
tools: durable guest counter enumeration/injection and VA reader
The counter enumeration/injection workflow lived in the guest's /tmp and was lost on every restart. Make it durable under tools/guest-diag: - sem_counters.py: translate a process's per-channel u32 completion counters (16-byte stride in the /dev/nvidiactl counter page) to guest PAs through /proc/<pid>/pagemap; --pairs emits handle,va,pa triples. - sem_slots.py: read/write the counter slots via /proc/<pid>/mem (fallback for the host counter publish). - read_va.py: hex dump a process VA (UVM sysmem GPU VAs are usually valid CPU VAs in the owning process); --u32 for method streams. - inject_counters.sh: host-side one-shot: push the tool, take the GR handles from the live chan_dump, enumerate, then register each counter with sema_counter and pin its VA with sema_map_add. - push_guest_tools.sh: push the new tools after every VM start. - launch_qemu_direct.sh: parameterized mdev UUID/paths instead of a stale hardcoded one; committed so it survives checkouts.
Diffstat (limited to 'tools/guest-diag/push_guest_tools.sh')
-rwxr-xr-xtools/guest-diag/push_guest_tools.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/guest-diag/push_guest_tools.sh b/tools/guest-diag/push_guest_tools.sh
index 607cce4..42b91ae 100755
--- a/tools/guest-diag/push_guest_tools.sh
+++ b/tools/guest-diag/push_guest_tools.sh
@@ -27,6 +27,10 @@ push_b64 "$REPO/tools/test/cuda_drv_test.c" /tmp/cdt.c
push_b64 "$HERE/dumpctx.py" /tmp/dumpctx.py
push_b64 "$HERE/trkinfo.py" /tmp/trkinfo.py
push_b64 "$HERE/bp999.py" /tmp/bp999.py
+push_b64 "$HERE/sem_counters.py" /tmp/sem_counters.py
+push_b64 "$HERE/sem_slots.py" /tmp/sem_slots.py
+push_b64 "$HERE/read_va.py" /tmp/read_va.py
+push_b64 "$HERE/guest_pmap.py" /tmp/guest_pmap.py
echo "[*] compiling in guest..."
"$VMEXEC" exec "gcc -O1 -w -o /tmp/ptio /tmp/ptio.c && \