FIFO overflows can occur repeatedly when a consumer cannot keep up with
the incoming data rate. Logging every overflow can flood the application
logs and obscure other messages, while providing little additional
information about the underlying problem.
Rate-limit overflow messages from DataFifo and SampleSinkFifo while
continuing to report every overflow through the SampleSinkFifo signal.
Accumulate the number of dropped samples and overflow events during the
suppression interval and report them as a single aggregate message.
After reporting the aggregate, require a quiet recovery interval before
resuming immediate overflow reporting. This limits log volume while
retaining useful information about the severity and duration of FIFO
overruns.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
The DataFifo and SampleSinkFifo write() overloads contained nearly identical
overflow handling code. This made the behavior harder to maintain and meant
changes to overflow reporting would need to be made in multiple places.
Move the common overflow logging and rate-limiting behavior into dedicated
helper functions so both write() paths use the same implementation.
Also include the FIFO size in all DataFifo overflow messages to provide more
useful diagnostics and make the messages consistent between the two write()
overloads.
No functional changes to FIFO handling, suppression, or overflow signaling;
the only observable change is the overflow message format.
Signed-off-by: Robin Getz <rgetz503@gmail.com>