zephyr: audio: host: Fix "no bytes to copy" log supressing#10068
zephyr: audio: host: Fix "no bytes to copy" log supressing#10068lgirdwood merged 1 commit intothesofproject:mainfrom
Conversation
Display the number of previously skipped log entries before displaying a new entry about no bytes to copy. Restart nobytes_last_logged after displaying the number of skipped messages. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
There was a problem hiding this comment.
Pull Request Overview
This PR fixes log suppression for no-bytes events in the Zephyr audio host by displaying the number of skipped events and associated byte count before logging a new no-bytes event.
- Recalculates the reset condition for skipped events using the elapsed time since the last log.
- Updates the log message format and reorders the logic for resetting and incrementing the skipped counter.
|
|
||
| if (!dma_copy_bytes) { | ||
| if (delta > SOF_MIN_NO_BYTES_INTERVAL_MS) { | ||
| if (!hd->n_skipped || reset_skipped) { |
There was a problem hiding this comment.
[nitpick] Consider restructuring the incrementation of hd->n_skipped by moving the increment into an else clause. This would clarify that the increment is intended only when no logging occurs, improving readability.
|
Thanks @softwarecki this is super useful. I wonder if we can make it generic under a function named |
|
@softwarecki how realistic is actually the kpb test? If this is a practically feasible flow, then we probably shouldn't complain about "no bytes" every millisecond? And after your changes even with 2 messages per millisecond. The output does potentially look nicer, but I'm wondering whether in realistic scenarios it really would increase logging output a lot? |
lgirdwood
left a comment
There was a problem hiding this comment.
Zephyr may have plans for rate limited logging... might be worth inquiring, but this is good now.
|
@lyak: The goal of this PR is to improve the mechanism of skipping log messages. Since they look nicer, it means the goal has been achieved. :) The way kpb works (host is starved until a keyword is detected, which causes the log to be spammed with "no bytes" entries) is beyond my interest at the moment. |
Display the number of previously skipped log entries before displaying a new entry about no bytes to copy. Restart nobytes_last_logged after displaying the number of skipped messages.
Log before change:
after:
The above fragments are from the kpb test. When draining the history buffer, the host copy function is called twice per period. Once by the pipeline and once by the draining task.