Commit e869446b authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

powerpc/spufs: sputrace: Don't block until the read buffer is full

Currently, read() on the sputrace buffer will only return data when
the user buffer is exhausted. This may mean that we never see the
end of the event log, unless we read() with exactly the right-sized

This change makes sputrace_read not block if we have data ready to
Signed-off-by: default avatarJeremy Kerr <>
parent baf39927
...@@ -80,6 +80,11 @@ static ssize_t sputrace_read(struct file *file, char __user *buf, ...@@ -80,6 +80,11 @@ static ssize_t sputrace_read(struct file *file, char __user *buf,
char tbuf[128]; char tbuf[128];
int width; int width;
/* If we have data ready to return, don't block waiting
* for more */
if (cnt > 0 && sputrace_used() == 0)
error = wait_event_interruptible(sputrace_wait, error = wait_event_interruptible(sputrace_wait,
sputrace_used() > 0); sputrace_used() > 0);
if (error) if (error)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment