From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753276AbcHJSQO (ORCPT ); Wed, 10 Aug 2016 14:16:14 -0400 Received: from mail.kernel.org ([198.145.29.136]:54664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753090AbcHJSQK (ORCPT ); Wed, 10 Aug 2016 14:16:10 -0400 Date: Wed, 10 Aug 2016 11:00:26 -0300 From: Arnaldo Carvalho de Melo To: Rabin Vincent Cc: linux-kernel@vger.kernel.org, Rabin Vincent , Jiri Olsa , He Kuang Subject: Re: [PATCH] perf unwind: check symsrc ELF for .debug_frame Message-ID: <20160810140026.GF4249@kernel.org> References: <1470836176-29418-1-git-send-email-rabin.vincent@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470836176-29418-1-git-send-email-rabin.vincent@axis.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Aug 10, 2016 at 03:36:16PM +0200, Rabin Vincent escreveu: > From: Rabin Vincent > > When using split debug info, the file without debug info may not have a > .debug_frame section, so we need to check the symsrc ELF also, since > that's the file we actually read the unwind information from. Thanks for your work, next time please also copy the persons that did work on this file recently, like: He Kuang And people who acked or reviewed their patches, like: Jiri Olsa Guys, are you ok with these changes? 2/2 seems trivial enough. - Arnaldo > Signed-off-by: Rabin Vincent > --- > tools/perf/util/unwind-libunwind-local.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c > index 97c0f8f..d492192 100644 > --- a/tools/perf/util/unwind-libunwind-local.c > +++ b/tools/perf/util/unwind-libunwind-local.c > @@ -308,6 +308,20 @@ static int read_unwind_spec_debug_frame(struct dso *dso, > dso__data_put_fd(dso); > } > > + /* > + * With split debug info, the file without debug info may not have a > + * .debug_frame, so check the symsrc too. > + */ > + if (ofs == 0 && dso->symsrc_filename) { > + fd = open(dso->symsrc_filename, O_RDONLY); > + if (fd < 0) > + return -EINVAL; > + > + ofs = elf_section_offset(fd, ".debug_frame"); > + dso->data.debug_frame_offset = ofs; > + close(fd); > + } > + > *offset = ofs; > if (*offset) > return 0; > -- > 2.1.4