diff options
author | Thomas Richter <tmricht@linux.vnet.ibm.com> | 2017-09-15 03:14:03 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-09-28 12:01:42 -0400 |
commit | b28503a3fe6400757817e4460090f96bc1b9d6e7 (patch) | |
tree | a83f326102505f93f686305cc0397be6620137b9 | |
parent | 090657c9fb7094e4c1b05c1713d6c2a12ef43dea (diff) |
perf test: Fix vmlinux failure on s390x
On s390x perf test 1 failed. It turned out that commit 4a084ecfc821
("perf report: Fix module symbol adjustment for s390x") was incorrect.
The previous implementation in dso__load_sym() is also suitable for
s390x.
Therefore this patch undoes commit 4a084ecfc821.
Signed-off-by: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Cc: Zvonko Kosic <zvonko.kosic@de.ibm.com>
Fixes: 4a084ecfc821 ("perf report: Fix module symbol adjustment for s390x")
LPU-Reference: 20170915071404.58398-1-tmricht@linux.vnet.ibm.com
Link: http://lkml.kernel.org/n/tip-5ani7ly57zji7s0hmzkx416l@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/arch/s390/util/sym-handling.c | 8 | ||||
-rw-r--r-- | tools/perf/util/symbol-elf.c | 8 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 3 |
3 files changed, 1 insertions, 18 deletions
diff --git a/tools/perf/arch/s390/util/sym-handling.c b/tools/perf/arch/s390/util/sym-handling.c index e103f6e46afe..581d4c5a896b 100644 --- a/tools/perf/arch/s390/util/sym-handling.c +++ b/tools/perf/arch/s390/util/sym-handling.c | |||
@@ -18,12 +18,4 @@ bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) | |||
18 | return false; | 18 | return false; |
19 | return ehdr.e_type == ET_REL || ehdr.e_type == ET_DYN; | 19 | return ehdr.e_type == ET_REL || ehdr.e_type == ET_DYN; |
20 | } | 20 | } |
21 | |||
22 | void arch__adjust_sym_map_offset(GElf_Sym *sym, | ||
23 | GElf_Shdr *shdr __maybe_unused, | ||
24 | struct map *map) | ||
25 | { | ||
26 | if (map->type == MAP__FUNCTION) | ||
27 | sym->st_value += map->start; | ||
28 | } | ||
29 | #endif | 21 | #endif |
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 5c39f420111e..9cf781f0d8a2 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c | |||
@@ -810,12 +810,6 @@ static u64 ref_reloc(struct kmap *kmap) | |||
810 | void __weak arch__sym_update(struct symbol *s __maybe_unused, | 810 | void __weak arch__sym_update(struct symbol *s __maybe_unused, |
811 | GElf_Sym *sym __maybe_unused) { } | 811 | GElf_Sym *sym __maybe_unused) { } |
812 | 812 | ||
813 | void __weak arch__adjust_sym_map_offset(GElf_Sym *sym, GElf_Shdr *shdr, | ||
814 | struct map *map __maybe_unused) | ||
815 | { | ||
816 | sym->st_value -= shdr->sh_addr - shdr->sh_offset; | ||
817 | } | ||
818 | |||
819 | int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, | 813 | int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, |
820 | struct symsrc *runtime_ss, int kmodule) | 814 | struct symsrc *runtime_ss, int kmodule) |
821 | { | 815 | { |
@@ -996,7 +990,7 @@ int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, | |||
996 | 990 | ||
997 | /* Adjust symbol to map to file offset */ | 991 | /* Adjust symbol to map to file offset */ |
998 | if (adjust_kernel_syms) | 992 | if (adjust_kernel_syms) |
999 | arch__adjust_sym_map_offset(&sym, &shdr, map); | 993 | sym.st_value -= shdr.sh_addr - shdr.sh_offset; |
1000 | 994 | ||
1001 | if (strcmp(section_name, | 995 | if (strcmp(section_name, |
1002 | (curr_dso->short_name + | 996 | (curr_dso->short_name + |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 2bd6a1f01a1c..aad99e7e179b 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -344,9 +344,6 @@ int setup_intlist(struct intlist **list, const char *list_str, | |||
344 | #ifdef HAVE_LIBELF_SUPPORT | 344 | #ifdef HAVE_LIBELF_SUPPORT |
345 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr); | 345 | bool elf__needs_adjust_symbols(GElf_Ehdr ehdr); |
346 | void arch__sym_update(struct symbol *s, GElf_Sym *sym); | 346 | void arch__sym_update(struct symbol *s, GElf_Sym *sym); |
347 | void arch__adjust_sym_map_offset(GElf_Sym *sym, | ||
348 | GElf_Shdr *shdr __maybe_unused, | ||
349 | struct map *map __maybe_unused); | ||
350 | #endif | 347 | #endif |
351 | 348 | ||
352 | #define SYMBOL_A 0 | 349 | #define SYMBOL_A 0 |