]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-3.18/perf-unwind-unwind-with-libdw-doesn-t-take-symfs-int.patch
patches for 3.18
[thirdparty/kernel/stable-queue.git] / queue-3.18 / perf-unwind-unwind-with-libdw-doesn-t-take-symfs-int.patch
1 From 0529b472d53efb4868c72c2cc164051e1f9a6ce1 Mon Sep 17 00:00:00 2001
2 From: Martin Vuille <jpmv27@aim.com>
3 Date: Sun, 11 Feb 2018 16:24:20 -0500
4 Subject: perf unwind: Unwind with libdw doesn't take symfs into account
5
6 [ Upstream commit 3d20c6246690219881786de10d2dda93f616d0ac ]
7
8 Path passed to libdw for unwinding doesn't include symfs path
9 if specified, so unwinding fails because ELF file is not found.
10
11 Similar to unwinding with libunwind, pass symsrc_filename instead
12 of long_name. If there is no symsrc_filename, fallback to long_name.
13
14 Signed-off-by: Martin Vuille <jpmv27@aim.com>
15 Cc: Adrian Hunter <adrian.hunter@intel.com>
16 Cc: David Ahern <dsahern@gmail.com>
17 Cc: Jiri Olsa <jolsa@kernel.org>
18 Cc: Namhyung Kim <namhyung@kernel.org>
19 Cc: Wang Nan <wangnan0@huawei.com>
20 Link: http://lkml.kernel.org/r/20180211212420.18388-1-jpmv27@aim.com
21 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
22 Signed-off-by: Sasha Levin <sashal@kernel.org>
23 ---
24 tools/perf/util/unwind-libdw.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27 diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
28 index dbd9954eda4a..517c6afb2707 100644
29 --- a/tools/perf/util/unwind-libdw.c
30 +++ b/tools/perf/util/unwind-libdw.c
31 @@ -47,7 +47,7 @@ static int __report_module(struct addr_location *al, u64 ip,
32
33 if (!mod)
34 mod = dwfl_report_elf(ui->dwfl, dso->short_name,
35 - dso->long_name, -1, al->map->start,
36 + (dso->symsrc_filename ? dso->symsrc_filename : dso->long_name), -1, al->map->start,
37 false);
38
39 return mod && dwfl_addrmodule(ui->dwfl, ip) == mod ? 0 : -1;
40 --
41 2.19.1
42