]> git.dujemihanovic.xyz Git - u-boot.git/commit
log: call vsnprintf only when it is needed to emit trace
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 27 Nov 2020 10:20:59 +0000 (11:20 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 15 Jan 2021 19:36:11 +0000 (14:36 -0500)
commitc698b998bb6003297f8ce20ba136348446e78278
tree0d486d0d8fd2ef09c54db486d4e456f59af154a4
parent742346f6cc1d7053e95d26c82d235e00dd8c1e40
log: call vsnprintf only when it is needed to emit trace

Reduce the log overhead when the traces are filtered,
by moving the vsnprintf call from _log() to log_dispatch().

This patch avoids the printf treatment when LOG features is
activated, but trace is filtered, for example when
MAX_LOG_LEVEL=8 and LOG_DEFAULT_LEVEL=6.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
common/log.c