Skip to content

Commit

Permalink
ftrace: trace_pipe implement NONBLOCK
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Thomas Gleixner committed May 23, 2008
1 parent 8452799 commit 2dc8f09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2dc8f09

Please sign in to comment.