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:
Krzysztof Chruscinski 2021-12-29 08:08:53 +01:00 committed by Carles Cufí
commit c51aa88046

View file

@ -817,7 +817,9 @@ bool z_impl_log_process(bool bypass)
msg = get_msg();
if (msg.msg) {
if (!bypass) {
atomic_dec(&buffered_cnt);
}
msg_process(msg, bypass);
}