public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Rabin Vincent <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de,
	acme@redhat.com, rabin.vincent@axis.com, rabinv@axis.com,
	mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com,
	namhyung@kernel.org
Subject: [tip:perf/core] perf unwind: Pass symbol source to libunwind
Date: Fri, 30 Oct 2015 02:15:13 -0700	[thread overview]
Message-ID: <tip-7ed4915ad60788d6b846e2cd034f49ee15698143@git.kernel.org> (raw)
In-Reply-To: <1446104978-26429-1-git-send-email-rabin.vincent@axis.com>

Commit-ID:  7ed4915ad60788d6b846e2cd034f49ee15698143
Gitweb:     http://git.kernel.org/tip/7ed4915ad60788d6b846e2cd034f49ee15698143
Author:     Rabin Vincent <rabin.vincent@axis.com>
AuthorDate: Thu, 29 Oct 2015 08:49:36 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 29 Oct 2015 17:48:38 -0300

perf unwind: Pass symbol source to libunwind

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 f729f9e..c83832b 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);

      parent reply	other threads:[~2015-10-30  9:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29  7:49 [PATCHv2 1/3] perf: unwind: pass symbol source to libunwind Rabin Vincent
2015-10-29  7:49 ` [PATCHv2 2/3] tools: build: fix libiberty feature detection Rabin Vincent
2015-10-29 20:45   ` Jiri Olsa
2015-10-30  9:14   ` [tip:perf/core] tools build: Fix " tip-bot for Rabin Vincent
2015-10-29  7:49 ` [PATCHv2 3/3] perf: add helper makefile for cross compiling libs Rabin Vincent
2015-10-29  9:46   ` Ingo Molnar
2015-11-06  8:09     ` Rabin Vincent
2015-11-27 11:35       ` Ingo Molnar
2015-10-30  9:15 ` tip-bot for Rabin Vincent [this message]

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=tip-7ed4915ad60788d6b846e2cd034f49ee15698143@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rabin.vincent@axis.com \
    --cc=rabinv@axis.com \
    --cc=tglx@linutronix.de \
    /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