]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ftrace: trace_pipe implement NONBLOCK
authorSteven Rostedt <rostedt@goodmis.org>
Mon, 12 May 2008 19:20:58 +0000 (21:20 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 23 May 2008 19:47:07 +0000 (21:47 +0200)
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>
kernel/trace/trace.c

index 2af940433e9672371782145937108d7e0477b074..3b4eaf36ed5d482a9df815cc5967a513f14a0e7c 100644 (file)
@@ -2233,6 +2233,10 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
        start = 0;
 
        while (trace_empty(iter)) {
+
+               if ((filp->f_flags & O_NONBLOCK))
+                       return -EAGAIN;
+
                /*
                 * This is a make-shift waitqueue. The reason we don't use
                 * an actual wait queue is because: