From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758185AbbJ2XGJ (ORCPT ); Thu, 29 Oct 2015 19:06:09 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:41979 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758121AbbJ2XGG (ORCPT ); Thu, 29 Oct 2015 19:06:06 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Rabin Vincent , Jiri Olsa , Namhyung Kim , Peter Zijlstra , Rabin Vincent , Arnaldo Carvalho de Melo Subject: [PATCH 8/8] perf unwind: Pass symbol source to libunwind Date: Thu, 29 Oct 2015 20:05:37 -0300 Message-Id: <1446159937-28763-9-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1446159937-28763-1-git-send-email-acme@kernel.org> References: <1446159937-28763-1-git-send-email-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rabin Vincent 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 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