diff options
author | Hariprasad Nellitheertha <hari@in.ibm.com> | 2005-06-25 17:58:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:54 -0400 |
commit | 86b1ae38c0a62409dc862a28e3f08920f55f944b (patch) | |
tree | de7e2803949d9585d6d5554cbad9063d5d62f2cc /drivers/char/sysrq.c | |
parent | 315c215c0a7324894541d43b0e720f20cafca92e (diff) |
[PATCH] kdump: sysrq trigger mechanism for kexec based crashdumps
Add a sysrq-trigger mechanism for kexec based crashdumps. Alt-Sysrq-c
triggers a kexec based crashdump.
Signed-off-by: Hariprasad Nellitheertha <hari@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/sysrq.c')
-rw-r--r-- | drivers/char/sysrq.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index f59f7cbd525b..53b2c8fab00e 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/spinlock.h> | 35 | #include <linux/spinlock.h> |
36 | #include <linux/vt_kern.h> | 36 | #include <linux/vt_kern.h> |
37 | #include <linux/workqueue.h> | 37 | #include <linux/workqueue.h> |
38 | #include <linux/kexec.h> | ||
38 | 39 | ||
39 | #include <asm/ptrace.h> | 40 | #include <asm/ptrace.h> |
40 | 41 | ||
@@ -94,6 +95,21 @@ static struct sysrq_key_op sysrq_unraw_op = { | |||
94 | }; | 95 | }; |
95 | #endif /* CONFIG_VT */ | 96 | #endif /* CONFIG_VT */ |
96 | 97 | ||
98 | #ifdef CONFIG_KEXEC | ||
99 | /* crashdump sysrq handler */ | ||
100 | static void sysrq_handle_crashdump(int key, struct pt_regs *pt_regs, | ||
101 | struct tty_struct *tty) | ||
102 | { | ||
103 | crash_kexec(); | ||
104 | } | ||
105 | static struct sysrq_key_op sysrq_crashdump_op = { | ||
106 | .handler = sysrq_handle_crashdump, | ||
107 | .help_msg = "Crashdump", | ||
108 | .action_msg = "Trigger a crashdump", | ||
109 | .enable_mask = SYSRQ_ENABLE_DUMP, | ||
110 | }; | ||
111 | #endif | ||
112 | |||
97 | /* reboot sysrq handler */ | 113 | /* reboot sysrq handler */ |
98 | static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs, | 114 | static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs, |
99 | struct tty_struct *tty) | 115 | struct tty_struct *tty) |
@@ -273,8 +289,12 @@ static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = { | |||
273 | it is handled specially on the sparc | 289 | it is handled specially on the sparc |
274 | and will never arrive */ | 290 | and will never arrive */ |
275 | /* b */ &sysrq_reboot_op, | 291 | /* b */ &sysrq_reboot_op, |
276 | /* c */ NULL, | 292 | #ifdef CONFIG_KEXEC |
277 | /* d */ NULL, | 293 | /* c */ &sysrq_crashdump_op, |
294 | #else | ||
295 | /* c */ NULL, | ||
296 | #endif | ||
297 | /* d */ NULL, | ||
278 | /* e */ &sysrq_term_op, | 298 | /* e */ &sysrq_term_op, |
279 | /* f */ &sysrq_moom_op, | 299 | /* f */ &sysrq_moom_op, |
280 | /* g */ NULL, | 300 | /* g */ NULL, |