From patchwork Fri Jun 15 15:49:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 10466813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DE3A601C2 for ; Fri, 15 Jun 2018 15:49:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E54728DF8 for ; Fri, 15 Jun 2018 15:49:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5355728E00; Fri, 15 Jun 2018 15:49:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E79B728DF8 for ; Fri, 15 Jun 2018 15:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965684AbeFOPt1 (ORCPT ); Fri, 15 Jun 2018 11:49:27 -0400 Received: from mail.bootlin.com ([62.4.15.54]:51611 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965639AbeFOPt1 (ORCPT ); Fri, 15 Jun 2018 11:49:27 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id C6BE7207B0; Fri, 15 Jun 2018 17:49:25 +0200 (CEST) Received: from localhost (AAubervilliers-681-1-37-30.w90-88.abo.wanadoo.fr [90.88.156.30]) by mail.bootlin.com (Postfix) with ESMTPSA id 9C65F20728; Fri, 15 Jun 2018 17:49:25 +0200 (CEST) From: Thomas Petazzoni To: Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Cc: Thomas Petazzoni Subject: [PATCH] arch/sh: kernel: use KERN_CONT in dump_mem() Date: Fri, 15 Jun 2018 17:49:24 +0200 Message-Id: <20180615154924.7942-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.14.4 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The dump_mem() function prints the contents of various areas of memory, for example the Stack when a crash occurs. It uses multiple printk() calls to create a single line, but due to the lack of KERN_CONT, those multiple printk() calls end up on separate lines, causing a ridiculous output: Stack: (0x97e45d74 to 0x97e46000) 5d60: 88316514 97e45d84 88002ec4 5d80: 00000000 88010f4c 97e45da4 97c5e35c 97e6a3e0 00000001 97e45df4 29ee9000 By fixing this, the output becomes a lot more useful: Stack: (0x96d1dd94 to 0x96d1e000) dd80: 883163f4 96d1dda4 88002ec4 dda0: 00000000 88010eee 96d1ddc4 97cd23dc 295ab020 00000001 96d1ddf4 00000001 ddc0: 29ee9000 8806f23a 96d1dddc 880558cc 8805588c 88010ed0 29ee9000 88071eb8 dde0: 97cda080 00000000 96d1de24 00000001 00000001 8800ff34 8806f8ac 96d1de18 de00: 97cd23dc 295ab020 00000000 00000001 ffffffff 29ee9518 8800ec50 00000001 de20: 96d1de1c 00000000 00000000 00000518 88070eae 96d1de50 97cd23dc 295ab020 de40: 00000000 00000001 00000000 29ee9518 97ef4008 97cda0b8 97cda080 29ee3fff Signed-off-by: Thomas Petazzoni --- arch/sh/kernel/dumpstack.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/sh/kernel/dumpstack.c b/arch/sh/kernel/dumpstack.c index b564b1eae4ae..e47635f602df 100644 --- a/arch/sh/kernel/dumpstack.c +++ b/arch/sh/kernel/dumpstack.c @@ -33,16 +33,16 @@ void dump_mem(const char *str, unsigned long bottom, unsigned long top) unsigned int val; if (p < bottom || p >= top) - printk(" "); + printk(KERN_CONT " "); else { if (__get_user(val, (unsigned int __user *)p)) { - printk("\n"); + printk(KERN_CONT "\n"); return; } - printk("%08x ", val); + printk(KERN_CONT "%08x ", val); } } - printk("\n"); + printk(KERN_CONT "\n"); } }