[Skiboot] [PATCH] hw/bt: improve logging

Stewart Smith stewart at linux.vnet.ibm.com
Thu Jan 7 16:55:32 AEDT 2016


Cédric Le Goater <clg at fr.ibm.com> writes:

> This patch adds a "BT: " prefix to all logs and replaces a forgotten
> printf.
>
> Signed-off-by: Cédric Le Goater <clg at fr.ibm.com>
> ---
>  hw/bt.c |   23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
>
> Index: skiboot.git/hw/bt.c
> ===================================================================
> --- skiboot.git.orig/hw/bt.c
> +++ skiboot.git/hw/bt.c
> @@ -77,15 +77,16 @@
>
>  #define _BT_Q_LOG(level, msg, fmt, args...) \
>  	do { if (msg) \
> -			prlog(level, "BT seq 0x%02x netfn 0x%02x cmd 0x%02x: " fmt "\n", \
> +			prlog(level, "BT: seq 0x%02x netfn 0x%02x cmd 0x%02x: " fmt "\n", \
>  			(msg)->seq, (msg)->ipmi_msg.netfn, (msg)->ipmi_msg.cmd, ##args); \
>  		else \
> -			prlog(level, "BT seq 0x?? netfn 0x?? cmd 0x??: " fmt "\n", ##args); \
> +			prlog(level, "BT: seq 0x?? netfn 0x?? cmd 0x??: " fmt "\n", ##args); \
>  	} while(0)

Instead of that you can just
#define pr_fmt(fmt) "BT: " fmt

before you #include skiboot.h and it'll do it automagically for you for
every prlog in that file.

Arguably we should switch from the BT_XXX macros just to calling prlog
or teh other prerror functions to aid in grep-ability.

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list