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

Cédric Le Goater clg at fr.ibm.com
Thu Jan 7 19:16:01 AEDT 2016


On 01/07/2016 06:55 AM, Stewart Smith wrote:
> 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.

OK. I see. 

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

Yes. I will change the patch and resend.

Thanks,

C. 
 



More information about the Skiboot mailing list