summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 09:44:56 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 09:44:56 -0400
commit846c98b686fa9752dd434eda54540a999faf96ec (patch)
tree91076af6d1feb277c7d631fbb54ed5ae7929d018 /tools
parentac30e46473daea25cabb257a803027d0824abcc6 (diff)
downloadopen-iov-846c98b686fa9752dd434eda54540a999faf96ec.tar.gz
open-iov-846c98b686fa9752dd434eda54540a999faf96ec.zip
tools: inject_counters.sh - counter index order is descending by handle
Live verification: the trackers waiting on counter slots idx2/idx3 belong to the channels 2nd/3rd from the top of the ascending handle list, and the only channel whose GPFIFO put advanced to 2 was the 4th from the top, whose tracker polled idx3. Zip descending handles with ascending counter indices by default; ORDER=asc restores creation order.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/guest-diag/inject_counters.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/guest-diag/inject_counters.sh b/tools/guest-diag/inject_counters.sh
index a2a8371..b4e20bd 100755
--- a/tools/guest-diag/inject_counters.sh
+++ b/tools/guest-diag/inject_counters.sh
@@ -48,6 +48,14 @@ if [ -z "$GRS" ]; then
exit 1
fi
+# Counter index order: observed DESCENDING by channel handle (the client's
+# last-created channel owns counter 0; verified live: trackers waiting on
+# counter idx2/idx3 belong to the channels 2nd/3rd from the top). ORDER=asc
+# restores creation order.
+if [ "${ORDER:-desc}" = "desc" ]; then
+ GRS=$(echo "$GRS" | tr ',' '\n' | sort -r | paste -sd,)
+fi
+
PAIRS=$(timeout 30 "$VMEXEC" exec \
"python3 /tmp/sem_counters.py $PID $PAGE_VA --count=$COUNT --pairs $GRS" \
2>/dev/null | grep -E '^0x[0-9a-f]+,0x[0-9a-f]+,[0-9]+$')