diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/panic.c | 2 | ||||
-rw-r--r-- | kernel/printk/printk.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index f861bedc1925..32b1c1c93b7a 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -376,7 +376,7 @@ void panic(const char *fmt, ...) panic_print_sys_info(false); - kmsg_dump(KMSG_DUMP_PANIC); + kmsg_dump_desc(KMSG_DUMP_PANIC, buf); /* * If you doubt kdump always works fine in any situation, diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 054c0e7784fd..041a0f76688d 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -4184,16 +4184,21 @@ const char *kmsg_dump_reason_str(enum kmsg_dump_reason reason) EXPORT_SYMBOL_GPL(kmsg_dump_reason_str); /** - * kmsg_dump - dump kernel log to kernel message dumpers. + * kmsg_dump_desc - dump kernel log to kernel message dumpers. * @reason: the reason (oops, panic etc) for dumping + * @desc: a short string to describe what caused the panic or oops. Can be NULL + * if no additional description is available. * * Call each of the registered dumper's dump() callback, which can * retrieve the kmsg records with kmsg_dump_get_line() or * kmsg_dump_get_buffer(). */ -void kmsg_dump(enum kmsg_dump_reason reason) +void kmsg_dump_desc(enum kmsg_dump_reason reason, const char *desc) { struct kmsg_dumper *dumper; + struct kmsg_dump_detail detail = { + .reason = reason, + .description = desc}; rcu_read_lock(); list_for_each_entry_rcu(dumper, &dump_list, list) { @@ -4211,7 +4216,7 @@ void kmsg_dump(enum kmsg_dump_reason reason) continue; /* invoke dumper which will iterate over records */ - dumper->dump(dumper, reason); + dumper->dump(dumper, &detail); } rcu_read_unlock(); } |