mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-09-28 01:01:12 -07:00
Accept a print longer than the ring
cloud.oversize-stream drives a job the ring cannot hold and checks the signature of a live feed: the load reporting the job as longer than the ring, the device in live-feed mode, the kernel's program total growing during the run, no underrun, and a clean cancel afterwards. read_program_total gives the catalog the counter that growth is read from.
This commit is contained in:
@@ -148,6 +148,19 @@ def read_ring_residue():
|
||||
return None
|
||||
|
||||
|
||||
def read_program_total():
|
||||
"""Bytes of program the kernel has been given for this run, or None when
|
||||
unreadable. Under a live feed it grows while the job plays: that growth is
|
||||
what says the ring is being topped up rather than preloaded."""
|
||||
try:
|
||||
with open(hw.sysfs_root() + "cnc/position", "rb") as f:
|
||||
raw = f.read(32)
|
||||
_, total = struct.unpack("<2I", raw[12:20])
|
||||
return int(total)
|
||||
except (OSError, struct.error):
|
||||
return None
|
||||
|
||||
|
||||
class Leftover:
|
||||
def __init__(self, item, found, expected, action):
|
||||
self.item = item
|
||||
|
||||
Reference in New Issue
Block a user