diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 09:44:56 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 09:44:56 -0400 |
| commit | a7ca1054824f0d205514451d7c100fadaf40ea7a (patch) | |
| tree | 56141652029a9ce34eacf5a2f7bd30782bf16879 /tools/guest-diag/inject_counters.sh | |
| parent | 6135508cc3b043c35d2e0617870f35b18b29b79c (diff) | |
| download | open-iov-a7ca1054824f0d205514451d7c100fadaf40ea7a.tar.gz open-iov-a7ca1054824f0d205514451d7c100fadaf40ea7a.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/guest-diag/inject_counters.sh')
| -rwxr-xr-x | tools/guest-diag/inject_counters.sh | 8 |
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]+$') |
