lkml.org 
[lkml]   [2015]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] x86: fix output of show_stack_log_lvl()

* Adrien Schildknecht <adrien+dev@schischi.me> wrote:

> show_stack_log_lvl() does not set the log level after a new line,
> the following messages printed with pr_cont are thus assigned to the
> default log level.
> This patch prepends the log level to the next message following a new
> line.
>
> print_trace_address() uses printk(log_lvl). Using printk with just
> a log level is ignored and thus has no effect on the next pr_cont.
> We need to prepend the log level directly into the message.

This approach looks good to me, we want to print multi-line
messages with the same consistent loglevel.

Totally unrelated observation:

> +++ b/arch/x86/kernel/dumpstack.c

> touch_nmi_watchdog();
> + printk_stack_address(addr, reliable, data);

The whole code is sprinkled with touch_nmi_watchdog()
calls. Shouldn't we simply make it a rule that if a printk
message makes it to a real console (as opposed to the log
buffer only), it should imply a touch_nmi_watchdog()?

Then all of those crappy touch_nmi_watchdog() calls could
be removed here and in other places where long printk
streams may happen.

Totally unrelated observation #2:

> if (kstack_end(stack))
> break;
> - if (i && ((i % STACKSLOTS_PER_LINE) == 0))
> - pr_cont("\n");

> +++ b/arch/x86/kernel/dumpstack_64.c

> if (((long) stack & (THREAD_SIZE-1)) == 0)
> break;
> }
> - if (i && ((i % STACKSLOTS_PER_LINE) == 0))
> - pr_cont("\n");

Looks like kstack_end() could be defined on 64-bit as well,
unifying the stack printing logic some more?

( I'd no go so far as to unify the two functions, but the
closer to each other the better it is to make changes
that affect both of them. )

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-02-20 09:21    [W:0.115 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site