diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 21:41:26 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 21:41:26 -0400 |
| commit | 6d380a3c3f5cc3cac1fb3bea913b18bbfb1f3a13 (patch) | |
| tree | de75609532d917ca404cea2f3b19d85baa22f696 /tools/guest-diag/state_log.sh | |
| parent | d0688c92692cc936ce2c347f26572b1bb55dc660 (diff) | |
| download | open-iov-6d380a3c3f5cc3cac1fb3bea913b18bbfb1f3a13.tar.gz open-iov-6d380a3c3f5cc3cac1fb3bea913b18bbfb1f3a13.zip | |
guest-diag: one-shot gdb/state samplers for timed post-control captures
gdb_now.sh attaches once at a host-chosen moment (final RM control) and dumps
all threads; oneshot_gdb.sh triggers on user-running state; state_log.sh
records state/syscall/wchan so kernel busy-waits can be told apart from real
userspace spins.
Diffstat (limited to 'tools/guest-diag/state_log.sh')
| -rw-r--r-- | tools/guest-diag/state_log.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/guest-diag/state_log.sh b/tools/guest-diag/state_log.sh new file mode 100644 index 0000000..de3d6ed --- /dev/null +++ b/tools/guest-diag/state_log.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# state_log.sh <pid> - 200ms sampler of state/syscall/wchan for the whole run. +PID="$1" +: > /tmp/state.log +while kill -0 "$PID" 2>/dev/null; do + st=$(awk '{print $3}' /proc/$PID/stat 2>/dev/null) + sc=$(cat /proc/$PID/syscall 2>/dev/null | cut -d' ' -f1-3) + wc=$(cat /proc/$PID/wchan 2>/dev/null) + echo "$(date +%T.%3N) st=$st sc=[$sc] wchan=$wc" >> /tmp/state.log + sleep 0.2 +done +echo "$(date +%T.%3N) GONE" >> /tmp/state.log |
