printk: Introduce kmsg_dump_reason_str()
The pstore subsystem already had a private version of this function. With the coming addition of the pstore/zone driver, this needs to be shared. As it really should live with printk, move it there instead. Link: https://lore.kernel.org/lkml/20200515184434.8470-4-keescook@chromium.org/ Acked-by: Petr Mladek <pmladek@suse.com> Acked-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com> Signed-off-by: Kees Cook <keescook@chromium.org>
Este commit está contenido en:
@@ -3144,6 +3144,23 @@ EXPORT_SYMBOL_GPL(kmsg_dump_unregister);
|
||||
static bool always_kmsg_dump;
|
||||
module_param_named(always_kmsg_dump, always_kmsg_dump, bool, S_IRUGO | S_IWUSR);
|
||||
|
||||
const char *kmsg_dump_reason_str(enum kmsg_dump_reason reason)
|
||||
{
|
||||
switch (reason) {
|
||||
case KMSG_DUMP_PANIC:
|
||||
return "Panic";
|
||||
case KMSG_DUMP_OOPS:
|
||||
return "Oops";
|
||||
case KMSG_DUMP_EMERG:
|
||||
return "Emergency";
|
||||
case KMSG_DUMP_SHUTDOWN:
|
||||
return "Shutdown";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kmsg_dump_reason_str);
|
||||
|
||||
/**
|
||||
* kmsg_dump - dump kernel log to kernel message dumpers.
|
||||
* @reason: the reason (oops, panic etc) for dumping
|
||||
|
Referencia en una nueva incidencia
Block a user