Re: [PATCH v1 03/11] perf: Allow for multiple ring buffers per event

Peter Zijlstra
2014-05-07T21:22:39Z

On Wed, May 07, 2014 at 02:08:43PM -0700, Andi Kleen wrote:
> > Then, when data inside that aux data store changes they should inject an
> > PERF_RECORD_AUX to indicate this did happen, which ties it back into the
> > normal event flow.
>
> What happens when the aux buffer wraps? How would the client know
> if the data belongs to this _AUX entry or some later one?

It belongs to the last one. Rewind them from 'now' until you hit
collisions in AUX space, then you're done.

> May need some extra sequence numbers in the mmap header and the aux
> entry to handle this.

You're thinking of overwrite mode, right? We should update the tail in
that case, I've not thought about how to do that for the AUX buffer.

There have been some patches for the normal buffer, but they stalled;

https://lkml.org/lkml/2013/7/8/154

I'm all for merging that patch (or a fixed on, since it has fail in) if
we can show the current !overwrite case doesn't regress.

Also, would anybody want different mode for the data and aux parts? In
that case we do need to add some extra state to the control page to
indicate such.