summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/pin_gr_stream.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 15:24:31 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 15:24:31 -0400
commit8d45a99fe54cb2b19b3024fd975ab11574611c3e (patch)
tree43615ee128d2687b2f7093f95597cf9379484c4a /tools/guest-diag/pin_gr_stream.py
parent1895679334371c5a89dd5cb715c980ade6559c72 (diff)
downloadopen-iov-8d45a99fe54cb2b19b3024fd975ab11574611c3e.tar.gz
open-iov-8d45a99fe54cb2b19b3024fd975ab11574611c3e.zip
guest-diag: stream uvmt sems over vsock (no guest-agent race); dump channel last release VA; larger push log budget
Diffstat (limited to 'tools/guest-diag/pin_gr_stream.py')
-rw-r--r--tools/guest-diag/pin_gr_stream.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/guest-diag/pin_gr_stream.py b/tools/guest-diag/pin_gr_stream.py
index c1ef7b2..44f8681 100644
--- a/tools/guest-diag/pin_gr_stream.py
+++ b/tools/guest-diag/pin_gr_stream.py
@@ -25,12 +25,23 @@ PORT = int(os.environ.get("PINWIN_PORT", "45678"))
LO = os.environ.get("PINWIN_LO", "0x200400000")
HI = os.environ.get("PINWIN_HI", "0x206000000")
PAMAX = os.environ.get("PINWIN_PA_MAX", "0x180000000")
+SEMSTREAM = os.environ.get("SEM_STREAM_FILE", "/tmp/opencode/sem_stream.txt")
def log(msg):
print("[%s] %s" % (time.strftime("%H:%M:%S"), msg), flush=True)
+def _mirror(line):
+ """Append guest control lines (#pid/#sem) to the shared host file so the
+ single-QMP watcher can consume them without guest-agent round trips."""
+ try:
+ with open(SEMSTREAM, "a") as f:
+ f.write(line + "\n")
+ except OSError:
+ pass
+
+
def vexec(cmd, timeout=40):
try:
r = subprocess.run([VMEXEC, "exec", "--timeout", str(timeout - 5), cmd],
@@ -115,6 +126,10 @@ def main():
m = re.search(r"(\d+)", text)
seen = {}
log("guest reports cdt pid %s" % (m.group(1) if m else "?"))
+ _mirror(text)
+ continue
+ if text.startswith("#sem"):
+ _mirror(text)
continue
m = re.match(r"^(0x[0-9a-f]+),(0x[0-9a-f]+)(?:,(\d+))?$", text)
if m: