diff options
author | Stephane Eranian <eranian@google.com> | 2013-01-24 10:10:40 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-04-01 11:22:00 -0400 |
commit | bad4091791b0bb8c2d7919ddefe2f0d109299b5a (patch) | |
tree | b551d801c52d221b3d0f11037d70272388322797 /tools | |
parent | 028f12ee6beff0961781c5ed3f740e5f3b56f781 (diff) |
perf machine: Detect data vs. text mappings
Leverages the PERF_RECORD_MISC_MMAP_DATA bit in the RECORD_MMAP record
header. When the bit is set then the mapping type is set to
MAP__VARIABLE.
Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1359040242-8269-17-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/machine.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index d77ba869d7ed..b2ecad6ec46b 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -955,6 +955,7 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event | |||
955 | u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 955 | u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; |
956 | struct thread *thread; | 956 | struct thread *thread; |
957 | struct map *map; | 957 | struct map *map; |
958 | enum map_type type; | ||
958 | int ret = 0; | 959 | int ret = 0; |
959 | 960 | ||
960 | if (dump_trace) | 961 | if (dump_trace) |
@@ -971,10 +972,17 @@ int machine__process_mmap_event(struct machine *machine, union perf_event *event | |||
971 | thread = machine__findnew_thread(machine, event->mmap.pid); | 972 | thread = machine__findnew_thread(machine, event->mmap.pid); |
972 | if (thread == NULL) | 973 | if (thread == NULL) |
973 | goto out_problem; | 974 | goto out_problem; |
975 | |||
976 | if (event->header.misc & PERF_RECORD_MISC_MMAP_DATA) | ||
977 | type = MAP__VARIABLE; | ||
978 | else | ||
979 | type = MAP__FUNCTION; | ||
980 | |||
974 | map = map__new(&machine->user_dsos, event->mmap.start, | 981 | map = map__new(&machine->user_dsos, event->mmap.start, |
975 | event->mmap.len, event->mmap.pgoff, | 982 | event->mmap.len, event->mmap.pgoff, |
976 | event->mmap.pid, event->mmap.filename, | 983 | event->mmap.pid, event->mmap.filename, |
977 | MAP__FUNCTION); | 984 | type); |
985 | |||
978 | if (map == NULL) | 986 | if (map == NULL) |
979 | goto out_problem; | 987 | goto out_problem; |
980 | 988 | ||