Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176159
b: refs/heads/master
c: d45868d
h: refs/heads/master
i:
  176157: 133243a
  176155: ae78185
  176151: 4f75654
  176143: 998a161
  176127: a3c9286
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Dec 12, 2009
1 parent 5eb847d commit 102a020
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 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: 6893d4ee67cc100348088328cac73d56f7186aa3
refs/heads/master: d45868d38c1d08d50abf3e884710a938d19fa93c
24 changes: 22 additions & 2 deletions trunk/tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,26 @@ static int dso__synthesize_plt_symbols(struct dso *self, struct map *map,
return 0;
}

static bool elf_sym__is_a(GElf_Sym *self, enum map_type type)
{
switch (type) {
case MAP__FUNCTION:
return elf_sym__is_function(self);
default:
return false;
}
}

static bool elf_sec__is_a(GElf_Shdr *self, Elf_Data *secstrs, enum map_type type)
{
switch (type) {
case MAP__FUNCTION:
return elf_sec__is_text(self, secstrs);
default:
return false;
}
}

static int dso__load_sym(struct dso *self, struct map *map,
struct map_groups *mg, const char *name, int fd,
symbol_filter_t filter, int kernel, int kmodule)
Expand Down Expand Up @@ -825,7 +845,7 @@ static int dso__load_sym(struct dso *self, struct map *map,
int is_label = elf_sym__is_label(&sym);
const char *section_name;

if (!is_label && !elf_sym__is_function(&sym))
if (!is_label && !elf_sym__is_a(&sym, map->type))
continue;

sec = elf_getscn(elf, sym.st_shndx);
Expand All @@ -834,7 +854,7 @@ static int dso__load_sym(struct dso *self, struct map *map,

gelf_getshdr(sec, &shdr);

if (is_label && !elf_sec__is_text(&shdr, secstrs))
if (is_label && !elf_sec__is_a(&shdr, secstrs, map->type))
continue;

elf_name = elf_sym__name(&sym, symstrs);
Expand Down

0 comments on commit 102a020

Please sign in to comment.