diff options
author | Nishanth Menon <nm@ti.com> | 2011-09-20 18:52:28 -0700 |
---|---|---|
committer | Praneeth Bajjuri <praneeth@ti.com> | 2011-09-20 18:53:25 -0700 |
commit | 27ef729bc02a6c282598c8068c7ae00a211376ef (patch) | |
tree | 0ec332b04f0e3b827bd92753f8f7c9d8fb630339 | |
parent | 9b408c50514e7d47eae35da2c7f91165eadc08f5 (diff) | |
download | linux-linaro-27ef729bc02a6c282598c8068c7ae00a211376ef.tar.gz |
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 <nm@ti.com>
-rw-r--r-- | include/linux/kernel.h | 3 | ||||
-rw-r--r-- | kernel/panic.c | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 46ac9a50528..54bf5a471e1 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -744,4 +744,7 @@ struct sysinfo { char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ }; +/* 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 4d36e8f5a57..e5214cab749 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; @@ -348,6 +351,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); } |