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

From: Ingo Molnar
Date: Wed May 07 2014 - 15:25:24 EST



* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> How about something like this for the itrace thing?
>
> You would mmap() the regular buffer; when write ->aux_{offset,size}
> in the control page. After which you can do a second mmap() with the
> .pgoff matching the aux_offset you gave and .length matching the
> aux_size you gave.
>
> This way the mmap() content still looks like a single linear file
> (could be sparse if you leave a hole, although we could require the
> aux_offset to match the end of the data section).
>
> And there is still the single event->rb, not more.
>
> 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.
>
> With this there should be no difficult page table tricks or
> anything.
>
> The patch is way incomplete but should sketch enough of the idea..
>
> So the aux_head/tail values should also be in the file space and not
> start at 0 again, similar for the offsets in the AUX record.

This looks like a pretty good concept to me, to support the buffering
quirks/constraints that itrace CPUs apparently have.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/