]> git.baikalelectronics.ru Git - uboot.git/commit
log: Add a way to log error-return values
authorSimon Glass <sjg@chromium.org>
Thu, 28 Dec 2017 20:14:23 +0000 (13:14 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 3 Feb 2018 17:09:27 +0000 (10:09 -0700)
commit90d49003ed3f704c532c7148e6d552af4dcfcb7d
tree86b7c70cf64113d77001fed0b2a57396aa3439a2
parent1dee5d95c1fc8b9f260ade6f9ed7f63f8b23ca54
log: Add a way to log error-return values

When functions return an error it propagates up the stack to the point
where it is reported. Often the error code provides enough information
about the root cause of the error that this is obvious what went wrong.

However in some cases the error may be hard to trace. For example if a
driver uses several devices to perform an operation, it may not be
obvious which one failed.

Add a log_ret() macro to help with this. This can be used to wrap any
error-return value. The logging system will then output a log record when
the original error is generated, making it easy to trace the call stack
of the error.

This macro can significantly impact code size, so its use is controlled
by a Kconfig option, which is enabled for sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/Kconfig
configs/sandbox_defconfig
doc/README.log
include/log.h