From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932641AbcE0IF4 (ORCPT ); Fri, 27 May 2016 04:05:56 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:10524 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077AbcE0IFw (ORCPT ); Fri, 27 May 2016 04:05:52 -0400 Subject: Re: [PATCH v5 3/5] perf callchain: Add support for cross-platform unwind To: Jiri Olsa References: <1464081629-137191-1-git-send-email-hekuang@huawei.com> <1464081629-137191-4-git-send-email-hekuang@huawei.com> <20160526174255.GA11246@krava> <5747F380.4060107@huawei.com> <20160527073848.GA30974@krava> CC: , , , , , , , , , , , , , , , , From: Hekuang Message-ID: <5747FF33.3070906@huawei.com> Date: Fri, 27 May 2016 16:02:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160527073848.GA30974@krava> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.110.55.166] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5747FF4E.0098,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: d949cc580a9b3df6184a94a6682729e8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2016/5/27 15:38, Jiri Olsa 写道: > On Fri, May 27, 2016 at 03:13:04PM +0800, Hekuang wrote: > > SNIP > >>> - I understand we need to compile 3 objects from unwind-libunwind.c, >>> how about we create 3 files like: >>> >>> util/unwind-libunwind-local.c >>> util/unwind-libunwind-x86_32.c >>> util/unwind-libunwind-arm64.c >>> >>> which would setup all necessary defines and include unwind-libunwind.c like: >>> >>> --- >>> /* comments explaining every define ;-) */ >>> ... >>> #define LOCAL... REMOTE.. >>> ... >>> #include >>> ... >>> ---- >>> >>> this way we will keep all the special setup for given unwind object >>> in one place and you can also use simple rule in the Build file like >>> without defining special rule: >>> >>> libperf-$(CONFIG_LIBUNWIND_X86) += unwind-libunwind_x86_32.o >>> libperf-$(CONFIG_LIBUNWIND_AARCH64) += unwind-libunwind_arm64.o >>> >>> the same way for the arch object: >>> >>> arch/x86/util/unwind-libunwind-local.c >>> arch/x86/util/unwind-libunwind-x86_32.c >>> >>> >>> Not sure I thought everything through, but I think this way >>> we'll keep it more maintainable and readable.. >>> >>> let me know what you think >> The only concern is that, if later we support more platforms, >> there will be too much files named as 'tools/perf/util/unwind-libunwind*.c' >> Is it acceptable or not? >> >> And I thought all files belongs to specific archs should >> go to folder under 'tools/perf/arch/xxx', is that right? > hum, I wouldn't worry about that.. but you're right, > let's put them under arch But only 'tools/perf/arch/$(host platform)' will be built, in our case, we should built the unwind-libunwind-$(arch) as long as we have the remote libunwind libraries. So, I think there's a conflict in the existing build script and not easy to 'put them under arch'. That's why I choose a complex way in my previous patch. Do you have some suggestions? > > thanks, > jirka >