lkml.org 
[lkml]   [2019]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] xtensa: improve stack dumping
From
Date
On Wed, 2019-11-06 at 10:16 -0800, Max Filippov wrote:
> Collect whole stack dump lines in a buffer and print the whole buffer
> when it's ready with pr_info instead of pr_cont. This makes stack dump
> lines consistent in SMP case and relies less on pr_cont/printk
> differences related to timestamps.
> Make size of stack dump configurable.
> Drop extra newline output in show_trace as its output format does not
> depend on CONFIG_KALLSYMS.
[]
> diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
[]
> @@ -512,10 +510,12 @@ void show_stack(struct task_struct *task, unsigned long *sp)
> for (i = 0; i < kstack_depth_to_print; i++) {
> if (kstack_end(sp))
> break;
> - pr_cont(" %08lx", *sp++);
> + sprintf(buf + (i % 8) * 9, " %08lx", *sp++);
> if (i % 8 == 7)
> - pr_cont("\n");
> + pr_info("%s\n", buf);
> }
> + if (i % 8)
> + pr_info("%s\n", buf);

Could this be done using hex_dump_to_buffer
by precalculating kstack_end ?


\
 
 \ /
  Last update: 2019-11-06 23:34    [W:0.611 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site