[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191106030542.868541-48-dima@arista.com>
Date: Wed, 6 Nov 2019 03:05:38 +0000
From: Dmitry Safonov <dima@...sta.com>
To: linux-kernel@...r.kernel.org
Cc: Dmitry Safonov <0x7f454c46@...il.com>,
Dmitry Safonov <dima@...sta.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>, Jiri Slaby <jslaby@...e.com>,
Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
Daniel Thompson <daniel.thompson@...aro.org>,
Douglas Anderson <dianders@...omium.org>,
Jason Wessel <jason.wessel@...driver.com>,
kgdb-bugreport@...ts.sourceforge.net
Subject: [PATCH 47/50] kdb: Don't play with console_loglevel
Print the stack trace with KERN_EMERG - it should be always visible.
Playing with console_loglevel is a bad idea as there may be more
messages printed than wanted. Also the stack trace might be not printed
at all if printk() was deferred and console_loglevel was raised back
before the trace got flushed.
Cc: Daniel Thompson <daniel.thompson@...aro.org>
Cc: Douglas Anderson <dianders@...omium.org>
Cc: Jason Wessel <jason.wessel@...driver.com>
Cc: kgdb-bugreport@...ts.sourceforge.net
Signed-off-by: Dmitry Safonov <dima@...sta.com>
---
kernel/debug/kdb/kdb_bt.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c
index 7e2379aa0a1e..5ce1fe082a38 100644
--- a/kernel/debug/kdb/kdb_bt.c
+++ b/kernel/debug/kdb/kdb_bt.c
@@ -21,22 +21,19 @@
static void kdb_show_stack(struct task_struct *p, void *addr)
{
- int old_lvl = console_loglevel;
- console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
kdb_trap_printk++;
kdb_set_current_task(p);
if (addr) {
- show_stack((struct task_struct *)p, addr);
+ show_stack_loglvl(p, addr, KERN_EMERG);
} else if (kdb_current_regs) {
#ifdef CONFIG_X86
- show_stack(p, &kdb_current_regs->sp);
+ show_stack_loglvl(p, &kdb_current_regs->sp, KERN_EMERG);
#else
- show_stack(p, NULL);
+ show_stack_loglvl(p, NULL, KERN_EMERG);
#endif
} else {
- show_stack(p, NULL);
+ show_stack_loglvl(p, NULL, KERN_EMERG);
}
- console_loglevel = old_lvl;
kdb_trap_printk--;
}
--
2.23.0
Powered by blists - more mailing lists