Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169626
b: refs/heads/master
c: 8216416
h: refs/heads/master
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 16, 2009
1 parent 3f9b1a8 commit 18b1053
Show file tree
Hide file tree
Showing 2 changed files with 21 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: 559fdc3c1b624edb1933a875022fe7e27934d11c
refs/heads/master: 82164161679c448f33092945ea97cb547a13683a
26 changes: 20 additions & 6 deletions trunk/tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ static int kernel_maps__load_all_kallsyms(void)
if (sym == NULL)
goto out_delete_line;

/*
* We will pass the symbols to the filter later, in
* kernel_maps__split_kallsyms, when we have split the
* maps per module
*/
dso__insert_symbol(kernel_map->dso, sym);
}

Expand Down Expand Up @@ -555,7 +560,8 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
* And always look at the original dso, not at debuginfo packages, that
* have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS).
*/
static int dso__synthesize_plt_symbols(struct dso *self)
static int dso__synthesize_plt_symbols(struct dso *self, struct map *map,
symbol_filter_t filter)
{
uint32_t nr_rel_entries, idx;
GElf_Sym sym;
Expand Down Expand Up @@ -643,8 +649,12 @@ static int dso__synthesize_plt_symbols(struct dso *self)
if (!f)
goto out_elf_end;

dso__insert_symbol(self, f);
++nr;
if (filter && filter(map, f))
symbol__delete(f);
else {
dso__insert_symbol(self, f);
++nr;
}
}
} else if (shdr_rel_plt.sh_type == SHT_REL) {
GElf_Rel pos_mem, *pos;
Expand All @@ -661,8 +671,12 @@ static int dso__synthesize_plt_symbols(struct dso *self)
if (!f)
goto out_elf_end;

dso__insert_symbol(self, f);
++nr;
if (filter && filter(map, f))
symbol__delete(f);
else {
dso__insert_symbol(self, f);
++nr;
}
}
}

Expand Down Expand Up @@ -1050,7 +1064,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter)
goto more;

if (ret > 0) {
int nr_plt = dso__synthesize_plt_symbols(self);
int nr_plt = dso__synthesize_plt_symbols(self, map, filter);
if (nr_plt > 0)
ret += nr_plt;
}
Expand Down

0 comments on commit 18b1053

Please sign in to comment.