bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC][PATCH 00/11] ring-buffer/tracing: Remove disabling of ring buffer while reading trace file
       [not found] <20200317213222.421100128@goodmis.org>
@ 2020-03-19  5:27 ` Alexei Starovoitov
  0 siblings, 0 replies; only message in thread
From: Alexei Starovoitov @ 2020-03-19  5:27 UTC (permalink / raw)
  To: Steven Rostedt, bpf
  Cc: LKML, Ingo Molnar, Andrew Morton, Peter Zijlstra,
	Masami Hiramatsu, Peter Wu, Jonathan Corbet, Tom Zanussi

On Tue, Mar 17, 2020 at 11:34 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> When the ring buffer was first written for ftrace, there was two
> human readable files to read it. One was a standard "producer/consumer"
> file (trace_pipe), which would consume data from the ring buffer as
> it read it, and the other was a "static iterator" that would not
> consume the events, such that the file could be read multiple times
> and return the same output each time.
>
> The "static iterator" was never meant to be read while there was an
> active writer to the ring buffer. If writing was enabled, then it
> would disable the writer when the trace file was opened.
>
> There has been some complaints about this by the BPF folks, that did
> not realize this little bit of information and it was requested that
> the "trace" file does not stop the writing to the ring buffer.
>
> This patch series attempts to satisfy that request, by creating a
> temporary buffer in each of the per cpu iterators to place the
> read event into, such that it can be passed to users without worrying
> about a writer to corrupt the event while it was being written out.
> It also uses the fact that the ring buffer is broken up into pages,
> where each page has its own timestamp that gets updated when a
> writer crosses over to it. By copying it to the temp buffer, and
> doing a "before and after" test of the time stamp with memory barriers,
> can allow the events to be saved.

Awesome. Thank you so much for working on it.
Looks like it addresses all the issues bpf folks reported.
cc-ing bpf list for visibility.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-19  5:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200317213222.421100128@goodmis.org>
2020-03-19  5:27 ` [RFC][PATCH 00/11] ring-buffer/tracing: Remove disabling of ring buffer while reading trace file Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).