summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/guest-diag/cuda_cycle.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/guest-diag/cuda_cycle.sh b/tools/guest-diag/cuda_cycle.sh
index 19143a2..cc333fb 100755
--- a/tools/guest-diag/cuda_cycle.sh
+++ b/tools/guest-diag/cuda_cycle.sh
@@ -33,15 +33,16 @@ timeout 30 "$VMEXEC" exec \
>/dev/null 2>&1
echo "[*] waiting for 20 GR channels"
-for i in $(seq 1 90); do
- sleep 2
- echo 1 | sudo tee /sys/module/open_iov_vfio/parameters/chan_dump >/dev/null
- sleep 1
- n=$(sudo dmesg -T | grep "sema-chan-dump" | grep "eng=0" | wc -l)
+# The client times out its context-init wait in ~30 s, so detection must be
+# cheap: count the per-channel first-pump log lines straight from dmesg
+# instead of round-tripping through the chan_dump parameter every second.
+for i in $(seq 1 240); do
+ n=$(sudo dmesg -T | grep -c "sema-chan: h=0x5c" || true)
if [ "$n" -ge 20 ]; then
echo " GR channels up (poll $i)"
break
fi
+ sleep 0.5
done
echo "[*] injecting counters"