]> git.baikalelectronics.ru Git - kernel.git/commit
perf symbols: Fix annotation of objects with debuginfo files
authorAnton Blanchard <anton@samba.org>
Sat, 13 Aug 2016 01:55:33 +0000 (11:55 +1000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 15 Aug 2016 19:49:57 +0000 (16:49 -0300)
commit742979b66c626a996406f464087ace30ecfd9578
treeeddffc76a0111b2ecdad105f949f2bfede7b906a
parentce81b236be7a60436e491f19affd6759903817c9
perf symbols: Fix annotation of objects with debuginfo files

Commit ab92a78f0c8f ("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.

Signed-off-by: Anton Blanchard <anton@samba.org>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tested-by: Wang Nan <wangnan0@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # v4.6+
Fixes: ab92a78f0c8f ("perf symbols: Record text offset in dso to calculate objdump address")
Link: http://lkml.kernel.org/r/20160813115533.6de17912@kryten
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol-elf.c