From 80e2ec8d27a497f5424e47c3b3753d1982d79adb Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 16:51:57 -0400 Subject: guest-diag: non-blocking trace tail + 100ms scan loop + raw counter-page dump - the trace tail (subprocess + 256KB read) ran inside the scan loop and blocked it for seconds exactly when the client's GR window appeared; moved to a background thread whose queue the loop drains. - scan interval 250ms -> 100ms. - track_waits sampler also dumps 512 raw bytes at page+0xe00 each sample: the per-slot reads disagreed with the bulk dump within one sample because host writes land between the two, and the raw dump is the only trustworthy view of the slot layout. --- tools/guest-diag/track_waits.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/guest-diag/track_waits.sh') diff --git a/tools/guest-diag/track_waits.sh b/tools/guest-diag/track_waits.sh index 6ae9154..1e3cc91 100644 --- a/tools/guest-diag/track_waits.sh +++ b/tools/guest-diag/track_waits.sh @@ -45,6 +45,16 @@ while True: except OSError: vals.append('%d:ERR' % i) print('%s %s' % (ts, ' '.join(vals)), flush=True) + # Raw hex dump of the counter window: shows the true slot layout and any + # value a stride-16 sample would misread. + try: + os.lseek(pm, (page // 4096) * 8, 0) + e = int.from_bytes(os.read(pm, 8), 'little') + if (e >> 63) & 1: + raw = os.pread(mem, 0x200, page + 0xe00) + print('%s RAW %s' % (ts, raw.hex()), flush=True) + except OSError: + pass time.sleep(0.5) PY CNTPID=$! -- cgit v1.2.3