Re: Potential Issue in Tracing Ring Buffer

From: Steven Rostedt
Date: Tue Dec 08 2020 - 15:26:47 EST


On Tue, 8 Dec 2020 11:37:13 -0800
"J. Avila" <elavila@xxxxxxxxxx> wrote:

> Hello Steven,
>
> Thank you once again for all of your support. We saw that you also recently
> merged a change[1] which adds some validation for the timestamps in
> ring_buffer.c. Would you have any recommendations on how to add a more
> lightweight check for time going "backwards" in the timestamps? The idea
> is that we could use this quick test to detect the problem, then run a build
> with your config to dig deeper.

I'm looking at adding a user space kernel selftest to make sure the buffer
never goes backwards[1] (note the code has changed since that posting). You
can see the stand alone code here[2]. But requires downloading and
installing libtraceevent[3] and libtracefs[4].

-- Steve


[1] https://lore.kernel.org/r/20201201160656.7cc6a5e8@xxxxxxxxxxxxxxxxxx
[2] http://rostedt.org/code/test-ring-buffer/
[3] https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
[4] https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/