Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176158
b: refs/heads/master
c: 6893d4e
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Dec 12, 2009
1 parent 133243a commit 5eb847d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9958e1f0aee632c3665162c9c93cf8fde8006a94
refs/heads/master: 6893d4ee67cc100348088328cac73d56f7186aa3
4 changes: 2 additions & 2 deletions trunk/tools/perf/util/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ void event__print_totals(void);

enum map_type {
MAP__FUNCTION = 0,

MAP__NR_TYPES,
};

#define MAP__NR_TYPES (MAP__FUNCTION + 1)

struct map {
union {
struct rb_node rb_node;
Expand Down
15 changes: 11 additions & 4 deletions trunk/tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ static void dso__set_loaded(struct dso *self, enum map_type type)
self->loaded |= (1 << type);
}

static bool symbol_type__is_a(char symbol_type, enum map_type map_type)
{
switch (map_type) {
case MAP__FUNCTION:
return symbol_type == 'T' || symbol_type == 'W';
default:
return false;
}
}

static void symbols__fixup_end(struct rb_root *self)
{
struct rb_node *nd, *prevnd = rb_first(self);
Expand Down Expand Up @@ -327,10 +337,7 @@ static int dso__load_all_kallsyms(struct dso *self, struct map *map)
continue;

symbol_type = toupper(line[len]);
/*
* We're interested only in code ('T'ext)
*/
if (symbol_type != 'T' && symbol_type != 'W')
if (!symbol_type__is_a(symbol_type, map->type))
continue;

symbol_name = line + len + 2;
Expand Down

0 comments on commit 5eb847d

Please sign in to comment.