print kdump kernel loaded status in stack dump
authorDave Young <dyoung@redhat.com>
Sat, 27 Jan 2018 04:11:29 +0000 (12:11 +0800)
committerPetr Mladek <pmladek@suse.com>
Thu, 8 Feb 2018 13:47:25 +0000 (14:47 +0100)
It is useful to print kdump kernel loaded status in dump_stack()
especially when panic happens so that we can differenciate
kdump kernel early hang and a normal panic in a bug report.

Link: http://lkml.kernel.org/r/20180127041129.GA29016@dhcp-128-65.nay.redhat.com
To: Steven Rostedt <rostedt@goodmis.org>
To: Andi Kleen <ak@linux.intel.com>
To: kexec@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org
Cc: kexec@lists.infradead.org
Signed-off-by: Dave Young <dyoung@redhat.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/printk.c

index db4b9b8..fa3de5f 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/sched/clock.h>
 #include <linux/sched/debug.h>
 #include <linux/sched/task_stack.h>
+#include <linux/kexec.h>
 
 #include <linux/uaccess.h>
 #include <asm/sections.h>
@@ -3287,9 +3288,11 @@ void __init dump_stack_set_arch_desc(const char *fmt, ...)
  */
 void dump_stack_print_info(const char *log_lvl)
 {
-       printk("%sCPU: %d PID: %d Comm: %.20s %s %s %.*s\n",
+       printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s\n",
               log_lvl, raw_smp_processor_id(), current->pid, current->comm,
-              print_tainted(), init_utsname()->release,
+              kexec_crash_loaded() ? "Kdump: loaded " : "",
+              print_tainted(),
+              init_utsname()->release,
               (int)strcspn(init_utsname()->version, " "),
               init_utsname()->version);