mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steve Capper <steve.capper@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	will.deacon@arm.com, Paul Mackerras <paulus@samba.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Steve Capper <steve.capper@linaro.org>
Subject: [PATCH] perf symbols: Consider the syms_ss in dso__load_sym
Date: Fri, 21 Nov 2014 10:54:57 +0000	[thread overview]
Message-ID: <1416567297-9000-1-git-send-email-steve.capper@linaro.org> (raw)

In dso__load_sym we only try to load the .debug_frame section from the
runtime image. For distros, the debug symbols are generally in a
separate file.

As a result, running perf report on arm64 can give errors such as:
"$file with build id $id not found, continuing without symbols"

Even when the debug symbols have been correctly installed (and loaded
by perf).

This patch adds logic to dso__load_sym to query syms_ss for the
.debug_frame section if it can't be found in the elf file pointed to by
runtime_ss.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
---
This patch is against 3.18-rc5.
---
 tools/perf/util/symbol-elf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 1e23a5b..1336392 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -830,8 +830,11 @@ int dso__load_sym(struct dso *dso, struct map *map,
 			continue;
 
 		sec = elf_getscn(runtime_ss->elf, sym.st_shndx);
-		if (!sec)
-			goto out_elf_end;
+		if (!sec) {
+			sec = elf_getscn(syms_ss->elf, sym.st_shndx);
+			if (!sec)
+				goto out_elf_end;
+		}
 
 		gelf_getshdr(sec, &shdr);
 
-- 
1.9.3


                 reply	other threads:[~2014-11-21 10:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1416567297-9000-1-git-send-email-steve.capper@linaro.org \
    --to=steve.capper@linaro.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=will.deacon@arm.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

all inboxes | Powered by JetHome®