* [PATCH] panic: Call console_verbose in panic
@ 2010-05-10 22:59 Anton Blanchard
2010-05-10 23:10 ` Greg KH
2010-05-12 23:39 ` Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Anton Blanchard @ 2010-05-10 22:59 UTC (permalink / raw)
To: akpm, gregkh; +Cc: linux-kernel
Most distros turn the console verbosity down and that means a backtrace after
a panic never makes it to the console. I assume we haven't seen this because
a panic is often preceeded by an oops which will have called console_verbose.
There are however a lot of places we call panic directly, and they are
broken.
Use console_verbose like we do in the oops path to ensure a directly called
panic will print a backtrace.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-2.6/kernel/panic.c
===================================================================
--- linux-2.6.orig/kernel/panic.c 2010-05-09 09:13:06.000000000 +1000
+++ linux-2.6/kernel/panic.c 2010-05-09 09:14:13.000000000 +1000
@@ -87,6 +87,7 @@ NORET_TYPE void panic(const char * fmt,
*/
preempt_disable();
+ console_verbose();
bust_spinlocks(1);
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] panic: Call console_verbose in panic
2010-05-10 22:59 [PATCH] panic: Call console_verbose in panic Anton Blanchard
@ 2010-05-10 23:10 ` Greg KH
2010-05-12 23:39 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2010-05-10 23:10 UTC (permalink / raw)
To: Anton Blanchard; +Cc: akpm, linux-kernel
On Tue, May 11, 2010 at 08:59:59AM +1000, Anton Blanchard wrote:
>
> Most distros turn the console verbosity down and that means a backtrace after
> a panic never makes it to the console. I assume we haven't seen this because
> a panic is often preceeded by an oops which will have called console_verbose.
> There are however a lot of places we call panic directly, and they are
> broken.
>
> Use console_verbose like we do in the oops path to ensure a directly called
> panic will print a backtrace.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Looks good to me:
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] panic: Call console_verbose in panic
2010-05-10 22:59 [PATCH] panic: Call console_verbose in panic Anton Blanchard
2010-05-10 23:10 ` Greg KH
@ 2010-05-12 23:39 ` Andrew Morton
2010-05-13 10:00 ` David Howells
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2010-05-12 23:39 UTC (permalink / raw)
To: Anton Blanchard; +Cc: gregkh, linux-kernel, David Howells
On Tue, 11 May 2010 08:59:59 +1000
Anton Blanchard <anton@samba.org> wrote:
>
> Most distros turn the console verbosity down and that means a backtrace after
> a panic never makes it to the console. I assume we haven't seen this because
> a panic is often preceeded by an oops which will have called console_verbose.
> There are however a lot of places we call panic directly, and they are
> broken.
>
> Use console_verbose like we do in the oops path to ensure a directly called
> panic will print a backtrace.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: linux-2.6/kernel/panic.c
> ===================================================================
> --- linux-2.6.orig/kernel/panic.c 2010-05-09 09:13:06.000000000 +1000
> +++ linux-2.6/kernel/panic.c 2010-05-09 09:14:13.000000000 +1000
> @@ -87,6 +87,7 @@ NORET_TYPE void panic(const char * fmt,
> */
> preempt_disable();
>
> + console_verbose();
> bust_spinlocks(1);
> va_start(args, fmt);
> vsnprintf(buf, sizeof(buf), fmt, args);
hm, console_verbose() is interesting:
: static inline void console_verbose(void)
: {
: if (console_loglevel)
: console_loglevel = 15;
: }
so if someone has run console_silent():
: static inline void console_silent(void)
: {
: console_loglevel = 0;
: }
then console_verbose() doesn't work.
The sole caller of console_silent() is
arch/mn10300/kernel/mn10300-watchdog.c:watchdog_interrupt(), which
makes me wonder if mn10300 is doing something wrong or outdated?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] panic: Call console_verbose in panic
2010-05-12 23:39 ` Andrew Morton
@ 2010-05-13 10:00 ` David Howells
0 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2010-05-13 10:00 UTC (permalink / raw)
To: Andrew Morton; +Cc: dhowells, Anton Blanchard, gregkh, linux-kernel
Andrew Morton <akpm@linux-foundation.org> wrote:
> The sole caller of console_silent() is
> arch/mn10300/kernel/mn10300-watchdog.c:watchdog_interrupt(), which
> makes me wonder if mn10300 is doing something wrong or outdated?
The MN10300 code will have been copied from elsewhere, so it may well be
outdated.
David
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-13 10:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10 22:59 [PATCH] panic: Call console_verbose in panic Anton Blanchard
2010-05-10 23:10 ` Greg KH
2010-05-12 23:39 ` Andrew Morton
2010-05-13 10:00 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).