提交 2dc8f095 编写于 作者: S Steven Rostedt 提交者: Thomas Gleixner

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: NSteven Rostedt <srostedt@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 84527997
...@@ -2233,6 +2233,10 @@ tracing_read_pipe(struct file *filp, char __user *ubuf, ...@@ -2233,6 +2233,10 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
start = 0; start = 0;
while (trace_empty(iter)) { while (trace_empty(iter)) {
if ((filp->f_flags & O_NONBLOCK))
return -EAGAIN;
/* /*
* This is a make-shift waitqueue. The reason we don't use * This is a make-shift waitqueue. The reason we don't use
* an actual wait queue is because: * an actual wait queue is because:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册