1
2
3
4
5
6
7
8
9
10
11
12#ifndef _LINUX_KMSG_DUMP_H
13#define _LINUX_KMSG_DUMP_H
14
15#include <linux/errno.h>
16#include <linux/list.h>
17
18enum kmsg_dump_reason {
19 KMSG_DUMP_OOPS,
20 KMSG_DUMP_PANIC,
21 KMSG_DUMP_KEXEC,
22 KMSG_DUMP_RESTART,
23 KMSG_DUMP_HALT,
24 KMSG_DUMP_POWEROFF,
25 KMSG_DUMP_EMERG,
26};
27
28
29
30
31
32
33
34
35
36struct kmsg_dumper {
37 void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason,
38 const char *s1, unsigned long l1,
39 const char *s2, unsigned long l2);
40 struct list_head list;
41 int registered;
42};
43
44#ifdef CONFIG_PRINTK
45void kmsg_dump(enum kmsg_dump_reason reason);
46
47int kmsg_dump_register(struct kmsg_dumper *dumper);
48
49int kmsg_dump_unregister(struct kmsg_dumper *dumper);
50#else
51static inline void kmsg_dump(enum kmsg_dump_reason reason)
52{
53}
54
55static inline int kmsg_dump_register(struct kmsg_dumper *dumper)
56{
57 return -EINVAL;
58}
59
60static inline int kmsg_dump_unregister(struct kmsg_dumper *dumper)
61{
62 return -EINVAL;
63}
64#endif
65
66#endif
67