panic: Call console_verbose in panic
PATCH 1/1 panic: Call console_verbose in panic
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.
---
kernel/panic.c +1 -0
@@ -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);
Quoted 11 lines · Anton Blanchard
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_verboselike we do in the oops path to ensure a directly called panic will print a backtrace.Signed-off-by Anton Blanchard <[email protected]>
Looks good to me:
thanks,
greg k-h
Quoted 18 lines · On Tue, 11 May 2010 08:59:59 +1000 Anton Blanchard <[email protected]> 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_verboselike we do in the oops path to ensure a directly called panic will print a backtrace.Signed-off-by Anton Blanchard <[email protected]>---
Index:
linux-2.6/kernel/panic.c
===================================================================
kernel/panic.c NORET_TYPE void panic(const char * fmt, · line 93
Quoted 7 lines
kernel/panic.c +1
-0@@ -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?
Quoted 3 lines · Andrew Morton
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