summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 13:20:52 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 13:20:52 -0400
commit9f811bcb791f324622b638dcb17283014dba10fa (patch)
tree7c7ba8528dde404a137cd9feb052d53a367b9aed /tools
parent7d2ea450bae8e2de2255b8d592de647ea4490507 (diff)
downloadopen-iov-9f811bcb791f324622b638dcb17283014dba10fa.tar.gz
open-iov-9f811bcb791f324622b638dcb17283014dba10fa.zip
guest-diag: read trace before clearing (one-shot pushbuffer-create events)
Diffstat (limited to 'tools')
-rw-r--r--tools/guest-diag/semfix_watch.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/guest-diag/semfix_watch.py b/tools/guest-diag/semfix_watch.py
index c0ce072..c4d45fc 100644
--- a/tools/guest-diag/semfix_watch.py
+++ b/tools/guest-diag/semfix_watch.py
@@ -88,9 +88,13 @@ def is_gpu(v):
def guest_trace():
- """(sem kptrs, pushbuffer kptrs) from the trace ring, then clear it."""
- cmd = ("sudo sh -c 'echo > /sys/kernel/tracing/trace; sleep 2; "
- "grep -E \"uvmt|uvpb\" /sys/kernel/tracing/trace | tail -8'")
+ """(sem kptrs, pushbuffer kptrs) from the trace ring, then clear it.
+
+ Read *before* clearing: uvm_pushbuffer_create fires once per client and
+ would be wiped by a clear that races it.
+ """
+ cmd = ("sudo sh -c 'grep -E \"uvmt|uvpb\" /sys/kernel/tracing/trace | tail -200; "
+ "echo > /sys/kernel/tracing/trace'")
try:
out = subprocess.run([VMEXEC, "exec", cmd], capture_output=True,
text=True, timeout=90).stdout