summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/semfix_watch.py
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
commitcb4c9c30e5b77a5a1168297a6be722ece353877e (patch)
treec2507b8f9da240c0957005b567cdb7edb5f63d19 /tools/guest-diag/semfix_watch.py
parent02ab868792cce9917b38532240c4ccf308bee729 (diff)
downloadopen-iov-cb4c9c30e5b77a5a1168297a6be722ece353877e.tar.gz
open-iov-cb4c9c30e5b77a5a1168297a6be722ece353877e.zip
guest-diag: read trace before clearing (one-shot pushbuffer-create events)
Diffstat (limited to 'tools/guest-diag/semfix_watch.py')
-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