Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116658
b: refs/heads/master
c: 9ff4b97
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Paalanen authored and Ingo Molnar committed Oct 14, 2008
1 parent 436c4eb commit 547196b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c4f035f6c3e8fda661eb6105aa51ef07aa71607
refs/heads/master: 9ff4b9744c187cae58c3774361ea090addbc4130
10 changes: 8 additions & 2 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,6 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
sret = trace_seq_to_user(&iter->seq, ubuf, cnt);
if (sret != -EBUSY)
return sret;
sret = 0;

trace_seq_reset(&iter->seq);

Expand All @@ -2450,6 +2449,8 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
goto out;
}

waitagain:
sret = 0;
while (trace_empty(iter)) {

if ((filp->f_flags & O_NONBLOCK)) {
Expand Down Expand Up @@ -2556,8 +2557,13 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
sret = trace_seq_to_user(&iter->seq, ubuf, cnt);
if (iter->seq.readpos >= iter->seq.len)
trace_seq_reset(&iter->seq);

/*
* If there was nothing to send to user, inspite of consuming trace
* entries, go back to wait for more entries.
*/
if (sret == -EBUSY)
sret = 0;
goto waitagain;

out:
mutex_unlock(&trace_types_lock);
Expand Down

0 comments on commit 547196b

Please sign in to comment.