ring-buffer: Update read stamp with first real commit on page
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 23 Nov 2015 15:35:36 +0000 (10:35 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 Dec 2015 02:25:58 +0000 (02:25 +0000)
commit1af93d99281a44405e7fcf130c061201405c577c
treece0b62cfd9f394d74043e0f01b123d8c7ccfc0c2
parent62a1ce4a9501ec4b962ad5dcf4cdcd4b29b941eb
ring-buffer: Update read stamp with first real commit on page

commit b81f472a208d3e2b4392faa6d17037a89442f4ce upstream.

Do not update the read stamp after swapping out the reader page from the
write buffer. If the reader page is swapped out of the buffer before an
event is written to it, then the read_stamp may get an out of date
timestamp, as the page timestamp is updated on the first commit to that
page.

rb_get_reader_page() only returns a page if it has an event on it, otherwise
it will return NULL. At that point, check if the page being returned has
events and has not been read yet. Then at that point update the read_stamp
to match the time stamp of the reader page.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
kernel/trace/ring_buffer.c