From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2B088A0524; Thu, 6 May 2021 11:32:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2FD1410DB; Thu, 6 May 2021 11:32:01 +0200 (CEST) Received: from dal1relay136.mxroute.com (dal1relay136.mxroute.com [199.181.239.136]) by mails.dpdk.org (Postfix) with ESMTP id 28CCA40040 for ; Thu, 6 May 2021 11:32:00 +0200 (CEST) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by dal1relay136.mxroute.com (ZoneMTA) with ESMTPSA id 1794104fce100036f9.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Thu, 06 May 2021 09:31:56 +0000 X-Zone-Loop: 47d78c5c961cfe685ab19957d12592e82ffde531e165 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=CP4y2HqteTFpQzZVI4XPMLawSihwDughN1SQMwcgf6M=; b=ZiGTqGMwY8GVO9W1Bfut6qJOzd WAGi4zoIX26TJXeHXJ9jshjNmWdbLsxK7jlU+KGF/XujrM6LL6929Z8Z9TC1QlZ7Y2xR5qhCYCb0H PLED57WsHsf8SngtafvtnGETxKp1Du+ZxOixFpqe2SoJJ06vSj7AH5itnOIR+F++8XePhUxnVi2YP KTkn52+ZkMKOsY8ZoAHjSz54fEYExD5hgDq+OIglyV+mfBuXgmjKQ1C2mt9w+SxgMhpR1gRy/Db0v nKFkl4TClBO/2S/Ifu0k4r+FM/zFbbrNHscZmKLgEDsA7fJ9FSFfGxheIW7uKnq1VmKkmaS44YAD4 yMdNLqVA==; To: David Marchand , dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, bruce.richardson@intel.com, Neil Horman References: <20210225111457.32540-1-david.marchand@redhat.com> <20210505143001.14178-1-david.marchand@redhat.com> <20210505143001.14178-2-david.marchand@redhat.com> From: "Kinsella, Ray" Message-ID: Date: Thu, 6 May 2021 10:31:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210505143001.14178-2-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: Re: [dpdk-dev] [PATCH v2 2/2] buildtools: check symbol maps in developer mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 05/05/2021 15:30, David Marchand wrote: > Hook check-symbol-maps.sh in the symbol check when in developer mode to > help developers catch issues before submitting their changes. > > Signed-off-by: David Marchand > --- > Changes since v1: > - now that we have the developer mode, added this check in the build > process, > > --- > buildtools/check-symbols.sh | 9 ++++++++- > devtools/check-symbol-maps.sh | 12 ++++++++---- > 2 files changed, 16 insertions(+), 5 deletions(-) > > diff --git a/buildtools/check-symbols.sh b/buildtools/check-symbols.sh > index 83b3a0182f..e458c0af72 100755 > --- a/buildtools/check-symbols.sh > +++ b/buildtools/check-symbols.sh > @@ -5,7 +5,9 @@ > MAPFILE=$1 > OBJFILE=$2 > > -LIST_SYMBOL=$(dirname $(readlink -f $0))/map-list-symbol.sh > +ROOTDIR=$(readlink -f $(dirname $(readlink -f $0))/..) > +LIST_SYMBOL=$ROOTDIR/buildtools/map-list-symbol.sh > +CHECK_SYMBOL_MAPS=$ROOTDIR/devtools/check-symbol-maps.sh > > # added check for "make -C test/" usage > if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ] > @@ -23,6 +25,11 @@ trap 'rm -f "$DUMPFILE"' EXIT > objdump -t $OBJFILE >$DUMPFILE > > ret=0 > + > +if ! $CHECK_SYMBOL_MAPS $MAPFILE; then > + ret=1 > +fi > + > for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3` > do > if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE && > diff --git a/devtools/check-symbol-maps.sh b/devtools/check-symbol-maps.sh > index f2c7d29663..c52e28bd69 100755 > --- a/devtools/check-symbol-maps.sh > +++ b/devtools/check-symbol-maps.sh > @@ -7,11 +7,15 @@ cd $(dirname $0)/.. > # speed up by ignoring Unicode details > export LC_ALL=C > > +if [ $# = 0 ] ; then > + set -- $(find lib drivers -name '*.map') > +fi > + > ret=0 > > find_orphan_symbols () > { > - for map in $(find lib drivers -name '*.map') ; do > + for map in $@ ; do > for sym in $(sed -rn 's,^([^}]*_.*);.*$,\1,p' $map) ; do > if echo $sym | grep -q '^per_lcore_' ; then > symsrc=${sym#per_lcore_} > @@ -28,7 +32,7 @@ find_orphan_symbols () > done > } > > -orphan_symbols=$(find_orphan_symbols) > +orphan_symbols=$(find_orphan_symbols $@) > if [ -n "$orphan_symbols" ] ; then > echo "Found only in symbol map file:" > echo "$orphan_symbols" | sed 's,^,\t,' > @@ -37,13 +41,13 @@ fi > > find_duplicate_symbols () > { > - for map in $(find lib drivers -name '*.map') ; do > + for map in $@ ; do > buildtools/map-list-symbol.sh $map | \ > sort | uniq -c | grep -v " 1 $map" || true > done > } > > -duplicate_symbols=$(find_duplicate_symbols) > +duplicate_symbols=$(find_duplicate_symbols $@) > if [ -n "$duplicate_symbols" ] ; then > echo "Found duplicates in symbol map file:" > echo "$duplicate_symbols" > +1 Reviewed-by: Ray Kinsella