Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932667AbdCLJpQ (ORCPT ); Sun, 12 Mar 2017 05:45:16 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44723 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754926AbdCLJpI (ORCPT ); Sun, 12 Mar 2017 05:45:08 -0400 Subject: Re: [PATCH] um: use KERN_CONT in stack dump To: Vegard Nossum References: <20170312093820.12044-1-vegard.nossum@oracle.com> Cc: user-mode-linux-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org From: Richard Weinberger Message-ID: Date: Sun, 12 Mar 2017 10:45:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170312093820.12044-1-vegard.nossum@oracle.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2126 Lines: 75 Vegard, Am 12.03.2017 um 10:38 schrieb Vegard Nossum: > Without KERN_CONT, the symbol will appear on a new line, making stack > traces completely unreadable: > > Call Trace: > [<6008e891>] ? > printk+0x0/0x94 > [<6001cce6>] > show_stack+0xfe/0x15b > [<600666ec>] ? > dump_stack_print_info+0xe1/0xea > [<6008e891>] ? > printk+0x0/0x94 > [<6023e826>] ? > bust_spinlocks+0x0/0x4f > [<602343b8>] > dump_stack+0x2a/0x2c > [<6008e662>] > panic+0x170/0x31e > [<6008e4f2>] ? > panic+0x0/0x31e > > This makes it readable again: > > Call Trace: > [<6008e891>] ? printk+0x0/0x94 > [<6001cce6>] show_stack+0xfe/0x15b > [<600666ec>] ? dump_stack_print_info+0xe1/0xea > [<6008e891>] ? printk+0x0/0x94 > [<6023e826>] ? bust_spinlocks+0x0/0x4f > [<602343b8>] dump_stack+0x2a/0x2c > [<6008e662>] panic+0x170/0x31e > > Signed-off-by: Vegard Nossum > --- > arch/um/kernel/sysrq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c > index a76295f7ede9..edf1f80123e7 100644 > --- a/arch/um/kernel/sysrq.c > +++ b/arch/um/kernel/sysrq.c > @@ -22,7 +22,7 @@ static void _print_addr(void *data, unsigned long address, int reliable) > { > pr_info(" [<%08lx>]", address); > pr_cont(" %s", reliable ? "" : "? "); > - print_symbol("%s", address); > + print_symbol(KERN_CONT "%s", address); > pr_cont("\n"); > } > I think it is better to fix the root of the problem by using a single printk. i.e. diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index aa1b56f5ac68..18eddf677ec6 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c @@ -17,10 +17,8 @@ static void _print_addr(void *data, unsigned long address, int reliable) { - pr_info(" [<%08lx>]", address); - pr_cont(" %s", reliable ? "" : "? "); - print_symbol("%s", address); - pr_cont("\n"); + pr_info(" [<%08lx>] %s%pB\n", address, reliable ? "" : "? ", + (void *)address); } Thanks, //richard