mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] um: use KERN_CONT in stack dump
@ 2017-03-12  9:38 Vegard Nossum
  2017-03-12  9:45 ` Richard Weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: Vegard Nossum @ 2017-03-12  9:38 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: user-mode-linux-devel, linux-kernel, 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 <vegard.nossum@oracle.com>
---
 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");
 }
 
-- 
2.12.0.rc0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] um: use KERN_CONT in stack dump
  2017-03-12  9:38 [PATCH] um: use KERN_CONT in stack dump Vegard Nossum
@ 2017-03-12  9:45 ` Richard Weinberger
  2017-03-12  9:47   ` Vegard Nossum
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Weinberger @ 2017-03-12  9:45 UTC (permalink / raw)
  To: Vegard Nossum; +Cc: user-mode-linux-devel, linux-kernel

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 <vegard.nossum@oracle.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] um: use KERN_CONT in stack dump
  2017-03-12  9:45 ` Richard Weinberger
@ 2017-03-12  9:47   ` Vegard Nossum
  2017-04-11  9:36     ` Vegard Nossum
  0 siblings, 1 reply; 4+ messages in thread
From: Vegard Nossum @ 2017-03-12  9:47 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: user-mode-linux-devel, linux-kernel

On 12/03/2017 10:45, Richard Weinberger wrote:
> 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:
[snip]
> 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);
>  }

Your patch is better.

Tested-by: Vegard Nossum <vegard.nossum@oracle.com>

Thanks,


Vegard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] um: use KERN_CONT in stack dump
  2017-03-12  9:47   ` Vegard Nossum
@ 2017-04-11  9:36     ` Vegard Nossum
  0 siblings, 0 replies; 4+ messages in thread
From: Vegard Nossum @ 2017-04-11  9:36 UTC (permalink / raw)
  To: Vegard Nossum; +Cc: Richard Weinberger, user-mode-linux-devel, LKML

On 12 March 2017 at 10:47, Vegard Nossum <vegard.nossum@oracle.com> wrote:
> On 12/03/2017 10:45, Richard Weinberger wrote:
>> 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);
>>  }
>
> Tested-by: Vegard Nossum <vegard.nossum@oracle.com>

Just a heads up, this still appears unfixed in Linus's repo.


Vegard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-11  9:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-12  9:38 [PATCH] um: use KERN_CONT in stack dump Vegard Nossum
2017-03-12  9:45 ` Richard Weinberger
2017-03-12  9:47   ` Vegard Nossum
2017-04-11  9:36     ` Vegard Nossum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®