diff options
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 2745dcdb6c6c..31b71a276b40 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -43,6 +43,8 @@ | |||
43 | #include <linux/kprobes.h> | 43 | #include <linux/kprobes.h> |
44 | #include <linux/user_namespace.h> | 44 | #include <linux/user_namespace.h> |
45 | 45 | ||
46 | #include <linux/kmsg_dump.h> | ||
47 | |||
46 | #include <asm/uaccess.h> | 48 | #include <asm/uaccess.h> |
47 | #include <asm/io.h> | 49 | #include <asm/io.h> |
48 | #include <asm/unistd.h> | 50 | #include <asm/unistd.h> |
@@ -285,6 +287,7 @@ out_unlock: | |||
285 | */ | 287 | */ |
286 | void emergency_restart(void) | 288 | void emergency_restart(void) |
287 | { | 289 | { |
290 | kmsg_dump(KMSG_DUMP_EMERG); | ||
288 | machine_emergency_restart(); | 291 | machine_emergency_restart(); |
289 | } | 292 | } |
290 | EXPORT_SYMBOL_GPL(emergency_restart); | 293 | EXPORT_SYMBOL_GPL(emergency_restart); |
@@ -312,6 +315,7 @@ void kernel_restart(char *cmd) | |||
312 | printk(KERN_EMERG "Restarting system.\n"); | 315 | printk(KERN_EMERG "Restarting system.\n"); |
313 | else | 316 | else |
314 | printk(KERN_EMERG "Restarting system with command '%s'.\n", cmd); | 317 | printk(KERN_EMERG "Restarting system with command '%s'.\n", cmd); |
318 | kmsg_dump(KMSG_DUMP_RESTART); | ||
315 | machine_restart(cmd); | 319 | machine_restart(cmd); |
316 | } | 320 | } |
317 | EXPORT_SYMBOL_GPL(kernel_restart); | 321 | EXPORT_SYMBOL_GPL(kernel_restart); |
@@ -333,6 +337,7 @@ void kernel_halt(void) | |||
333 | kernel_shutdown_prepare(SYSTEM_HALT); | 337 | kernel_shutdown_prepare(SYSTEM_HALT); |
334 | sysdev_shutdown(); | 338 | sysdev_shutdown(); |
335 | printk(KERN_EMERG "System halted.\n"); | 339 | printk(KERN_EMERG "System halted.\n"); |
340 | kmsg_dump(KMSG_DUMP_HALT); | ||
336 | machine_halt(); | 341 | machine_halt(); |
337 | } | 342 | } |
338 | 343 | ||
@@ -351,6 +356,7 @@ void kernel_power_off(void) | |||
351 | disable_nonboot_cpus(); | 356 | disable_nonboot_cpus(); |
352 | sysdev_shutdown(); | 357 | sysdev_shutdown(); |
353 | printk(KERN_EMERG "Power down.\n"); | 358 | printk(KERN_EMERG "Power down.\n"); |
359 | kmsg_dump(KMSG_DUMP_POWEROFF); | ||
354 | machine_power_off(); | 360 | machine_power_off(); |
355 | } | 361 | } |
356 | EXPORT_SYMBOL_GPL(kernel_power_off); | 362 | EXPORT_SYMBOL_GPL(kernel_power_off); |