[PATCH 3/3] log: call vsnprintf only when it is needed to emit trace

Simon Glass sjg at chromium.org
Wed Nov 11 15:32:03 CET 2020


On Fri, 6 Nov 2020 at 10:55, Patrick Delaunay <patrick.delaunay at st.com> wrote:
>
> 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.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
>
> # Conflicts:
> #       common/log.c
> ---
>
>  common/log.c | 22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list