linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sam Bobroff <sam.bobroff@au1.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: mpe@ellerman.id.au, khandual@linux.vnet.ibm.com
Subject: [PATCH v2 2/2] powerpc/xmon: Paginate kernel log buffer display
Date: Fri, 21 Aug 2015 14:24:28 +1000	[thread overview]
Message-ID: <b2566bb9759662fbbc8dd8718c59fcefdb4df3b0.1440131027.git.sam.bobroff@au1.ibm.com> (raw)
In-Reply-To: <cover.1440131027.git.sam.bobroff@au1.ibm.com>
In-Reply-To: <cover.1440131027.git.sam.bobroff@au1.ibm.com>

The kernel log buffer is often much longer than the size of a terminal
so paginate it's output.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
 arch/powerpc/xmon/xmon.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 9ce9e7d..fdd765e 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -248,9 +248,7 @@ Commands:\n\
 "  u	dump TLB\n"
 #endif
 "  ?	help\n"
-#ifdef CONFIG_PPC64
-"  .#	limit output to # lines per page (dump paca only)\n"
-#endif
+"  .#	limit output to # lines per page (for dp#, dpa, dl)\n"
 "  zr	reboot\n\
   zh	halt\n"
 ;
@@ -850,6 +848,7 @@ static void paged_set_size(void)
 		paged_size = 0;
 	}
 }
+
 static void paged_reset(void)
 {
 	paged_cur_page = 0;
@@ -2372,10 +2371,12 @@ dump_log_buf(void)
 	sync();
 
 	kmsg_dump_rewind_nolock(&dumper);
+	paged_start();
 	while (kmsg_dump_get_line_nolock(&dumper, false, buf, sizeof(buf), &len)) {
 		buf[len] = '\0';
-		printf("%s", buf);
+		XMON_PRINTF("%s", buf);
 	}
+	paged_end("dl\n");
 
 	sync();
 	/* wait a little while to see if we get a machine check */
-- 
2.1.4

      parent reply	other threads:[~2015-08-21  4:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21  4:24 [PATCH v2 0/2] powerpc/xmon: Paged output for paca display Sam Bobroff
2015-08-21  4:24 ` [PATCH v2 1/2] " Sam Bobroff
2015-10-06 11:05   ` [v2,1/2] " Michael Ellerman
2015-10-08  0:26     ` Sam Bobroff
2015-08-21  4:24 ` Sam Bobroff [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=b2566bb9759662fbbc8dd8718c59fcefdb4df3b0.1440131027.git.sam.bobroff@au1.ibm.com \
    --to=sam.bobroff@au1.ibm.com \
    --cc=khandual@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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).