core: Add kernel message dumper to call on oopses and panics
authorSimon Kagstrom <simon.kagstrom@netinsight.net>
Fri, 16 Oct 2009 12:09:18 +0000 (14:09 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 30 Nov 2009 12:01:49 +0000 (12:01 +0000)
commit456b565cc52fbcdaa2e19ffdf40d9dd3b726d603
treec73029f31756289ed54183e97e0613f87cef6ed5
parent7cb777a3d71f9d1f7eb149c7a504d21f24219ae8
core: Add kernel message dumper to call on oopses and panics

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 <simon.kagstrom@netinsight.net>
Reviewed-by: Anders Grafstrom <anders.grafstrom@netinsight.net>
Reviewed-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
include/linux/kmsg_dump.h [new file with mode: 0644]
kernel/panic.c
kernel/printk.c