[U-Boot] [PATCH 9/9] log: Add a way to log error-return values
Simon Glass
sjg at chromium.org
Fri Jan 26 21:43:05 UTC 2018
On 28 December 2017 at 13:14, Simon Glass <sjg at chromium.org> wrote:
> 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 at chromium.org>
> ---
>
> common/Kconfig | 13 +++++++++++++
> configs/sandbox_defconfig | 1 +
> doc/README.log | 8 ++++++++
> include/log.h | 11 +++++++++++
> 4 files changed, 33 insertions(+)
Applied to u-boot-dm.
More information about the U-Boot
mailing list