[tip:perf/core] perf record: Store data mmaps for dwarf unwind

From: tip-bot for Jiri Olsa
Date: Sat Jan 09 2016 - 11:42:42 EST


Commit-ID: 5c0cf22477eaa890beeb4bc3554e5bebbea4b007
Gitweb: http://git.kernel.org/tip/5c0cf22477eaa890beeb4bc3554e5bebbea4b007
Author: Jiri Olsa <jolsa@xxxxxxxxxx>
AuthorDate: Thu, 7 Jan 2016 14:30:22 +0100
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Fri, 8 Jan 2016 14:17:45 -0300

perf record: Store data mmaps for dwarf unwind

Currently we don't synthesize data mmap by default. It depends on -d
option, that enables data address sampling.

But we've seen cases (softice) where DWARF unwinder went through non
executable mmaps, which we need to lookup in MAP__VARIABLE tree.

Making data mmaps to be synthesized for dwarf unwind as well.

Reported-by: Noel Grandin <noelgrandin@xxxxxxxxx>
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Link: http://lkml.kernel.org/r/20160107133022.GA32115@xxxxxxxxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-record.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 9c5cdc2c4..dc4e0ad 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -815,8 +815,12 @@ int record_parse_callchain_opt(const struct option *opt,
}

ret = parse_callchain_record_opt(arg, &callchain_param);
- if (!ret)
+ if (!ret) {
+ /* Enable data address sampling for DWARF unwind. */
+ if (callchain_param.record_mode == CALLCHAIN_DWARF)
+ record->sample_address = true;
callchain_debug();
+ }

return ret;
}