diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 14:47:17 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 14:47:17 -0400 |
| commit | 0cbe5604adff2bc386960edbc58f45e35e61bae8 (patch) | |
| tree | d5b803fffddd5ab201254a40ec8a5138d65b38f7 /tools | |
| parent | fa31d766d548a0e07426b6d231a42f05c07521a8 (diff) | |
| download | open-iov-0cbe5604adff2bc386960edbc58f45e35e61bae8.tar.gz open-iov-0cbe5604adff2bc386960edbc58f45e35e61bae8.zip | |
guest-diag: cheaper trace read, optional push sampler, bigger pagemap batches
Under load the semfix poll grepped the whole (growing) trace file and the
track_waits push block spawned three guest processes per sample, both of
which slowed the pin path into the client's failure window. The trace read
now tails 128 KB; track_waits.sh gates the push dump behind PUSH=0; the
pagemap helper reads 32 KB chunks.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/guest-diag/guest_pmap_win.py | 2 | ||||
| -rw-r--r-- | tools/guest-diag/semfix_watch.py | 3 | ||||
| -rw-r--r-- | tools/guest-diag/track_waits.sh | 19 |
3 files changed, 14 insertions, 10 deletions
diff --git a/tools/guest-diag/guest_pmap_win.py b/tools/guest-diag/guest_pmap_win.py index f6ca85c..501e7bc 100644 --- a/tools/guest-diag/guest_pmap_win.py +++ b/tools/guest-diag/guest_pmap_win.py @@ -16,7 +16,7 @@ hi = int(sys.argv[3], 16) maxp = int(sys.argv[4]) if len(sys.argv) > 4 else 20000 pa_max = int(sys.argv[5], 16) if len(sys.argv) > 5 else 0 -BATCH = 512 +BATCH = 4096 out = [] run_va = run_pa = None run_n = 0 diff --git a/tools/guest-diag/semfix_watch.py b/tools/guest-diag/semfix_watch.py index 400fafe..347da5e 100644 --- a/tools/guest-diag/semfix_watch.py +++ b/tools/guest-diag/semfix_watch.py @@ -145,7 +145,8 @@ def guest_trace(): Read *before* clearing: the create-time probes fire once per client and would be wiped by a clear that races them. """ - inner = ("grep -E \"uvmt|uvch|uvbp|uvpbf\" /sys/kernel/tracing/trace " + inner = ("tail -c 131072 /sys/kernel/tracing/trace " + "| grep -E \"uvmt|uvch|uvbp|uvpbf\" " "| tail -400") if not os.environ.get("KEEP_TRACE"): inner += "; echo > /sys/kernel/tracing/trace" diff --git a/tools/guest-diag/track_waits.sh b/tools/guest-diag/track_waits.sh index 45a9a66..6ae9154 100644 --- a/tools/guest-diag/track_waits.sh +++ b/tools/guest-diag/track_waits.sh @@ -16,6 +16,7 @@ PAGE_VA="${PAGE_VA:-0x20400f000}" COUNT="${COUNT:-20}" STRIDE="${STRIDE:-16}" OFFSET="${OFFSET:-0xec0}" +PUSH="${PUSH:-1}" : > /tmp/trk.log : > /tmp/cnt.log @@ -58,14 +59,16 @@ for i in $(seq 1 "$N"); do | grep -vE "^\[|Reading symbols|^0x[0-9a-f]+ in |warning:" >> /tmp/trk.log fi - { - echo "=== $TS push pages ===" - python3 /tmp/guest_pmap.py "$PID" 0x201000000 0x203400000 0x203400020 2>&1 - for va in 0x201000000 0x203400000 0x203400020; do - echo "--- $va" - timeout 5 python3 /tmp/read_va.py "$PID" "$va" 64 --u32 2>&1 - done - } >> /tmp/push.log + if [ "$PUSH" = "1" ]; then + { + echo "=== $TS push pages ===" + python3 /tmp/guest_pmap.py "$PID" 0x201000000 0x203400000 0x203400020 2>&1 + for va in 0x201000000 0x203400000 0x203400020; do + echo "--- $va" + timeout 5 python3 /tmp/read_va.py "$PID" "$va" 64 --u32 2>&1 + done + } >> /tmp/push.log + fi sleep "$SLEEP" done |
