lkml.org 
[lkml]   [2013]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] perf: disable mmap2 support

This patch disables the mmap2 record format support
for now. The support needs a bit more work to cover
VM_CLONE cases.

The patch leaves attr->mmap2 defined, but returns
an error if it is set. That ensures no PERF_RECORD_MMAP2
record can be generated. Yet it minimizes the reverts in
the perf tool.


Signed-off-by: Stephane Eranian <eranian@google.com>
---
include/uapi/linux/perf_event.h | 18 +-----------------
kernel/events/core.c | 4 ++++
2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index da48837..8074b29 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -682,23 +682,7 @@ enum perf_event_type {
PERF_RECORD_SAMPLE = 9,

/*
- * The MMAP2 records are an augmented version of MMAP, they add
- * maj, min, ino numbers to be used to uniquely identify each mapping
- *
- * struct {
- * struct perf_event_header header;
- *
- * u32 pid, tid;
- * u64 addr;
- * u64 len;
- * u64 pgoff;
- * u32 maj;
- * u32 min;
- * u64 ino;
- * u64 ino_generation;
- * char filename[];
- * struct sample_id sample_id;
- * };
+ * reserved, do not use
*/
PERF_RECORD_MMAP2 = 10,

diff --git a/kernel/events/core.c b/kernel/events/core.c
index c716385..d7152a6 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -6782,6 +6782,10 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr,
if (attr->read_format & ~(PERF_FORMAT_MAX-1))
return -EINVAL;

+ /* disable for now */
+ if (attr->mmap2)
+ return -EINVAL;
+
if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) {
u64 mask = attr->branch_sample_type;

--
1.7.10.4


\
 
 \ /
  Last update: 2013-10-09 18:21    [W:0.186 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site