summaryrefslogtreecommitdiff
path: root/include/linux/kmsg_dump.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2020-05-07 19:36:22 -0700
committerKees Cook <keescook@chromium.org>2020-05-30 10:34:03 -0700
commitfb13cb8a0482105a415e24042209d02a684255e2 (patch)
tree8cc5c83aea2f8c4b2676b0075e0d8200b02b8da3 /include/linux/kmsg_dump.h
parentb1f6f161b236d0e5a9222fb8b482e65aaff13689 (diff)
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>
Diffstat (limited to 'include/linux/kmsg_dump.h')
-rw-r--r--include/linux/kmsg_dump.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h
index 9826014771ab..3378bcbe585e 100644
--- a/include/linux/kmsg_dump.h
+++ b/include/linux/kmsg_dump.h
@@ -70,6 +70,8 @@ void kmsg_dump_rewind(struct kmsg_dumper *dumper);
int kmsg_dump_register(struct kmsg_dumper *dumper);
int kmsg_dump_unregister(struct kmsg_dumper *dumper);
+
+const char *kmsg_dump_reason_str(enum kmsg_dump_reason reason);
#else
static inline void kmsg_dump(enum kmsg_dump_reason reason)
{
@@ -111,6 +113,11 @@ static inline int kmsg_dump_unregister(struct kmsg_dumper *dumper)
{
return -EINVAL;
}
+
+static inline const char *kmsg_dump_reason_str(enum kmsg_dump_reason reason)
+{
+ return "Disabled";
+}
#endif
#endif /* _LINUX_KMSG_DUMP_H */