aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2015-01-14 07:18:10 -0500
committerIngo Molnar <mingo@kernel.org>2015-04-02 11:13:32 -0400
commite8c6deac69629c0cb97c3d3272f8631ef17f8f0f (patch)
treeb05546c3ad7ac82b7120f9d9b7fc113748ce0987 /include
parente1abf2cc8d5d80b41c4419368ec743ccadbb131e (diff)
perf: Add data_{offset,size} to user_page
Currently, the actual perf ring buffer is one page into the mmap area, following the user page and the userspace follows this convention. This patch adds data_{offset,size} fields to user_page that can be used by userspace instead for locating perf data in the mmap area. This is also helpful when mapping existing or shared buffers if their size is not known in advance. Right now, it is made to follow the existing convention that data_offset == PAGE_SIZE and data_offset + data_size == mmap_size. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Kaixu Xia <kaixu.xia@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Robert Richter <rric@kernel.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: acme@infradead.org Cc: adrian.hunter@intel.com Cc: kan.liang@intel.com Cc: markus.t.metzger@intel.com Cc: mathieu.poirier@linaro.org Link: http://lkml.kernel.org/r/1421237903-181015-2-git-send-email-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/perf_event.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 91803e54ee73..86c44ae66d43 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -522,9 +522,14 @@ struct perf_event_mmap_page {
522 * In this case the kernel will not over-write unread data. 522 * In this case the kernel will not over-write unread data.
523 * 523 *
524 * See perf_output_put_handle() for the data ordering. 524 * See perf_output_put_handle() for the data ordering.
525 *
526 * data_{offset,size} indicate the location and size of the perf record
527 * buffer within the mmapped area.
525 */ 528 */
526 __u64 data_head; /* head in the data section */ 529 __u64 data_head; /* head in the data section */
527 __u64 data_tail; /* user-space written tail */ 530 __u64 data_tail; /* user-space written tail */
531 __u64 data_offset; /* where the buffer starts */
532 __u64 data_size; /* data buffer size */
528}; 533};
529 534
530#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0) 535#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)