public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	emunson@mgebm.net
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] perf symbols: Preserve symbol scope when parsing /proc/kallsyms
Date: Wed, 24 Aug 2011 16:40:16 +1000	[thread overview]
Message-ID: <20110824065243.077125989@samba.org> (raw)
In-Reply-To: 20110824064013.205515988@samba.org

[-- Attachment #1: kallsyms_2 --]
[-- Type: text/plain, Size: 1134 bytes --]

kallsyms__parse capitalises the symbol type, so every symbol 
is marked global. Remove this and fix symbol_type__is_a to handle
both local and global symbols.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-2.6-tip/tools/perf/util/symbol.c
===================================================================
--- linux-2.6-tip.orig/tools/perf/util/symbol.c	2011-08-24 13:12:00.873072535 +1000
+++ linux-2.6-tip/tools/perf/util/symbol.c	2011-08-24 14:19:10.975819103 +1000
@@ -76,11 +76,13 @@ static void dso__set_sorted_by_name(stru
 
 bool symbol_type__is_a(char symbol_type, enum map_type map_type)
 {
+	symbol_type = toupper(symbol_type);
+
 	switch (map_type) {
 	case MAP__FUNCTION:
 		return symbol_type == 'T' || symbol_type == 'W';
 	case MAP__VARIABLE:
-		return symbol_type == 'D' || symbol_type == 'd';
+		return symbol_type == 'D';
 	default:
 		return false;
 	}
@@ -465,7 +467,7 @@ int kallsyms__parse(const char *filename
 		if (len + 2 >= line_len)
 			continue;
 
-		symbol_type = toupper(line[len]);
+		symbol_type = line[len];
 		len += 2;
 		symbol_name = line + len;
 		len = line_len - len;



  parent reply	other threads:[~2011-08-24  6:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24  6:40 [PATCH 0/4] perf symbol fixes Anton Blanchard
2011-08-24  6:40 ` [PATCH 1/4] perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files Anton Blanchard
2011-08-24  6:40 ` [PATCH 2/4] perf symbols: /proc/kallsyms does not sort module symbols Anton Blanchard
2011-08-24  6:40 ` Anton Blanchard [this message]
2011-08-24  6:40 ` [PATCH 4/4] perf symbols: Add some heuristics for choosing the best duplicate symbol Anton Blanchard

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=20110824065243.077125989@samba.org \
    --to=anton@samba.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=emunson@mgebm.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /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