summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2009-07-20 14:01:38 +0200
committerPeter Zijlstra <a.p.zijlstra@chello.nl>2009-07-22 18:05:58 +0200
commitd20ff6bd6bba2e7e6681fa17565347b410c46ab3 (patch)
treeee66a9f5e73dd5deffdd012aa0d1e6d1628ba2af /tools/perf
parent5beeded123c5befa21f1c6e16219f2a3eb7dd197 (diff)
perf_counter tools: Fix vmlinux symbol generation breakage
vmlinux meets the criteria for symbol adjustment, which breaks vmlinux generated symbols. Fix this by exempting vmlinux. This is a bit fragile in that someone could change the kernel dso's name, but currently that name is also hardwired. Signed-off-by: Mike Galbraith <efault@gmx.de> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1248091298.18702.18.camel@marge.simson.net>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/symbol.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 98aee922acca..28106059bf12 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -525,7 +525,7 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
GElf_Sym sym;
Elf_Scn *sec, *sec_strndx;
Elf *elf;
- int nr = 0;
+ int nr = 0, kernel = !strcmp("[kernel]", self->name);
elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
if (elf == NULL) {
@@ -571,10 +571,13 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
nr_syms = shdr.sh_size / shdr.sh_entsize;
memset(&sym, 0, sizeof(sym));
- self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
+ if (!kernel) {
+ self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
elf_section_by_name(elf, &ehdr, &shdr,
".gnu.prelink_undo",
NULL) != NULL);
+ } else self->adjust_symbols = 0;
+
elf_symtab__for_each_symbol(syms, nr_syms, index, sym) {
struct symbol *f;
const char *name;