lkml.org 
[lkml]   [2014]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2014-05-15 21:01    [W:0.114 / U:1.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site