From: Jiri Olsa Date: Thu, 7 Jan 2016 09:14:02 +0000 (+0100) Subject: perf libdw: Check for mmaps also in MAP__VARIABLE tree X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0ba98149f8c8b6b2ba36be9938afb731fa719004;p=openwrt%2Fstaging%2Fblogic.git perf libdw: Check for mmaps also in MAP__VARIABLE tree We've seen cases (softice) where DWARF unwinder went through non executable mmaps, which we need to lookup in MAP__VARIABLE tree. Reported-and-Tested-by: Noel Grandin Signed-off-by: Jiri Olsa Cc: Adrian Hunter Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1452158050-28061-6-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index db8142ba7cb9..cf5e250bc78e 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c @@ -95,6 +95,16 @@ static int access_dso_mem(struct unwind_info *ui, Dwarf_Addr addr, thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER, MAP__FUNCTION, addr, &al); + if (!al.map) { + /* + * We've seen cases (softice) where DWARF unwinder went + * through non executable mmaps, which we need to lookup + * in MAP__VARIABLE tree. + */ + thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER, + MAP__VARIABLE, addr, &al); + } + if (!al.map) { pr_debug("unwind: no map for %lx\n", (unsigned long)addr); return -1;