From: Nishanth Menon Date: Wed, 17 Aug 2011 23:31:58 +0000 (-0500) Subject: panic: Add board ID to panic output X-Git-Tag: firefly_0821_release~7613^2~343 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=efcf89c8eb62b7c0c5976cb94f892c891afea199;p=firefly-linux-kernel-4.4.55.git panic: Add board ID to panic output At times, it is necessary for boards to provide some additional information as part of panic logs. Provide information on the board hardware as part of panic logs. It is safer to print this information at the very end in case something bad happens as part of the information retrieval itself. To use this, set global mach_panic_string to an appropriate string in the board file. Change-Id: Id12cdda87b0cd2940dd01d52db97e6162f671b4d Signed-off-by: Nishanth Menon --- diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 953352a88336..47e8dbea85c8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -736,4 +736,7 @@ extern int __build_bug_on_failed; # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD #endif +/* To identify board information in panic logs, set this */ +extern char *mach_panic_string; + #endif diff --git a/kernel/panic.c b/kernel/panic.c index 5578d0adc275..a136da2f3968 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -27,6 +27,9 @@ #define PANIC_TIMER_STEP 100 #define PANIC_BLINK_SPD 18 +/* Machine specific panic information string */ +char *mach_panic_string; + int panic_on_oops; static unsigned long tainted_mask; static int pause_on_oops; @@ -345,6 +348,11 @@ late_initcall(init_oops_id); void print_oops_end_marker(void) { init_oops_id(); + + if (mach_panic_string) + printk(KERN_WARNING "Board Information: %s\n", + mach_panic_string); + printk(KERN_WARNING "---[ end trace %016llx ]---\n", (unsigned long long)oops_id); }