Messages in this thread | | | Date | Thu, 15 May 2014 20:14:02 +0200 | From | Robert Richter <> | Subject | Re: [RFC 1/2] perf: add data_{offset,size} to user_page |
| |
On 15.05.14 18:08:29, Alexander Shishkin wrote: > @@ -488,9 +488,14 @@ struct perf_event_mmap_page { > * In this case the kernel will not over-write unread data. > * > * See perf_output_put_handle() for the data ordering. > + * > + * data_{offset,size} indicate the location and size of the perf record > + * buffer within the mmapped area. > */ > __u64 data_head; /* head in the data section */ > __u64 data_tail; /* user-space written tail */ > + __u64 data_offset; /* where the buffer starts */ > + __u64 data_size; /* data buffer size */ > };
Yeah, we need something like this also for other reasons. For persistent events we don't know the buffer size when mmaping existing/shared buffers. To determine the buffer size we could map the first page only, read the size and then mremap() to the actual size.
Please keep this use case in mind too, also for the aux buffer. The best would be if data_size is the mmap size.
Thanks,
-Robert
| |