Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <noelgrandin@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1452158050-28061-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
0ba98149 0ddf5246

+10
+10
tools/perf/util/unwind-libdw.c
··· 96 96 thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER, 97 97 MAP__FUNCTION, addr, &al); 98 98 if (!al.map) { 99 + /* 100 + * We've seen cases (softice) where DWARF unwinder went 101 + * through non executable mmaps, which we need to lookup 102 + * in MAP__VARIABLE tree. 103 + */ 104 + thread__find_addr_map(ui->thread, PERF_RECORD_MISC_USER, 105 + MAP__VARIABLE, addr, &al); 106 + } 107 + 108 + if (!al.map) { 99 109 pr_debug("unwind: no map for %lx\n", (unsigned long)addr); 100 110 return -1; 101 111 }