提交 55ea4cf4 编写于 作者: S Steven Rostedt (VMware)

ring-buffer: Update write stamp with the correct ts

The write stamp, used to calculate deltas between events, was updated with
the stale "ts" value in the "info" structure, and not with the updated "ts"
variable. This caused the deltas between events to be inaccurate, and when
crossing into a new sub buffer, had time go backwards.

Link: https://lkml.kernel.org/r/20201124223917.795844-1-elavila@google.com

Cc: stable@vger.kernel.org
Fixes: a389d86f ("ring-buffer: Have nested events still record running time stamp")
Reported-by: N"J. Avila" <elavila@google.com>
Tested-by: NDaniel Mentz <danielmentz@google.com>
Tested-by: NWill McVicker <willmcvicker@google.com>
Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
上级 fbc6e1c6
......@@ -3291,7 +3291,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
/* Nothing came after this event between C and E */
info->delta = ts - info->after;
(void)rb_time_cmpxchg(&cpu_buffer->write_stamp,
info->after, info->ts);
info->after, ts);
info->ts = ts;
} else {
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册