Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161477AbbKFNfY (ORCPT ); Fri, 6 Nov 2015 08:35:24 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:13152 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033190AbbKFNfX (ORCPT ); Fri, 6 Nov 2015 08:35:23 -0500 Message-ID: <563CAC7F.4040302@huawei.com> Date: Fri, 6 Nov 2015 21:34:55 +0800 From: "Wangnan (F)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: Adrian Hunter , , , , , , Subject: Re: [PATCH] perf symbols/KCORE: Rebuild rbtree when adjusting symbols for kcore References: <1446803172-83107-1-git-send-email-wangnan0@huawei.com> <20151106131950.GA13236@kernel.org> In-Reply-To: <20151106131950.GA13236@kernel.org> 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.0A020201.563CAC8A.012D,ss=1,re=0.000,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2011-05-27 18:58:46 X-Mirapoint-Loop-Id: 481be537caa1a2f8cd552ee039ceed85 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1980 Lines: 49 On 2015/11/6 21:19, Arnaldo Carvalho de Melo wrote: > Em Fri, Nov 06, 2015 at 09:46:12AM +0000, Wang Nan escreveu: >> In dso__split_kallsyms_for_kcore(), current code adjusts symbol's >> address but only reinsert it into rbtree if the symbol belongs to >> another map. However, the expression for adjusting symbol (pos->start -= >> curr_map->start - curr_map->pgoff) can change the relative order between >> two symbols (even if the affected symbols are in different maps, in >> kcore case they are possible to share one same dso), which damages the >> rbtree. > Right, some code does change the symbol values it gets from whatever > symtab (kallsyms, ELF, JIT maps, etc) when it should instead use the per > map data structure (struct map) and its ->{map,unmap}_ip, ->pgoff, > ->reloc, members for that :-\ > > I.e. 'struct dso' should be just what comes from the symtab, while > 'struct map' should be about where that DSO is in memory. > > With that in mind, do you still think your fix is the correct one? Not very sure. I'm not familar with this part of code. Actually speaking I don't understand the relationship between what you said and what I found... I spent a whole day to answer Masami's question that why kernel_get_symbol_address_by_name success but __find_kernel_function() fail in my platform, and described it in commit message. This patch is the best one I can find. It solves my problem but may be incorrect. Just want you and other know my result. Please let me know if you and other want further information. Now its pirority is low because patch 98d3b25 and Masami's update are already enough for me. I'll go back to BPF stuff. There are still much work to do :-) Thank you. > Adrian? > > - Arnaldo > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/