aboutsummaryrefslogtreecommitdiff
path: root/include/linux/kmsg_dump.h
AgeCommit message (Collapse)AuthorFilesLines
2012-03-05kmsg_dump: don't run on non-error paths by defaultMatthew Garrett1-2/+7
Since commit 04c6862c055f ("kmsg_dump: add kmsg_dump() calls to the reboot, halt, poweroff and emergency_restart paths"), kmsg_dump() gets run on normal paths including poweroff and reboot. This is less than ideal given pstore implementations that can only represent single backtraces, since a reboot may overwrite a stored oops before it's been picked up by userspace. In addition, some pstore backends may have low performance and provide a significant delay in reboot as a result. This patch adds a printk.always_kmsg_dump kernel parameter (which can also be changed from userspace). Without it, the code will only be run on failure paths rather than on normal paths. The option can be enabled in environments where there's a desire to attempt to audit whether or not a reboot was cleanly requested or not. Signed-off-by: Matthew Garrett <[email protected]> Acked-by: Seiji Aguchi <[email protected]> Cc: Seiji Aguchi <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Marco Stornelli <[email protected]> Cc: Artem Bityutskiy <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Vivek Goyal <[email protected]> Cc: Don Zickus <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-01-12kexec: remove KMSG_DUMP_KEXECWANG Cong1-1/+0
KMSG_DUMP_KEXEC is useless because we already save kernel messages inside /proc/vmcore, and it is unsafe to allow modules to do other stuffs in a crash dump scenario. [[email protected]: fix powerpc build] Signed-off-by: WANG Cong <[email protected]> Reported-by: Vivek Goyal <[email protected]> Acked-by: Vivek Goyal <[email protected]> Acked-by: Jarod Wilson <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-06-15kmsg_dump.h: fix build when CONFIG_PRINTK is disabledRandy Dunlap1-0/+1
Fix <linux/kmsg_dump.h> when CONFIG_PRINTK is not enabled: include/linux/kmsg_dump.h:56: error: 'EINVAL' undeclared (first use in this function) include/linux/kmsg_dump.h:61: error: 'EINVAL' undeclared (first use in this function) Looks like commit 595dd3d8bf95 ("kmsg_dump: fix build for CONFIG_PRINTK=n") uses EINVAL without having the needed header file(s), but I'm sure that I build tested that patch also. oh well. Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-01-13kmsg_dump: add kmsg_dump() calls to the reboot, halt, poweroff and ↵Seiji Aguchi1-0/+4
emergency_restart paths We need to know the reason why system rebooted in support service. However, we can't inform our customers of the reason because final messages are lost on current Linux kernel. This patch improves the situation above because the final messages are saved by adding kmsg_dump() to reboot, halt, poweroff and emergency_restart path. Signed-off-by: Seiji Aguchi <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Marco Stornelli <[email protected]> Reviewed-by: Artem Bityutskiy <[email protected]> Reviewed-by: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-12-31kmsg_dump: Dump on crash_kexec as wellKOSAKI Motohiro1-0/+1
crash_kexec gets called before kmsg_dump(KMSG_DUMP_OOPS) if panic_on_oops is set, so the kernel log buffer is not stored for this case. This patch adds a KMSG_DUMP_KEXEC dump type which gets called when crash_kexec() is invoked. To avoid getting double dumps, the old KMSG_DUMP_PANIC is moved below crash_kexec(). The mtdoops driver is modified to handle KMSG_DUMP_KEXEC in the same way as a panic. Signed-off-by: KOSAKI Motohiro <[email protected]> Acked-by: Simon Kagstrom <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2009-12-02kmsg_dump: fix build for CONFIG_PRINTK=nRandy Dunlap1-0/+16
kmsg_dump() fails to build when CONFIG_PRINTK=n; provide stubs for the kmsg_dump*() functions when CONFIG_PRINTK=n. kernel/printk.c: In function 'kmsg_dump': kernel/printk.c:1501: error: 'log_buf_len' undeclared (first use in this function) kernel/printk.c:1502: error: 'logged_chars' undeclared (first use in this function) kernel/printk.c:1506: error: 'log_buf' undeclared (first use in this function) Signed-off-by: Randy Dunlap <[email protected]> Acked-by: Simon Kagstrom <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
2009-11-30core: Add kernel message dumper to call on oopses and panicsSimon Kagstrom1-0/+44
The core functionality is implemented as per Linus suggestion from http://lists.infradead.org/pipermail/linux-mtd/2009-October/027620.html (with the kmsg_dump implementation by Linus). A struct kmsg_dumper has been added which contains a callback to dump the kernel log buffers on crashes. The kmsg_dump function gets called from oops_exit() and panic() and invokes this callbacks with the crash reason. [dwmw2: Fix log_end handling] Signed-off-by: Simon Kagstrom <[email protected]> Reviewed-by: Anders Grafstrom <[email protected]> Reviewed-by: Linus Torvalds <[email protected]> Acked-by: Ingo Molnar <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]>