Skip to content

Commit

Permalink
ring-buffer: reset timestamps when ring buffer is reset
Browse files Browse the repository at this point in the history
Impact: fix bad times of recent resets

The ring buffer needs to reset its timestamps when reseting of the
buffer, otherwise the timestamps are stale and might be used to
calculate times in the buffer causing funny timestamps to appear.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Jan 22, 2009
1 parent 1092307 commit 91a8d07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2174,6 +2174,9 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)

cpu_buffer->overrun = 0;
cpu_buffer->entries = 0;

cpu_buffer->write_stamp = 0;
cpu_buffer->read_stamp = 0;
}

/**
Expand Down

0 comments on commit 91a8d07

Please sign in to comment.