aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-08-24 02:40:16 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-09-23 13:36:25 -0400
commit318779086086f46127a249878eeebb3dc80578eb (patch)
treee75fe854b2a6ae9bf2aed3a40e7614d65e5b05db /tools/perf/util/symbol.c
parent3f5a42722b9e78a434d5a4ee5e607dc33c69ac80 (diff)
perf symbols: Preserve symbol scope when parsing /proc/kallsyms
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. Cc: Eric B Munson <emunson@mgebm.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20110824065243.077125989@samba.org Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index f119e85dc6c2..0d94ddb55bd7 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -74,11 +74,13 @@ static void dso__set_sorted_by_name(struct dso *dso, enum map_type type)
74 74
75bool symbol_type__is_a(char symbol_type, enum map_type map_type) 75bool symbol_type__is_a(char symbol_type, enum map_type map_type)
76{ 76{
77 symbol_type = toupper(symbol_type);
78
77 switch (map_type) { 79 switch (map_type) {
78 case MAP__FUNCTION: 80 case MAP__FUNCTION:
79 return symbol_type == 'T' || symbol_type == 'W'; 81 return symbol_type == 'T' || symbol_type == 'W';
80 case MAP__VARIABLE: 82 case MAP__VARIABLE:
81 return symbol_type == 'D' || symbol_type == 'd'; 83 return symbol_type == 'D';
82 default: 84 default:
83 return false; 85 return false;
84 } 86 }
@@ -463,7 +465,7 @@ int kallsyms__parse(const char *filename, void *arg,
463 if (len + 2 >= line_len) 465 if (len + 2 >= line_len)
464 continue; 466 continue;
465 467
466 symbol_type = toupper(line[len]); 468 symbol_type = line[len];
467 len += 2; 469 len += 2;
468 symbol_name = line + len; 470 symbol_name = line + len;
469 len = line_len - len; 471 len = line_len - len;