perf libdw: Check for mmaps also in MAP__VARIABLE tree
authorJiri Olsa <[email protected]>
Thu, 7 Jan 2016 09:14:02 +0000 (10:14 +0100)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 8 Jan 2016 17:16:57 +0000 (14:16 -0300)
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 <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/unwind-libdw.c

index db8142ba7cb9a72bd41d0129e9f3aed3ec58e520..cf5e250bc78e1a4c82a08fc2ea50d5876bec1c69 100644 (file)
@@ -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;