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 4E5174C93 for ; Tue, 14 Aug 2018 13:05:32 +0200 (CEST) Received: from cpe-2606-a000-111b-40fe-f1c6-eb46-ccca-fca5.dyn6.twc.com ([2606:a000:111b:40fe:f1c6:eb46:ccca:fca5] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1fpX8T-0005SM-Nn; Tue, 14 Aug 2018 07:05:26 -0400 Date: Tue, 14 Aug 2018 07:04:41 -0400 From: Neil Horman To: "Rao, Nikhil" Cc: dev@dpdk.org, thomas@monjalon.net, john.mcnamara@intel.com, bruce.richardson@intel.com, Ferruh Yigit , Stephen Hemminger , "hange-folder>?" Message-ID: <20180814105208.GA24870@hmswarspite.think-freely.org> References: <20180115190545.25687-1-nhorman@tuxdriver.com> <20180627180101.16442-1-nhorman@tuxdriver.com> <8f70946a-d777-6d52-ff9d-51a0c957e40c@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f70946a-d777-6d52-ff9d-51a0c957e40c@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [dpdk-dev] [PATCH v9] 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: Tue, 14 Aug 2018 11:05:32 -0000 On Tue, Aug 14, 2018 at 09:23:59AM +0530, Rao, Nikhil wrote: > On 6/27/2018 11:31 PM, Neil Horman wrote: > > diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh > > new file mode 100755 > > index 000000000..17d123cf4 > > --- /dev/null > > +++ b/devtools/check-symbol-change.sh > > @@ -0,0 +1,159 @@ > > +#!/bin/sh > > +# SPDX-License-Identifier: BSD-3-Clause > > +# Copyright(c) 2018 Neil Horman > > + > > +build_map_changes() > > +{ > > + local fname=$1 > > + local mapdb=$2 > > + > > + cat $fname | awk ' > > + # Initialize our variables > > + BEGIN {map="";sym="";ar="";sec=""; in_sec=0; in_map=0} > > + > > + # Anything that starts with + or -, followed by an a > > + # and ends in the string .map is the name of our map file > > + # This may appear multiple times in a patch if multiple > > + # map files are altered, and all section/symbol names > > + # appearing between a triggering of this rule and the > > + # next trigger of this rule are associated with this file > > + /[-+] a\/.*\.map/ {map=$2; in_map=1} > > + > > + # Same pattern as above, only it matches on anything that > > + # doesnt end in 'map', indicating we have left the map chunk. > > + # When we hit this, turn off the in_map variable, which > > + # supresses the subordonate rules below > > + /[-+] a\/.*\.^(map)/ {in_map=0} > > + > > + # Triggering this rule, which starts a line with a + and ends it > > + # with a { identifies a versioned section. The section name is > > + # the rest of the line with the + and { symbols remvoed. > > + # Triggering this rule sets in_sec to 1, which actives the > > + # symbol rule below > > + /+.*{/ {gsub("+",""); > > + if (in_map == 1) { > > + sec=$1; in_sec=1; > > + } > > + } > > + > > I am adding a symbol as shown below, however the rule above fails to detect > that the new symbol is being added to a pre-existing EXPERIMENTAL block > (picks up the section name as @@ instead). > > Any suggestions ? > I was about to say that its because you've not got enough context to let the awk file figure out what your section name is, but that doesn't appear to be the case. Can you provide the exact command line you are running to do your symbol check, as well as the full patch that you are checking? I'd like to try recreate the issue here Best Neil > diff --git a/lib/librte_eventdev/rte_eventdev_version.map > b/lib/librte_eventdev/rte_eventdev_version.map > index 12835e9..4b8c55d 100644 > --- a/lib/librte_eventdev/rte_eventdev_version.map > +++ b/lib/librte_eventdev/rte_eventdev_version.map > @@ -96,6 +96,7 @@ EXPERIMENTAL { > rte_event_crypto_adapter_stats_reset; > rte_event_crypto_adapter_stop; > rte_event_eth_rx_adapter_cb_register; > + rte_event_eth_tx_adapter_caps_get; > rte_event_timer_adapter_caps_get; > rte_event_timer_adapter_create; > rte_event_timer_adapter_create_ext; > > Thanks, > Nikhil >