diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 12:17:11 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 12:17:11 -0400 |
| commit | 23c3754ecb231cb7b57bf2f2a81f241a91b09189 (patch) | |
| tree | 8cdaac4fec1eea373966076b650eaa3e2309d588 /tools/guest-diag/inject_counters.sh | |
| parent | 737aea63e67aef4c8dbc1bdf496138215aaaff3e (diff) | |
| download | open-iov-23c3754ecb231cb7b57bf2f2a81f241a91b09189.tar.gz open-iov-23c3754ecb231cb7b57bf2f2a81f241a91b09189.zip | |
guest-diag: semfix watcher (stale sem-pool VA->PA from guest truth); injector marker-based handle discovery
Diffstat (limited to 'tools/guest-diag/inject_counters.sh')
| -rwxr-xr-x | tools/guest-diag/inject_counters.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/guest-diag/inject_counters.sh b/tools/guest-diag/inject_counters.sh index 8a56558..d1d004c 100755 --- a/tools/guest-diag/inject_counters.sh +++ b/tools/guest-diag/inject_counters.sh @@ -52,10 +52,18 @@ fi b64=$(base64 -w0 "$HERE/sem_counters.py") timeout 30 "$VMEXEC" exec "echo '$b64' | base64 -d > /tmp/sem_counters.py" >/dev/null +# Only consider chan_dump lines produced after this script's own trigger: +# dmesg keeps the previous client's dump lines (and handles) forever, and the +# ring buffer wraps so a line-count baseline is not a stable cursor. Write a +# unique marker to /dev/kmsg before each dump and parse only lines after it. +DMESG_MARK="sema-inject-marker-$$-$(date +%s)" + all_grs() { + echo "$DMESG_MARK" | sudo tee /dev/kmsg >/dev/null echo 1 | sudo tee "$PARAM/chan_dump" >/dev/null sleep 1 - sudo dmesg | grep -o 'sema-chan-dump: h=0x[0-9a-f]* eng=0' \ + sudo dmesg | awk -v m="$DMESG_MARK" 'index($0, m) { f = 1; next } f' \ + | grep -o 'sema-chan-dump: h=0x[0-9a-f]* eng=0' \ | grep -o '0x[0-9a-f]*' | sort -u | paste -sd, || true } |
