From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932514AbcE0Hiz (ORCPT ); Fri, 27 May 2016 03:38:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58746 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932472AbcE0Hix (ORCPT ); Fri, 27 May 2016 03:38:53 -0400 Date: Fri, 27 May 2016 09:38:48 +0200 From: Jiri Olsa To: Hekuang Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, jpoimboe@redhat.com, ak@linux.intel.com, eranian@google.com, namhyung@kernel.org, adrian.hunter@intel.com, sukadev@linux.vnet.ibm.com, masami.hiramatsu.pt@hitachi.com, tumanova@linux.vnet.ibm.com, kan.liang@intel.com, penberg@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 3/5] perf callchain: Add support for cross-platform unwind Message-ID: <20160527073848.GA30974@krava> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5747F380.4060107@huawei.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 27 May 2016 07:38:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 thanks, jirka