From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752106AbcHOHRS (ORCPT ); Mon, 15 Aug 2016 03:17:18 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:6977 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112AbcHOHRQ (ORCPT ); Mon, 15 Aug 2016 03:17:16 -0400 Subject: Re: [PATCH v2] perf symbols: Fix annotation of objects with debuginfo files To: Anton Blanchard , Peter Zijlstra , Ingo Molnar , "Arnaldo Carvalho de Melo" , "Naveen N. Rao" , Ravi Bangoria , References: <20160812163505.4fa6a699@kryten> <20160813115533.6de17912@kryten> From: "Wangnan (F)" Message-ID: <57B16BAB.2010003@huawei.com> Date: Mon, 15 Aug 2016 15:13:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160813115533.6de17912@kryten> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.66.109] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.57B16C0C.00D7,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 70a0f03d31859bd0fdbc06257fa5af52 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016/8/13 9:55, Anton Blanchard wrote: > From: Anton Blanchard > > 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 I don't quite understand the debuginfo problem. I tested this patch follow steps recorded in commit 99e87f7 and see no problem. Tested-by: Wang Nan Thank you.