logging: Fix counting of buffered messages
When message is dropped then log_process is called with bypass flag set and additionally z_log_dropped() is called. In both functions counter of buffered messages was decremented. That resulted in counter being decremented twice. It resulted in logging misbehavior after messages being dropped (delayed processing). Fixing it by decrementing the counter in log_process only when bypass flag is not set. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
8c0a017cd3
commit
c51aa88046
1 changed files with 3 additions and 1 deletions
|
@ -817,7 +817,9 @@ bool z_impl_log_process(bool bypass)
|
||||||
|
|
||||||
msg = get_msg();
|
msg = get_msg();
|
||||||
if (msg.msg) {
|
if (msg.msg) {
|
||||||
atomic_dec(&buffered_cnt);
|
if (!bypass) {
|
||||||
|
atomic_dec(&buffered_cnt);
|
||||||
|
}
|
||||||
msg_process(msg, bypass);
|
msg_process(msg, bypass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue