Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753771AbbBSWob (ORCPT ); Thu, 19 Feb 2015 17:44:31 -0500 Received: from mail-wi0-f170.google.com ([209.85.212.170]:55918 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753726AbbBSWo2 (ORCPT ); Thu, 19 Feb 2015 17:44:28 -0500 From: Adrien Schildknecht To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, rostedt@goodmis.org, heukelum@fastmail.fm, luto@amacapital.net, adech.fo@gmail.com, masami.hiramatsu.pt@hitachi.com, akpm@linux-foundation.org, a.ryabinin@samsung.com, fruggeri@arista.com Cc: linux-kernel@vger.kernel.org, Adrien Schildknecht Subject: [PATCH 1/2] x86: fix output of show_stack_log_lvl() Date: Thu, 19 Feb 2015 23:43:15 +0100 Message-Id: <1424385796-28910-2-git-send-email-adrien+dev@schischi.me> X-Mailer: git-send-email 2.2.1 In-Reply-To: <1424385796-28910-1-git-send-email-adrien+dev@schischi.me> References: <1424385796-28910-1-git-send-email-adrien+dev@schischi.me> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1908 Lines: 58 Prepend the log level at the message following a newline. It is not possible to use pr_cont after a newline, the log level will be reseted. Signed-off-by: Adrien Schildknecht --- arch/x86/kernel/dumpstack_32.c | 9 ++++++--- arch/x86/kernel/dumpstack_64.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 5abd4cd..efff5ed 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c @@ -108,9 +108,12 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, for (i = 0; i < kstack_depth_to_print; i++) { if (kstack_end(stack)) break; - if (i && ((i % STACKSLOTS_PER_LINE) == 0)) - pr_cont("\n"); - pr_cont(" %08lx", *stack++); + if ((i % STACKSLOTS_PER_LINE) == 0) { + if (i != 0) + pr_cont("\n"); + printk("%s %08lx", log_lvl, *stack++); + } else + pr_cont(" %08lx", *stack++); touch_nmi_watchdog(); } pr_cont("\n"); diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index ff86f19..553573b 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c @@ -283,9 +283,12 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs, if (((long) stack & (THREAD_SIZE-1)) == 0) break; } - if (i && ((i % STACKSLOTS_PER_LINE) == 0)) - pr_cont("\n"); - pr_cont(" %016lx", *stack++); + if ((i % STACKSLOTS_PER_LINE) == 0) { + if (i != 0) + pr_cont("\n"); + printk("%s %016lx", log_lvl, *stack++); + } else + pr_cont(" %016lx", *stack++); touch_nmi_watchdog(); } preempt_enable(); -- 2.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/