Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1462174
| From | "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] perf symbols: Fix annotation of objects with debuginfo files |
| Date | 2016-08-14 19:00 +0200 |
| Message-ID | <s66Vs-265-25@gated-at.bofh.it> (permalink) |
| References | <s5eil-6wT-1@gated-at.bofh.it> <s5woV-1ni-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2016/08/13 11:55AM, Anton Blanchard wrote:
> From: Anton Blanchard <anton@samba.org>
>
> Commit 73cdf0c6ea9c ("perf symbols: Record text offset in dso
> to calculate objdump address") started storing the offset of
> the text section for all DSOs:
>
> if (elf_section_by_name(elf, &ehdr, &tshdr, ".text", NULL))
> dso->text_offset = tshdr.sh_addr - tshdr.sh_offset;
>
> Unfortunately this breaks debuginfo files, because we need to calculate
> the offset of the text section in the associated executable file. As a
> result perf annotate returns junk for all debuginfo files.
>
> Fix this by using runtime_ss->elf which should point at the executable
> when parsing a debuginfo file.
>
> Cc: stable@vger.kernel.org # v4.6+
> Fixes: 73cdf0c6ea9c ("perf symbols: Record text offset in dso to calculate objdump address")
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> v2: Fix from Naveen
>
> diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
> index a34321e..a811c13 100644
> --- a/tools/perf/util/symbol-elf.c
> +++ b/tools/perf/util/symbol-elf.c
> @@ -837,7 +837,8 @@ int dso__load_sym(struct dso *dso, struct map *map,
> sec = syms_ss->symtab;
> shdr = syms_ss->symshdr;
>
> - if (elf_section_by_name(elf, &ehdr, &tshdr, ".text", NULL))
> + if (elf_section_by_name(runtime_ss->elf, &runtime_ss->ehdr, &tshdr,
> + ".text", NULL))
> dso->text_offset = tshdr.sh_addr - tshdr.sh_offset;
>
> if (runtime_ss->opdsec)
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thanks Anton!
- Naveen
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] perf symbols: Fix annotation of objects with debuginfo files Anton Blanchard <anton@au1.ibm.com> - 2016-08-12 08:40 +0200
Re: [PATCH] perf symbols: Fix annotation of objects with debuginfo files Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-12 15:10 +0200
Re: [PATCH] perf symbols: Fix annotation of objects with debuginfo files "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-08-12 18:50 +0200
[PATCH v2] perf symbols: Fix annotation of objects with debuginfo files Anton Blanchard <anton@au1.ibm.com> - 2016-08-13 04:00 +0200
Re: [PATCH v2] perf symbols: Fix annotation of objects with debuginfo files "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-08-14 19:00 +0200
Re: [PATCH v2] perf symbols: Fix annotation of objects with debuginfo files "Wangnan (F)" <wangnan0@huawei.com> - 2016-08-15 09:20 +0200
Re: [PATCH v2] perf symbols: Fix annotation of objects with debuginfo files "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2016-08-15 18:50 +0200
Re: [PATCH v2] perf symbols: Fix annotation of objects with debuginfo files Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-15 21:50 +0200
[tip:perf/urgent] perf symbols: Fix annotation of objects with debuginfo files tip-bot for Anton Blanchard <tipbot@zytor.com> - 2016-08-16 20:20 +0200
csiph-web