lkml.org 
[lkml]   [2012]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] perf tools: Synthesize data mmap events for threads
Date
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


\
 
 \ /
  Last update: 2012-11-11 16:01    [W:0.036 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site