[Skiboot] [PATCH] hw/sbe-p9: Fix multi-line log messages

Oliver O'Halloran oohall at gmail.com
Mon Jul 29 17:28:04 AEST 2019


When sending messages to the SBE we log the message using a multi-line
log message that looks like this:

[   96.390873752,8] SBE: Message queued [chip id = 0x0]:
         Reg0 : 000002010054d401
         Reg1 : 0000000000030d40
         Reg2 : 0000000000000000
         Reg3 : 0000000000000000

The lack of a common prefix makes the log messages annoying to deal with
since you can just grep for SBE: to get all the SBE related messages,
and you can't use grep -v to remove them. There's no real benifit to
squashing all this into a single prlog() call, so use a for loop to
print the registers. With this patch the output is:

[   93.253511545,8] SBE: Message queued [chip id = 0x0]:
[   93.253512343,8] SBE:     Reg0 : 000002010059d401
[   93.253513167,8] SBE:     Reg1 : 0000000000030d40
[   93.253513894,8] SBE:     Reg2 : 0000000000000000
[   93.253514627,8] SBE:     Reg3 : 0000000000000000

Cc: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 hw/sbe-p9.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/sbe-p9.c b/hw/sbe-p9.c
index c28dbb9d6f08..3b415c27e7c5 100644
--- a/hw/sbe-p9.c
+++ b/hw/sbe-p9.c
@@ -283,9 +283,9 @@ static int p9_sbe_msg_send(struct p9_sbe *sbe, struct p9_sbe_msg *msg)
 	if (rc != OPAL_SUCCESS)
 		return rc;
 
-	prlog(PR_TRACE, "Message queued [chip id = 0x%x]:\n\t Reg0 : %016llx"
-	      "\n\t Reg1 : %016llx\n\t Reg2 : %016llx\n\t Reg3 : %016llx\n",
-	      sbe->chip_id, msg->reg[0], msg->reg[1], msg->reg[2], msg->reg[3]);
+	prlog(PR_TRACE, "Message queued [chip id = 0x%x]:\n", sbe->chip_id);
+	for (i = 0; i < 4; i++)
+		prlog(PR_TRACE, "    Reg%d : %016llx\n", i, msg->reg[i]);
 
 	msg->timeout = mftb() + msecs_to_tb(SBE_CMD_TIMEOUT_MAX);
 	sbe->state = sbe_mbox_send;
-- 
2.21.0



More information about the Skiboot mailing list