From patchwork Fri Aug 21 04:24:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 509277 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 21DD5140773 for ; Fri, 21 Aug 2015 14:29:05 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 07BA81A2B0D for ; Fri, 21 Aug 2015 14:29:05 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id EEA841A022F for ; Fri, 21 Aug 2015 14:25:35 +1000 (AEST) Received: by ozlabs.org (Postfix) id DA048140784; Fri, 21 Aug 2015 14:25:35 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A057C140AF3 for ; Fri, 21 Aug 2015 14:25:35 +1000 (AEST) Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Aug 2015 14:25:32 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 21 Aug 2015 14:25:29 +1000 X-Helo: d23dlp02.au.ibm.com X-MailFrom: sam.bobroff@au1.ibm.com X-RcptTo: linuxppc-dev@ozlabs.org Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 8F2F62BB0052 for ; Fri, 21 Aug 2015 14:25:29 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7L4PEJa49479878 for ; Fri, 21 Aug 2015 14:25:23 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7L4OuH9006661 for ; Fri, 21 Aug 2015 14:24:56 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t7L4Ou4A006187; Fri, 21 Aug 2015 14:24:56 +1000 Received: from tungsten.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 3D30DA024F; Fri, 21 Aug 2015 14:24:32 +1000 (AEST) From: Sam Bobroff To: linuxppc-dev@ozlabs.org Subject: [PATCH v2 2/2] powerpc/xmon: Paginate kernel log buffer display Date: Fri, 21 Aug 2015 14:24:28 +1000 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15082104-0009-0000-0000-000001EFA27C X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: khandual@linux.vnet.ibm.com MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The kernel log buffer is often much longer than the size of a terminal so paginate it's output. Signed-off-by: Sam Bobroff --- 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 */