diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-11-25 10:10:14 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-09 14:05:49 -0500 |
commit | d184b31c0e403580aafb3f8955ecc185a3d04801 (patch) | |
tree | ca3fc8371382ce8dbe43eb684313847b7555573e /include/linux/trace_seq.h | |
parent | a63ce5b306855bccdacba95c03bfc293316c8ae3 (diff) |
tracing: Add full state to trace_seq
The trace_seq buffer might fill up, and right now one needs to check the
return value of each printf into the buffer to check for that.
Instead, have the buffer keep track of whether it is full or not, and
reject more input if it is full or would have overflowed with an input
that wasn't added.
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/trace_seq.h')
-rw-r--r-- | include/linux/trace_seq.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index fad6857bc0f3..5cf397ceb726 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
@@ -14,6 +14,7 @@ struct trace_seq { | |||
14 | unsigned char buffer[PAGE_SIZE]; | 14 | unsigned char buffer[PAGE_SIZE]; |
15 | unsigned int len; | 15 | unsigned int len; |
16 | unsigned int readpos; | 16 | unsigned int readpos; |
17 | int full; | ||
17 | }; | 18 | }; |
18 | 19 | ||
19 | static inline void | 20 | static inline void |
@@ -21,6 +22,7 @@ trace_seq_init(struct trace_seq *s) | |||
21 | { | 22 | { |
22 | s->len = 0; | 23 | s->len = 0; |
23 | s->readpos = 0; | 24 | s->readpos = 0; |
25 | s->full = 0; | ||
24 | } | 26 | } |
25 | 27 | ||
26 | /* | 28 | /* |