diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2014-06-25 15:54:42 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-11-19 22:01:09 -0500 |
commit | 3a161d99c43ce74c76aecff309be4c3ba455e823 (patch) | |
tree | cc3aa5d746203cd17e8d9b92c78bef04f6f0ccdb /include/linux/trace_seq.h | |
parent | 16a8ef2751801346f1f76a18685b2beb63cd170f (diff) |
tracing: Create seq_buf layer in trace_seq
Create a seq_buf layer that trace_seq sits on. The seq_buf will not
be limited to page size. This will allow other usages of seq_buf
instead of a hard set PAGE_SIZE one that trace_seq has.
Link: http://lkml.kernel.org/r/20141104160221.864997179@goodmis.org
Link: http://lkml.kernel.org/r/20141114011412.170377300@goodmis.org
Tested-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/trace_seq.h')
-rw-r--r-- | include/linux/trace_seq.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index db8a73224f1a..85d37106be3d 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _LINUX_TRACE_SEQ_H | 1 | #ifndef _LINUX_TRACE_SEQ_H |
2 | #define _LINUX_TRACE_SEQ_H | 2 | #define _LINUX_TRACE_SEQ_H |
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/seq_buf.h> |
5 | 5 | ||
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | 7 | ||
@@ -12,16 +12,14 @@ | |||
12 | 12 | ||
13 | struct trace_seq { | 13 | struct trace_seq { |
14 | unsigned char buffer[PAGE_SIZE]; | 14 | unsigned char buffer[PAGE_SIZE]; |
15 | unsigned int len; | 15 | struct seq_buf seq; |
16 | unsigned int readpos; | ||
17 | int full; | 16 | int full; |
18 | }; | 17 | }; |
19 | 18 | ||
20 | static inline void | 19 | static inline void |
21 | trace_seq_init(struct trace_seq *s) | 20 | trace_seq_init(struct trace_seq *s) |
22 | { | 21 | { |
23 | s->len = 0; | 22 | seq_buf_init(&s->seq, s->buffer, PAGE_SIZE); |
24 | s->readpos = 0; | ||
25 | s->full = 0; | 23 | s->full = 0; |
26 | } | 24 | } |
27 | 25 | ||
@@ -37,7 +35,7 @@ trace_seq_init(struct trace_seq *s) | |||
37 | static inline unsigned char * | 35 | static inline unsigned char * |
38 | trace_seq_buffer_ptr(struct trace_seq *s) | 36 | trace_seq_buffer_ptr(struct trace_seq *s) |
39 | { | 37 | { |
40 | return s->buffer + s->len; | 38 | return s->buffer + s->seq.len; |
41 | } | 39 | } |
42 | 40 | ||
43 | /** | 41 | /** |
@@ -49,7 +47,7 @@ trace_seq_buffer_ptr(struct trace_seq *s) | |||
49 | */ | 47 | */ |
50 | static inline bool trace_seq_has_overflowed(struct trace_seq *s) | 48 | static inline bool trace_seq_has_overflowed(struct trace_seq *s) |
51 | { | 49 | { |
52 | return s->full || s->len > PAGE_SIZE - 1; | 50 | return s->full || seq_buf_has_overflowed(&s->seq); |
53 | } | 51 | } |
54 | 52 | ||
55 | /* | 53 | /* |