From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759385AbbJ3JPm (ORCPT ); Fri, 30 Oct 2015 05:15:42 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44506 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759361AbbJ3JPc (ORCPT ); Fri, 30 Oct 2015 05:15:32 -0400 Date: Fri, 30 Oct 2015 02:15:13 -0700 From: tip-bot for Rabin Vincent Message-ID: 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 Reply-To: tglx@linutronix.de, acme@redhat.com, a.p.zijlstra@chello.nl, jolsa@kernel.org, rabinv@axis.com, rabin.vincent@axis.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, namhyung@kernel.org In-Reply-To: <1446104978-26429-1-git-send-email-rabin.vincent@axis.com> References: <1446104978-26429-1-git-send-email-rabin.vincent@axis.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf unwind: Pass symbol source to libunwind Git-Commit-ID: 7ed4915ad60788d6b846e2cd034f49ee15698143 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7ed4915ad60788d6b846e2cd034f49ee15698143 Gitweb: http://git.kernel.org/tip/7ed4915ad60788d6b846e2cd034f49ee15698143 Author: Rabin Vincent AuthorDate: Thu, 29 Oct 2015 08:49:36 +0100 Committer: Arnaldo Carvalho de Melo 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 Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rabin Vincent Link: http://lkml.kernel.org/r/1446104978-26429-1-git-send-email-rabin.vincent@axis.com Signed-off-by: Arnaldo Carvalho de Melo --- 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);