浏览代码

ring-buffer: reset timestamps when ring buffer is reset

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>
Steven Rostedt 16 年之前
父节点
当前提交
91a8d07d82
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      kernel/trace/ring_buffer.c

+ 3 - 0
kernel/trace/ring_buffer.c

@@ -2174,6 +2174,9 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
 
 
 	cpu_buffer->overrun = 0;
 	cpu_buffer->overrun = 0;
 	cpu_buffer->entries = 0;
 	cpu_buffer->entries = 0;
+
+	cpu_buffer->write_stamp = 0;
+	cpu_buffer->read_stamp = 0;
 }
 }
 
 
 /**
 /**