summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
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