linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] arch/sh: kernel: use KERN_CONT in dump_mem()
Date: Fri, 15 Jun 2018 15:49:24 +0000	[thread overview]
Message-ID: <20180615154924.7942-1-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20180615154917.7888-1-thomas.petazzoni@bootlin.com>

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 <thomas.petazzoni@bootlin.com>
---
 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");
 	}
 }
 
-- 
2.14.4


      reply	other threads:[~2018-06-15 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 15:49 [PATCH] arch/sh: kernel: use KERN_CONT in print_sh_insn() Thomas Petazzoni
2018-06-15 15:49 ` Thomas Petazzoni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180615154924.7942-1-thomas.petazzoni@bootlin.com \
    --to=thomas.petazzoni@bootlin.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).