aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-05-12 15:20:58 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 15:47:07 -0400
commit2dc8f09571a61d9cb3dc47bba6608689dfe15d16 (patch)
tree5f23089a821ecff3ae9c57206b10d911f67cd279 /kernel/trace/trace.c
parent845279972f1736c3463c9cebd1bad92a0a347176 (diff)
ftrace: trace_pipe implement NONBLOCK
This patch implements "NONBLOCK" for trace_pipe. If the trace_pipe is opened with O_NONBLOCK, then the trace_pipe read will not block when buffer is empty. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2af940433e96..3b4eaf36ed5d 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2233,6 +2233,10 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
2233 start = 0; 2233 start = 0;
2234 2234
2235 while (trace_empty(iter)) { 2235 while (trace_empty(iter)) {
2236
2237 if ((filp->f_flags & O_NONBLOCK))
2238 return -EAGAIN;
2239
2236 /* 2240 /*
2237 * This is a make-shift waitqueue. The reason we don't use 2241 * This is a make-shift waitqueue. The reason we don't use
2238 * an actual wait queue is because: 2242 * an actual wait queue is because: