2 * linux/include/kmsg_dump.h
4 * Copyright (C) 2009 Net Insight AB
6 * Author: Simon Kagstrom <simon.kagstrom@netinsight.net>
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive
12 #ifndef _LINUX_KMSG_DUMP_H
13 #define _LINUX_KMSG_DUMP_H
15 #include <linux/errno.h>
16 #include <linux/list.h>
19 * Keep this list arranged in rough order of priority. Anything listed after
20 * KMSG_DUMP_OOPS will not be logged by default unless printk.always_kmsg_dump
21 * is passed to the kernel.
23 enum kmsg_dump_reason
{
33 * struct kmsg_dumper - kernel crash message dumper structure
34 * @dump: The callback which gets called on crashes. The buffer is passed
35 * as two sections, where s1 (length l1) contains the older
36 * messages and s2 (length l2) contains the newer.
37 * @list: Entry in the dumper list (private)
38 * @registered: Flag that specifies if this is already registered
41 void (*dump
)(struct kmsg_dumper
*dumper
, enum kmsg_dump_reason reason
,
42 const char *s1
, unsigned long l1
,
43 const char *s2
, unsigned long l2
);
44 struct list_head list
;
49 void kmsg_dump(enum kmsg_dump_reason reason
);
51 int kmsg_dump_register(struct kmsg_dumper
*dumper
);
53 int kmsg_dump_unregister(struct kmsg_dumper
*dumper
);
55 static inline void kmsg_dump(enum kmsg_dump_reason reason
)
59 static inline int kmsg_dump_register(struct kmsg_dumper
*dumper
)
64 static inline int kmsg_dump_unregister(struct kmsg_dumper
*dumper
)
70 #endif /* _LINUX_KMSG_DUMP_H */