From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] perf tools: Synthesize data mmap events for threads
Date: Sun, 11 Nov 2012 23:20:51 +0900 [thread overview]
Message-ID: <1352643651-13891-2-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1352643651-13891-1-git-send-email-namhyung@kernel.org>
Current perf_event__synthesize_mmap_events() only deals with
executable mappings. With recently added memory access sampling,
non-executable data mappings are needed also.
Cc: Stephane Eranian <eranian@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/util/event.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 3cf2c3e0605f..06e4d57a9e29 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -210,11 +210,15 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
&event->mmap.start, &event->mmap.len, prot,
&event->mmap.pgoff, execname);
- if (prot[2] != 'x')
- continue;
+ if (prot[2] == 'x' && !strcmp(execname, ""))
+ strcpy(execname, anonstr);
+ /* ignore non-executable anon mappings */
if (!strcmp(execname, ""))
- strcpy(execname, anonstr);
+ continue;
+
+ if (prot[2] != 'x')
+ event->header.misc |= PERF_RECORD_MISC_MMAP_USER;
size = strlen(execname) + 1;
memcpy(event->mmap.filename, execname, size);
--
1.7.9.2
next prev parent reply other threads:[~2012-11-11 14:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-11 14:20 [PATCH 1/2] perf tools: Cleanup synthesizing mmap events Namhyung Kim
2012-11-11 14:20 ` Namhyung Kim [this message]
2012-12-08 14:55 ` [tip:perf/core] perf tools: Use sscanf for parsing /proc/pid/maps tip-bot for Namhyung Kim
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=1352643651-13891-2-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=acme@ghostprotocols.net \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--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
all inboxes | Powered by JetHome®