XenevaOS
Loading...
Searching...
No Matches
kmsg_dump.h
Go to the documentation of this file.
1/*
2 * linux/include/kmsg_dump.h
3 *
4 * Copyright (C) 2009 Net Insight AB
5 *
6 * Author: Simon Kagstrom <simon.kagstrom@netinsight.net>
7 *
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
10 * for more details.
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
18/*
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.
22 */
31
41
52
63 void (*dump)(struct kmsg_dumper *dumper, struct kmsg_dump_detail *detail);
66};
67
68#ifdef CONFIG_PRINTK
69void kmsg_dump_desc(enum kmsg_dump_reason reason, const char *desc);
70
71bool kmsg_dump_get_line(struct kmsg_dump_iter *iter, bool syslog,
72 char *line, size_t size, size_t *len);
73
74bool kmsg_dump_get_buffer(struct kmsg_dump_iter *iter, bool syslog,
75 char *buf, size_t size, size_t *len_out);
76
77void kmsg_dump_rewind(struct kmsg_dump_iter *iter);
78
79int kmsg_dump_register(struct kmsg_dumper *dumper);
80
81int kmsg_dump_unregister(struct kmsg_dumper *dumper);
82
83const char *kmsg_dump_reason_str(enum kmsg_dump_reason reason);
84#else
85static inline void kmsg_dump_desc(enum kmsg_dump_reason reason, const char *desc)
86{
87}
88
89static inline bool kmsg_dump_get_line(struct kmsg_dump_iter *iter, bool syslog,
90 const char *line, size_t size, size_t *len)
91{
92 return false;
93}
94
95static inline bool kmsg_dump_get_buffer(struct kmsg_dump_iter *iter, bool syslog,
96 char *buf, size_t size, size_t *len)
97{
98 return false;
99}
100
101static inline void kmsg_dump_rewind(struct kmsg_dump_iter *iter)
102{
103}
104
105static inline int kmsg_dump_register(struct kmsg_dumper *dumper)
106{
107 return -EINVAL;
108}
109
110static inline int kmsg_dump_unregister(struct kmsg_dumper *dumper)
111{
112 return -EINVAL;
113}
114
115static inline const char *kmsg_dump_reason_str(enum kmsg_dump_reason reason)
116{
117 return "Disabled";
118}
119#endif
120
121static inline void kmsg_dump(enum kmsg_dump_reason reason)
122{
123 kmsg_dump_desc(reason, NULL);
124}
125
126#endif /* _LINUX_KMSG_DUMP_H */
#define EINVAL
Definition acclib.h:198
#define NULL
Definition actypes.h:561
size_t size
Definition drm_bridge.h:1299
size_t len
Definition initial.c:23
kmsg_dump_reason
Definition kmsg_dump.h:23
@ KMSG_DUMP_SHUTDOWN
Definition kmsg_dump.h:28
@ KMSG_DUMP_PANIC
Definition kmsg_dump.h:25
@ KMSG_DUMP_MAX
Definition kmsg_dump.h:29
@ KMSG_DUMP_UNDEF
Definition kmsg_dump.h:24
@ KMSG_DUMP_OOPS
Definition kmsg_dump.h:26
@ KMSG_DUMP_EMERG
Definition kmsg_dump.h:27
uint64_t u64
Definition kernel.h:17
@ detail
Definition m_menu.c:335
Definition kmsg_dump.h:48
const char * description
Definition kmsg_dump.h:50
enum kmsg_dump_reason reason
Definition kmsg_dump.h:49
Definition kmsg_dump.h:37
u64 cur_seq
Definition kmsg_dump.h:38
u64 next_seq
Definition kmsg_dump.h:39
Definition kmsg_dump.h:61
bool registered
Definition kmsg_dump.h:65
void(* dump)(struct kmsg_dumper *dumper, struct kmsg_dump_detail *detail)
Definition kmsg_dump.h:63
enum kmsg_dump_reason max_reason
Definition kmsg_dump.h:64
struct list_head list
Definition kmsg_dump.h:62
Definition list.h:11