linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Rabin Vincent <rabin.vincent@axis.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Rabin Vincent <rabinv@axis.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 8/8] perf unwind: Pass symbol source to libunwind
Date: Thu, 29 Oct 2015 20:05:37 -0300	[thread overview]
Message-ID: <1446159937-28763-9-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1446159937-28763-1-git-send-email-acme@kernel.org>

From: Rabin Vincent <rabin.vincent@axis.com>

Even if --symfs is used to point to the debug binaries, we send in the
non-debug filenames to libunwind, which leads to libunwind not finding
the debug frame.  Fix this by preferring the file in --symfs, if it is
available.

Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rabin Vincent <rabinv@axis.com>
Link: http://lkml.kernel.org/r/1446104978-26429-1-git-send-email-rabin.vincent@axis.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/unwind-libunwind.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index f729f9e99f99..c83832b555e5 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -360,12 +360,15 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
 		int fd = dso__data_get_fd(map->dso, ui->machine);
 		int is_exec = elf_is_exec(fd, map->dso->name);
 		unw_word_t base = is_exec ? 0 : map->start;
+		const char *symfile;
 
 		if (fd >= 0)
 			dso__data_put_fd(map->dso);
 
+		symfile = map->dso->symsrc_filename ?: map->dso->name;
+
 		memset(&di, 0, sizeof(di));
-		if (dwarf_find_debug_frame(0, &di, ip, base, map->dso->name,
+		if (dwarf_find_debug_frame(0, &di, ip, base, symfile,
 					   map->start, map->end))
 			return dwarf_search_unwind_table(as, ip, &di, pi,
 							 need_unwind_info, arg);
-- 
2.1.0


  parent reply	other threads:[~2015-10-29 23:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 23:05 [GIT PULL 0/8] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-10-29 23:05 ` [PATCH 1/8] perf trace: Add cmd string table to decode sys_bpf first arg Arnaldo Carvalho de Melo
2015-10-29 23:05 ` [PATCH 2/8] perf script: Enable printing of branch stack Arnaldo Carvalho de Melo
2015-10-29 23:05 ` [PATCH 3/8] perf tools: Make sure fixdep is built before libbpf Arnaldo Carvalho de Melo
2015-10-29 23:05 ` [PATCH 4/8] perf bpf: Attach eBPF filter to perf event Arnaldo Carvalho de Melo
2015-10-29 23:05 ` [PATCH 5/8] perf record: Add clang options for compiling BPF scripts Arnaldo Carvalho de Melo
2015-10-29 23:05 ` [PATCH 6/8] perf tools: Compile scriptlets to BPF objects when passing '.c' to --event Arnaldo Carvalho de Melo
2015-10-29 23:05 ` [PATCH 7/8] tools build: Fix libiberty feature detection Arnaldo Carvalho de Melo
2015-10-29 23:05 ` Arnaldo Carvalho de Melo [this message]
2015-10-30  9:10 ` [GIT PULL 0/8] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446159937-28763-9-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rabin.vincent@axis.com \
    --cc=rabinv@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).