2 * allow user mode linux kernels dump core on kernel panics,
3 * for later analysis of the crash.
5 * (c) 2004 Gerd Knorr + D. Bahi
7 #include <linux/kernel.h>
8 #include <linux/init.h>
9 #include <linux/notifier.h>
14 static int core_on_panic_func(struct notifier_block *self, unsigned long unused1,
17 static int recurse = 0;
19 /* cleanup so we have less to cleanup [linux] on the host */
20 /* could panic in uml_cleanup though so we need a check */
24 /* to prevent keyboard from causing terminal to spew during dump */
27 /* actually dump ... */
34 static struct notifier_block core_on_panic_notifier = {
35 .notifier_call = core_on_panic_func,
39 static int core_on_panic = 0;
41 static int __init core_on_panic_setup(char *str)
47 static int __init core_on_panic_init(void)
50 notifier_chain_register(&panic_notifier_list, &core_on_panic_notifier);
54 __initcall(core_on_panic_init);
55 __setup("coreonpanic", core_on_panic_setup);
56 __uml_help(core_on_panic_setup,
58 " This flag make it so that UML will dump core on a kernel panic or segfault.\n"
59 " Shell environment restrictions on cores (limit or ulimit) still apply.\n"
61 " Beware that your UML will not reboot with this flag.\n"