Messages in this thread Patch in this message | | | From | Namhyung Kim <> | Subject | [PATCH 2/2] perf tools: Synthesize data mmap events for threads | Date | Sun, 11 Nov 2012 23:20:51 +0900 |
| |
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
| |