From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id B5ECE2935 for ; Fri, 28 Apr 2017 10:50:21 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6086420A76; Fri, 28 Apr 2017 04:50:21 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 28 Apr 2017 04:50:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=mSmP6z4gYfqN9yz 1Mrd84Ts/ZjlM7NW+xuSRDQGtHag=; b=hKdeYeKz3CTqhhWh0BhJHshvB4T3H2J lt9lFmRNx4vT/MnhCPxniR0XmsCBY6/prx6xHE/qshlr2WohbgBbqQF9Qux3HxlO 4YXEABZRfSAoDkRaJfByT8fWWg0rFiKSxdXCqfepahlnb44bn5ZsdE8bWIrnTk0o w4RznapPeGjA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=mSmP6z4gYfqN9yz1Mrd84Ts/ZjlM7NW+xuSRDQGtHag=; b=Ut+FA0Dh pYO2DlpDNWYPdRomstBMmiWAxzEjyhZOh6hz1rvw7COyjJqs90kvAt+iEm/u4CnP vDphahKerKZxyjKibQHLRXDufz9dehkfDwXpR//xS7nGOzB0z+Ib4otib9be+qpC P39s0y4OdoKUVeR2dU09fvCcig8pE0HvUvIq1lAhR6DDJ90/EyNzPKM9+iJKVm02 Mx3mVh1fHZT3mXCnren7gZeoNa2czcXpZywsaOJXg/EljxOYSV44NN/3WsLHNjQV kkkNu+RSOsmG4vMARuk51kN6V9N2vpNHF2+fHMrGFxoTjeomRt5bq6Fhq7i3jjAD uhcx2J50nofnew== X-ME-Sender: X-Sasl-enc: XzTGR64XFWSWj6K0Sk7Q7BrDddpogL1vhjNcQiuxE2U8 1493369421 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 0E856248AF; Fri, 28 Apr 2017 04:50:21 -0400 (EDT) From: Thomas Monjalon To: Jerin Jacob Cc: dev@dpdk.org Date: Fri, 28 Apr 2017 10:50:20 +0200 Message-ID: <8009775.Gk3kvYMmnN@xps> In-Reply-To: <1490171404-16828-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1489920738-16247-1-git-send-email-jerin.jacob@caviumnetworks.com> <1490171404-16828-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v5] devtools: add tags and cscope index file generation support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2017 08:50:22 -0000 Hi, I have some comments about behaviour, naming and coding style. 22/03/2017 09:30, Jerin Jacob: > +verbose=false > +linuxapp=false > +bsdapp=false linuxapp/bsdapp could be renamed to simpler linux/bsd. > +x86_64=false > +arm=false Why not arm32 for consistency? > +arm64=false > +ia_32=false ia_32 should be x86_32 > +ppc_64=false [...] > + make showconfigs | sed 's,^,\t,' This is assuming the working dir is the dpdk root. It is assumed elsewhere in the script. I suggest adding "cd $(dirname $0)/.." at the beginning of the script. [...] > +arm_common() > +{ > + find_sources "lib/librte_eal/common/arch/arm" '*.[chS]' > + find_sources "$source_dirs" '*neon*.[chS]' > +} > + > +arm_sources() > +{ > + arm_common > + find_sources "lib/librte_eal/common/include/arch/arm" '*.[chS]' \ > + "$skip_64b_files" > +} > + > +arm64_sources() > +{ > + arm_common > + find_sources "lib/librte_eal/common/include/arch/arm" '*.[chS]' \ > + "$skip_32b_files" > + find_sources "$source_dirs" '*arm64.[chS]' > +} Same comment about arm32 consistency. > +ia_common() > +{ > + find_sources "lib/librte_eal/common/arch/x86" '*.[chS]' > + > + find_sources "examples/performance-thread/common/arch/x86" '*.[chS]' > + find_sources "$source_dirs" '*_sse*.[chS]' > + find_sources "$source_dirs" '*_avx*.[chS]' > + find_sources "$source_dirs" '*x86.[chS]' > +} > + > +i686_sources() > +{ > + ia_common > + find_sources "lib/librte_eal/common/include/arch/x86" '*.[chS]' \ > + "$skip_64b_files" > +} > + > +x86_64_sources() > +{ > + ia_common > + find_sources "lib/librte_eal/common/include/arch/x86" '*.[chS]' \ > + "$skip_32b_files" > +} ... and here x86/x86_32 instead of ia/i686 > +config_file() > +{ > + if [ -f $RTE_SDK/$RTE_TARGET/include/rte_config.h ]; then > + ls $RTE_SDK/$RTE_TARGET/include/rte_config.h > + fi > +} RTE_TARGET is used to define the build directory. It will not be defined in this script and it does not really make sense to enforce it. I suggest to remove rte_config.h from this script. Other argument: you can have several build directories with different configs. [...] > +check_valid_config() It is not a config but a target. Yes the target is checked against existing config template names. > +{ > + cfgfound=false > + allconfigs=$(make showconfigs) > + for cfg in $allconfigs > + do This "do" keyword could be on the previous line, like you did for if...then. > + if [ "$cfg" = "$1" ] ; then > + cfgfound=true > + fi > + done > + $cfgfound || echo "Invalid config: $1" > + $cfgfound || print_usage > + $cfgfound || exit 0 Better to use an "if" block here. [...] > + if [ $(echo $2 | grep -c "linuxapp-") -gt 0 ]; then > + linuxapp=true > + fi More compact grep: if echo $2 | grep -q "linuxapp-" ; then [...] > +else > + linuxapp=true > + bsdapp=true > + x86_64=true > + arm=true > + arm64=true > + ia_32=true > + ppc_64=true > +fi You could define them as true by default. So the above grep would become: echo $2 | grep -q "linuxapp-" || linux=false [...] > +all_sources() > +{ > + common_sources > + $linuxapp && linuxapp_sources > + $bsdapp && bsdapp_sources > + $x86_64 && x86_64_sources > + $ia_32 && i686_sources > + $arm && arm_sources > + $arm64 && arm64_sources > + $ppc_64 && ppc64_sources I am a bit surprised by these constructs. When using sh -e, we should not have a false statement. I think it should be: if $linuxapp ; then linuxapp_sources ; fi [...] > +show_flags() > +{ > + $verbose && echo "mode: $1" > + $verbose && echo "config: $2" > + $verbose && echo "linuxapp: $linuxapp" > + $verbose && echo "bsdapp: $bsdapp" > + $verbose && echo "ia_32: $ia_32" > + $verbose && echo "x86_64: $x86_64" > + $verbose && echo "arm: $arm" > + $verbose && echo "arm64: $arm64" > + $verbose && echo "ppc_64: $ppc_64" Please use an "if" block here. > +++ b/mk/rte.sdkroot.mk > +.PHONY: cscope gtags tags etags > +cscope gtags tags etags: > +ifdef T > + $(Q)$(RTE_SDK)/devtools/build-tags.sh $@ ${T} > +else > + $(Q)$(RTE_SDK)/devtools/build-tags.sh $@ > +endif No need of ifdef. Thanks Jerin