From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 897711200A for ; Mon, 22 Jan 2018 02:55:23 +0100 (CET) Received: from cpe-2606-a000-111b-4011-215-ff-fecc-4872.dyn6.twc.com ([2606:a000:111b:4011:215:ff:fecc:4872] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1edRKA-0006BE-Gr; Sun, 21 Jan 2018 20:55:19 -0500 Date: Sun, 21 Jan 2018 20:54:29 -0500 From: Neil Horman To: Thomas Monjalon Cc: dev@dpdk.org, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit , Stephen Hemminger Message-ID: <20180122015429.GC5415@neilslaptop.think-freely.org> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180116182225.27133-1-nhorman@tuxdriver.com> <10549424.KHioEKbQpN@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10549424.KHioEKbQpN@xps> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [dpdk-dev] [PATCH v2] checkpatches.sh: Add checks for ABI symbol addition 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: Mon, 22 Jan 2018 01:55:23 -0000 On Sun, Jan 21, 2018 at 09:29:18PM +0100, Thomas Monjalon wrote: > Hi, > > 16/01/2018 19:22, Neil Horman: > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > Developers and Maintainers Tools > > M: Thomas Monjalon > > +M: Neil Horman > > F: MAINTAINERS > > F: devtools/check-dup-includes.sh > > F: devtools/check-maintainers.sh > > @@ -52,6 +53,7 @@ F: devtools/get-maintainer.sh > > F: devtools/git-log-fixes.sh > > F: devtools/load-devel-config > > F: devtools/test-build.sh > > +F: devtools/validate-new-api.sh > > F: license/ > > I really think it should be in the section "ABI versioning"" > I can do that. > > --- a/devtools/checkpatches.sh > > +++ b/devtools/checkpatches.sh > > +export VALIDATE_NEW_API=$(dirname $(readlink -e $0))/validate-new-api.sh > > Why export? > As I recall I had needed that in an earlier incantation of this script, but its likely not needed any longer > > print_usage () { > > cat <<- END_OF_HELP > > + $(dirname $0) > > usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] > > This dirname is a debug leftover? Yes. > > > @@ -96,9 +100,25 @@ check () { # > > else > > report=$($DPDK_CHECKPATCH_PATH $options - 2>/dev/null) > > fi > > - [ $? -ne 0 ] || return 0 > > + reta=$? > > What means reta? > just a subindex on a return code. > > + > > $verbose || printf '\n### %s\n\n' "$3" > > printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' > > + > > + echo > > + echo "Checking API additions/removals:" > > You should respect $verbose before printing such header. > I can add a quiet/verbose mode option, but I didn't think it was needed here since its being run automatically from within checkpatches. > > + if [ -n "$1" ] ; then > > + report=$($VALIDATE_NEW_API $1) > > + elif [ -n "$2" ] ; then > > + report=$(git format-patch \ > > + --find-renames --no-stat --stdout -1 $commit | > > + $VALIDATE_NEW_API -) > > + else > > + report=$($VALIDATE_NEW_API -) > > + fi > > + [ $? -ne 0 -o $reta -ne 0 ] || return 0 > > + printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p' > > + > > status=$(($status + 1)) > > } > > > --- /dev/null > > +++ b/devtools/validate-new-api.sh > > About the file name, is it only for new API? > You don't like check-symbol-change.sh ? > It may be stupid, but I thought "validate" is more related to full test, > like validate-abi.sh does for the ABI, and "check" can be a partial > test like done in checkpatches.sh. > I can change the name, but to answer your question, its realy meant to validate any changes to a version map, so change.sh suffixes might be more appropriate. > > + }' > ./$mapdb > > + > > + sort -u $mapdb > ./$mapdb.2 > > + mv -f $mapdb.2 $mapdb > [...] > > +mapfile=`mktemp mapdb.XXXXXX` > [...] > > +rm -f $mapfile > > If you create temporary file, you should remove it in a trap cleanup, > in case of interrupted processing. > The best is to avoid temp file, but use variables instead. I'm not going to be able to avoid a temp file, since the number of changes in a map are inditerminate. I can trap and clean up the temp files though. I'm still in transit, so it will likely be a few days before I can get to this. Neil >