aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/event.h4
-rw-r--r--tools/perf/util/symbol.c15
2 files changed, 13 insertions, 6 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index c7a78eef8e52..d9a65d91e925 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -103,10 +103,10 @@ void event__print_totals(void);
103 103
104enum map_type { 104enum map_type {
105 MAP__FUNCTION = 0, 105 MAP__FUNCTION = 0,
106
107 MAP__NR_TYPES,
108}; 106};
109 107
108#define MAP__NR_TYPES (MAP__FUNCTION + 1)
109
110struct map { 110struct map {
111 union { 111 union {
112 struct rb_node rb_node; 112 struct rb_node rb_node;
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 936202342949..bb21c96e8e15 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -56,6 +56,16 @@ static void dso__set_loaded(struct dso *self, enum map_type type)
56 self->loaded |= (1 << type); 56 self->loaded |= (1 << type);
57} 57}
58 58
59static bool symbol_type__is_a(char symbol_type, enum map_type map_type)
60{
61 switch (map_type) {
62 case MAP__FUNCTION:
63 return symbol_type == 'T' || symbol_type == 'W';
64 default:
65 return false;
66 }
67}
68
59static void symbols__fixup_end(struct rb_root *self) 69static void symbols__fixup_end(struct rb_root *self)
60{ 70{
61 struct rb_node *nd, *prevnd = rb_first(self); 71 struct rb_node *nd, *prevnd = rb_first(self);
@@ -327,10 +337,7 @@ static int dso__load_all_kallsyms(struct dso *self, struct map *map)
327 continue; 337 continue;
328 338
329 symbol_type = toupper(line[len]); 339 symbol_type = toupper(line[len]);
330 /* 340 if (!symbol_type__is_a(symbol_type, map->type))
331 * We're interested only in code ('T'ext)
332 */
333 if (symbol_type != 'T' && symbol_type != 'W')
334 continue; 341 continue;
335 342
336 symbol_name = line + len + 2; 343 symbol_name = line + len + 2;