From: Stephane Eranian <eranian@google.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu, peterz@infradead.org, acme@redhat.com,
dsahern@gmail.com, ak@linux.intel.com, jolsa@redhat.com,
hughd@google.com, keescook@chromium.org,
akpm@linux-foundation.org
Subject: [PATCH] perf: disable mmap2 support
Date: Wed, 9 Oct 2013 18:17:43 +0200 [thread overview]
Message-ID: <20131009161743.GA3022@quad> (raw)
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
next reply other threads:[~2013-10-09 16:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 16:17 Stephane Eranian [this message]
2013-10-09 16:21 ` [PATCH] perf: disable mmap2 support David Ahern
2013-10-09 16:24 ` Stephane Eranian
2013-10-09 16:39 ` Stephane Eranian
2013-10-09 17:19 ` David Ahern
2013-10-09 17:40 ` Stephane Eranian
2013-10-09 18:03 ` David Ahern
2013-10-10 14:26 ` Arnaldo Carvalho de Melo
2013-10-11 18:40 ` David Ahern
2013-10-15 12:25 ` Stephane Eranian
2013-10-15 13:12 ` Ingo Molnar
2013-10-15 13:27 ` Stephane Eranian
2013-10-15 13:34 ` Ingo Molnar
2013-10-15 14:32 ` Stephane Eranian
2013-10-15 16:04 ` Ingo Molnar
2013-10-09 19:33 ` Arnaldo Carvalho de Melo
2013-10-10 4:56 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131009161743.GA3022@quad \
--to=eranian@google.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dsahern@gmail.com \
--cc=hughd@google.com \
--cc=jolsa@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox