[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 11 Nov 2012 23:20:51 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH 2/2] perf tools: Synthesize data mmap events for threads
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@...gle.com>
Signed-off-by: Namhyung Kim <namhyung@...nel.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists