diff options
author | Mike Galbraith <efault@gmx.de> | 2009-07-20 08:01:38 -0400 |
---|---|---|
committer | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-07-22 12:05:58 -0400 |
commit | d20ff6bd6bba2e7e6681fa17565347b410c46ab3 (patch) | |
tree | ee66a9f5e73dd5deffdd012aa0d1e6d1628ba2af | |
parent | 5beeded123c5befa21f1c6e16219f2a3eb7dd197 (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>
-rw-r--r-- | tools/perf/util/symbol.c | 7 |
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, | |||
525 | GElf_Sym sym; | 525 | GElf_Sym sym; |
526 | Elf_Scn *sec, *sec_strndx; | 526 | Elf_Scn *sec, *sec_strndx; |
527 | Elf *elf; | 527 | Elf *elf; |
528 | int nr = 0; | 528 | int nr = 0, kernel = !strcmp("[kernel]", self->name); |
529 | 529 | ||
530 | elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); | 530 | elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); |
531 | if (elf == NULL) { | 531 | if (elf == NULL) { |
@@ -571,10 +571,13 @@ static int dso__load_sym(struct dso *self, int fd, const char *name, | |||
571 | nr_syms = shdr.sh_size / shdr.sh_entsize; | 571 | nr_syms = shdr.sh_size / shdr.sh_entsize; |
572 | 572 | ||
573 | memset(&sym, 0, sizeof(sym)); | 573 | memset(&sym, 0, sizeof(sym)); |
574 | self->adjust_symbols = (ehdr.e_type == ET_EXEC || | 574 | if (!kernel) { |
575 | self->adjust_symbols = (ehdr.e_type == ET_EXEC || | ||
575 | elf_section_by_name(elf, &ehdr, &shdr, | 576 | elf_section_by_name(elf, &ehdr, &shdr, |
576 | ".gnu.prelink_undo", | 577 | ".gnu.prelink_undo", |
577 | NULL) != NULL); | 578 | NULL) != NULL); |
579 | } else self->adjust_symbols = 0; | ||
580 | |||
578 | elf_symtab__for_each_symbol(syms, nr_syms, index, sym) { | 581 | elf_symtab__for_each_symbol(syms, nr_syms, index, sym) { |
579 | struct symbol *f; | 582 | struct symbol *f; |
580 | const char *name; | 583 | const char *name; |