Commit 31877908 authored by Anton Blanchard's avatar Anton Blanchard Committed by Arnaldo Carvalho de Melo

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.orgSigned-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3f5a4272
...@@ -74,11 +74,13 @@ static void dso__set_sorted_by_name(struct dso *dso, enum map_type type) ...@@ -74,11 +74,13 @@ static void dso__set_sorted_by_name(struct dso *dso, enum map_type type)
bool symbol_type__is_a(char symbol_type, enum map_type map_type) bool symbol_type__is_a(char symbol_type, enum map_type map_type)
{ {
symbol_type = toupper(symbol_type);
switch (map_type) { switch (map_type) {
case MAP__FUNCTION: case MAP__FUNCTION:
return symbol_type == 'T' || symbol_type == 'W'; return symbol_type == 'T' || symbol_type == 'W';
case MAP__VARIABLE: case MAP__VARIABLE:
return symbol_type == 'D' || symbol_type == 'd'; return symbol_type == 'D';
default: default:
return false; return false;
} }
...@@ -463,7 +465,7 @@ int kallsyms__parse(const char *filename, void *arg, ...@@ -463,7 +465,7 @@ int kallsyms__parse(const char *filename, void *arg,
if (len + 2 >= line_len) if (len + 2 >= line_len)
continue; continue;
symbol_type = toupper(line[len]); symbol_type = line[len];
len += 2; len += 2;
symbol_name = line + len; symbol_name = line + len;
len = line_len - len; len = line_len - len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment