Skip to content

Commit fd3a46f

Browse files
rostedtgregkh
authored andcommitted
ring-buffer: Update write stamp with the correct ts
commit 55ea4cf upstream. 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: a389d86 ("ring-buffer: Have nested events still record running time stamp") Reported-by: "J. Avila" <elavila@google.com> Tested-by: Daniel Mentz <danielmentz@google.com> Tested-by: Will McVicker <willmcvicker@google.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3555ab3 commit fd3a46f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/trace/ring_buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3291,7 +3291,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
32913291
/* Nothing came after this event between C and E */
32923292
info->delta = ts - info->after;
32933293
(void)rb_time_cmpxchg(&cpu_buffer->write_stamp,
3294-
info->after, info->ts);
3294+
info->after, ts);
32953295
info->ts = ts;
32963296
} else {
32973297
/*

0 commit comments

Comments
 (0)