linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Dave Martin <dave.martin@linaro.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 6/9] perf symbols: Ignore mapping symbols on ARM
Date: Tue, 10 Aug 2010 17:15:36 -0300	[thread overview]
Message-ID: <1281471339-10878-7-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1281471339-10878-1-git-send-email-acme@infradead.org>

From: Dave Martin <dave.martin@linaro.org>

ARM ELF files use symbols with special names $a, $t, $d to identify regions of
ARM code, Thumb code and data within code sections.  This can cause confusing
output from the perf tools, especially for partially stripped binaries, or
binaries containing user-added zero-sized symbols (which may occur in
hand-written assembler which hasn't been fully annotated with .size
directives).

This patch filters out these symbols at load time.

LKML-Reference: <1281352878-8735-2-git-send-email-dave.martin@linaro.org>
Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/symbol.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index b6f5970..1a36773 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1079,6 +1079,16 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name,
 		if (!is_label && !elf_sym__is_a(&sym, map->type))
 			continue;
 
+		/* Reject ARM ELF "mapping symbols": these aren't unique and
+		 * don't identify functions, so will confuse the profile
+		 * output: */
+		if (ehdr.e_machine == EM_ARM) {
+			if (!strcmp(elf_name, "$a") ||
+			    !strcmp(elf_name, "$d") ||
+			    !strcmp(elf_name, "$t"))
+				continue;
+		}
+
 		if (opdsec && sym.st_shndx == opdidx) {
 			u32 offset = sym.st_value - opdshdr.sh_addr;
 			u64 *opd = opddata->d_buf + offset;
-- 
1.6.2.5


  parent reply	other threads:[~2010-08-10 20:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 20:15 [GIT PULL 0/9] perf/core fixes and improvements Arnaldo Carvalho de Melo
2010-08-10 20:15 ` [PATCH 1/9] perf ui: Shorten ui_browser member names Arnaldo Carvalho de Melo
2010-08-10 20:15 ` [PATCH 2/9] perf ui: Move ui_helpline routines to separate file in util/ui/ Arnaldo Carvalho de Melo
2010-08-10 20:15 ` [PATCH 3/9] perf ui: Move ui_progress " Arnaldo Carvalho de Melo
2010-08-10 20:15 ` [PATCH 4/9] perf ui: Move annotate browser to util/ui/browsers/ Arnaldo Carvalho de Melo
2010-08-10 20:15 ` [PATCH 5/9] perf ui: Move map " Arnaldo Carvalho de Melo
2010-08-10 20:15 ` Arnaldo Carvalho de Melo [this message]
2010-08-10 20:15 ` [PATCH 7/9] perf ui: Move hists " Arnaldo Carvalho de Melo
2010-08-10 20:15 ` [PATCH 8/9] perf ui: Complete the breakdown of util/newt.c Arnaldo Carvalho de Melo
2010-08-10 20:15 ` [PATCH 9/9] perf annotate: Sort by hottest lines in the TUI Arnaldo Carvalho de Melo

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=1281471339-10878-7-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=dave.martin@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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;
as well as URLs for NNTP newsgroup(s).