diff options
author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-07-20 20:28:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-21 13:34:00 -0400 |
commit | 533827c921c34310f63e859e1d6d0feec439657d (patch) | |
tree | 6aaba38b5604be6ad3e9f7aa40239b5c3f9444e1 /include/linux/kmsg_dump.h | |
parent | 1b499d05eecbe04969516717a8e15afb6ad80689 (diff) |
printk: Implement some unlocked kmsg_dump functions
If used from KDB, the locked variants are prone to deadlocks (suppose we
got to the debugger w/ the logbuf lock held).
So, we have to implement a few routines that grab no logbuf lock.
Yet we don't need these functions in modules, so we don't export them.
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kmsg_dump.h')
-rw-r--r-- | include/linux/kmsg_dump.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index d6bd50110ec2..2e7a1e032c71 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
@@ -55,12 +55,17 @@ struct kmsg_dumper { | |||
55 | #ifdef CONFIG_PRINTK | 55 | #ifdef CONFIG_PRINTK |
56 | void kmsg_dump(enum kmsg_dump_reason reason); | 56 | void kmsg_dump(enum kmsg_dump_reason reason); |
57 | 57 | ||
58 | bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, bool syslog, | ||
59 | char *line, size_t size, size_t *len); | ||
60 | |||
58 | bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, | 61 | bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, |
59 | char *line, size_t size, size_t *len); | 62 | char *line, size_t size, size_t *len); |
60 | 63 | ||
61 | bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | 64 | bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, |
62 | char *buf, size_t size, size_t *len); | 65 | char *buf, size_t size, size_t *len); |
63 | 66 | ||
67 | void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper); | ||
68 | |||
64 | void kmsg_dump_rewind(struct kmsg_dumper *dumper); | 69 | void kmsg_dump_rewind(struct kmsg_dumper *dumper); |
65 | 70 | ||
66 | int kmsg_dump_register(struct kmsg_dumper *dumper); | 71 | int kmsg_dump_register(struct kmsg_dumper *dumper); |
@@ -71,6 +76,13 @@ static inline void kmsg_dump(enum kmsg_dump_reason reason) | |||
71 | { | 76 | { |
72 | } | 77 | } |
73 | 78 | ||
79 | static inline bool kmsg_dump_get_line_nolock(struct kmsg_dumper *dumper, | ||
80 | bool syslog, const char *line, | ||
81 | size_t size, size_t *len) | ||
82 | { | ||
83 | return false; | ||
84 | } | ||
85 | |||
74 | static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, | 86 | static inline bool kmsg_dump_get_line(struct kmsg_dumper *dumper, bool syslog, |
75 | const char *line, size_t size, size_t *len) | 87 | const char *line, size_t size, size_t *len) |
76 | { | 88 | { |
@@ -83,6 +95,10 @@ static inline bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, | |||
83 | return false; | 95 | return false; |
84 | } | 96 | } |
85 | 97 | ||
98 | static inline void kmsg_dump_rewind_nolock(struct kmsg_dumper *dumper) | ||
99 | { | ||
100 | } | ||
101 | |||
86 | static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper) | 102 | static inline void kmsg_dump_rewind(struct kmsg_dumper *dumper) |
87 | { | 103 | { |
88 | } | 104 | } |