tracing: fix seq read from trace files
The buffer used by trace_seq was updated incorrectly. Instead of consuming what was actually read, it consumed the rest of the buffer on reads. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
This commit is contained in:
@@ -361,7 +361,7 @@ ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt)
|
|||||||
|
|
||||||
cnt -= ret;
|
cnt -= ret;
|
||||||
|
|
||||||
s->readpos += len;
|
s->readpos += cnt;
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt)
|
|||||||
if (!ret)
|
if (!ret)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
s->readpos += len;
|
s->readpos += cnt;
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user