diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-11-29 20:32:26 -0500 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-12-08 20:54:08 -0500 |
commit | 2c2b0a78b373908926e4683ea5571332f63c0eb5 (patch) | |
tree | 4ffbcfc1abdc5569e7f444425c86948f1cd2426c /kernel/trace/trace.c | |
parent | 9c8e2f6d3d361439cc6744a094f1c15681b55269 (diff) |
ring-buffer: Add percentage of ring buffer full to wake up reader
Instead of just waiting for a page to be full before waking up a pending
reader, allow the reader to pass in a "percentage" of pages that have
content before waking up a reader. This should help keep the process of
reading the events not cause wake ups that constantly cause reading of the
buffer.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ff1c4b20cd0a..48d5eb22ff33 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1431,7 +1431,7 @@ update_max_tr_single(struct trace_array *tr, struct task_struct *tsk, int cpu) | |||
1431 | } | 1431 | } |
1432 | #endif /* CONFIG_TRACER_MAX_TRACE */ | 1432 | #endif /* CONFIG_TRACER_MAX_TRACE */ |
1433 | 1433 | ||
1434 | static int wait_on_pipe(struct trace_iterator *iter, bool full) | 1434 | static int wait_on_pipe(struct trace_iterator *iter, int full) |
1435 | { | 1435 | { |
1436 | /* Iterators are static, they should be filled or empty */ | 1436 | /* Iterators are static, they should be filled or empty */ |
1437 | if (trace_buffer_iter(iter, iter->cpu_file)) | 1437 | if (trace_buffer_iter(iter, iter->cpu_file)) |
@@ -5693,7 +5693,7 @@ static int tracing_wait_pipe(struct file *filp) | |||
5693 | 5693 | ||
5694 | mutex_unlock(&iter->mutex); | 5694 | mutex_unlock(&iter->mutex); |
5695 | 5695 | ||
5696 | ret = wait_on_pipe(iter, false); | 5696 | ret = wait_on_pipe(iter, 0); |
5697 | 5697 | ||
5698 | mutex_lock(&iter->mutex); | 5698 | mutex_lock(&iter->mutex); |
5699 | 5699 | ||
@@ -6751,7 +6751,7 @@ tracing_buffers_read(struct file *filp, char __user *ubuf, | |||
6751 | if ((filp->f_flags & O_NONBLOCK)) | 6751 | if ((filp->f_flags & O_NONBLOCK)) |
6752 | return -EAGAIN; | 6752 | return -EAGAIN; |
6753 | 6753 | ||
6754 | ret = wait_on_pipe(iter, false); | 6754 | ret = wait_on_pipe(iter, 0); |
6755 | if (ret) | 6755 | if (ret) |
6756 | return ret; | 6756 | return ret; |
6757 | 6757 | ||
@@ -6948,7 +6948,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
6948 | if ((file->f_flags & O_NONBLOCK) || (flags & SPLICE_F_NONBLOCK)) | 6948 | if ((file->f_flags & O_NONBLOCK) || (flags & SPLICE_F_NONBLOCK)) |
6949 | goto out; | 6949 | goto out; |
6950 | 6950 | ||
6951 | ret = wait_on_pipe(iter, true); | 6951 | ret = wait_on_pipe(iter, 1); |
6952 | if (ret) | 6952 | if (ret) |
6953 | goto out; | 6953 | goto out; |
6954 | 6954 | ||