summaryrefslogtreecommitdiffstats
path: root/tools/lg/frame_reader.py
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-27 10:13:29 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-27 10:13:29 -0400
commitcb1653d62f521943497e5705803f461ab7041dda (patch)
treecae0f7115051825d0e495e6e6e85e61a52c7304f /tools/lg/frame_reader.py
parent38ba1e2d7d579c2467dfa10daca16cdbd6579089 (diff)
downloadopen-iov-cb1653d62f521943497e5705803f461ab7041dda.tar.gz
open-iov-cb1653d62f521943497e5705803f461ab7041dda.zip
tools/lg: seed frame_reader last_seq from shm header
A stale frame left in the kvmfr shm by a previous publisher run (xshm_pub restarts its own seq at 1) was saved and then blocked the new run's frames via the seq-collision rule. Seeding last_seq from the header's current seq skips the stale frame and lets a fresh run's frames save normally.
Diffstat (limited to 'tools/lg/frame_reader.py')
-rw-r--r--tools/lg/frame_reader.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/lg/frame_reader.py b/tools/lg/frame_reader.py
index f8bab40..783fcaf 100644
--- a/tools/lg/frame_reader.py
+++ b/tools/lg/frame_reader.py
@@ -46,7 +46,11 @@ def main():
deadline = time.time() + args.timeout
saved = 0
- last_seq = 0
+ mm.seek(FRAME_OFFSET)
+ magic, _v, _w, _h, _s, _f, last_seq, _r, _t = HDR.unpack(mm.read(HDR.size))
+ if magic != MAGIC:
+ last_seq = 0
+ print("SEED last_seq=%d" % last_seq)
while saved < args.frames and time.time() < deadline:
mm.seek(FRAME_OFFSET)
magic, ver, w, h, stride, fmt, seq, _res, ts = HDR.unpack(