mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 15:33:47 +00:00
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>
This commit is contained in:
parent
a63ce5b306
commit
d184b31c0e
2 changed files with 52 additions and 11 deletions
|
@ -14,6 +14,7 @@ struct trace_seq {
|
|||
unsigned char buffer[PAGE_SIZE];
|
||||
unsigned int len;
|
||||
unsigned int readpos;
|
||||
int full;
|
||||
};
|
||||
|
||||
static inline void
|
||||
|
@ -21,6 +22,7 @@ trace_seq_init(struct trace_seq *s)
|
|||
{
|
||||
s->len = 0;
|
||||
s->readpos = 0;
|
||||
s->full = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue