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 9B8BDA00C2; Sat, 7 Jan 2023 14:40:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30BF04021D; Sat, 7 Jan 2023 14:40:08 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id ECEC940141 for ; Sat, 7 Jan 2023 14:40:06 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3EA235C010A; Sat, 7 Jan 2023 08:40:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 07 Jan 2023 08:40:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1673098805; x=1673185205; bh=bEZpmDnzwifQhM99pp/hGv5Qs ruoj5bBq3e0OIEPGnI=; b=UDIEvpX6iyaRBXVRGOb8PAF/TS/ml/L5nHctoOjs4 ZzCxvrUGemdkRiC3YKVREmI/+2bJzXVVd2m0/QYadTDzVT8ODI//L+yyF2/COzIh PDfdSZsISv1+9MBpQaqZHpNz8Ro7hFlmRpaARB+JJQpLN48euFETuIfSQNy6VhPp rQslFW9oTY//l9W4uXzkTgKa4EUoItX0Hw4BBBLvA2cjibfSPKdw6JLoEI+HZCeq HBxpqwJ4vF2wlMp9PKWid49EEhwxvd7GGGp2hUaYjYB6M/6ySdQUooQwd17kw3w0 tUmhABnL25azKcEciExc6/eO3zVULdvS+ShaEYTW240mA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1673098805; x=1673185205; bh=bEZpmDnzwifQhM99pp/hGv5Qsruoj5bBq3e 0OIEPGnI=; b=Z3YiULSixiZ+cvo3hmHoNNZdX4+fEtBWe/BP/KPNzHH/Ygu7w/E wXrt32yX8Gu+C5tJYOMMyjwVRz2F+Vu+ysDlJu8EzMZp7GqPDabhap8NfQ6G6Oni jxvQbZIIEnjYnnrGEllZLGi020pAH/ifnwVcxqmjSKufskQ9D1wnhDorSWj1230L R7J9spOYGkQpHo2wDtXA75cjKS+XPObkKEmR1sOmbZfZMkqCzwWRR+uRyq7HWY1U AcEmV7IXy/QGaAq23L6sTgzJSlo/oQgfe5subiCGFox7rQAMdnDqClqeoN8r/zmk /FtNYsZ0/3k2C1EmXzXTWk3NNYIf1vf13EA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkedvgdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenmh hishhsihhnghcuvffquchfihgvlhguucdlfedtmdenucfjughrpefhvfevufffkffoggfg sedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhoh hmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepveevfeevieei hfetudekgeekleeigeffueekveduteeuffeiudevteeiudekfeelnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 7 Jan 2023 08:40:04 -0500 (EST) From: Thomas Monjalon To: Cc: dev@dpdk.org, David Marchand Subject: [PATCH] devtools: parallelize ABI check Date: Sat, 7 Jan 2023 14:39:53 +0100 Message-Id: <20230107133953.306784-1-thomas@monjalon.net> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Generation and comparison of ABI dumps are done on multiple cores thanks to xargs -P0. It can accelerate this long step by 5 in my tests. xargs reports a global error if one of the process has an error. Running a shell function with xargs requires to export it with -f. Signed-off-by: Thomas Monjalon --- devtools/check-abi.sh | 33 ++++++++++++++++++++------------- devtools/gen-abi.sh | 5 +++-- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh index c583eae2fd..e2fa49217d 100755 --- a/devtools/check-abi.sh +++ b/devtools/check-abi.sh @@ -34,19 +34,10 @@ else ABIDIFF_OPTIONS="$ABIDIFF_OPTIONS --headers-dir2 $incdir2" fi -error= -for dump in $(find $refdir -name "*.dump"); do - name=$(basename $dump) - dump2=$(find $newdir -name $name) - if [ -z "$dump2" ] || [ ! -e "$dump2" ]; then - echo "Error: cannot find $name in $newdir" >&2 - error=1 - continue - fi - abidiff $ABIDIFF_OPTIONS $dump $dump2 || { +run_diff() { # + abidiff $ABIDIFF_OPTIONS $1 $2 || { abiret=$? - echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $dump $dump2'" >&2 - error=1 + echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $1 $2'" >&2 echo if [ $(($abiret & 3)) -ne 0 ]; then echo "ABIDIFF_ERROR|ABIDIFF_USAGE_ERROR, this could be a script or environment issue." >&2 @@ -58,7 +49,23 @@ for dump in $(find $refdir -name "*.dump"); do echo "ABIDIFF_ABI_INCOMPATIBLE_CHANGE, this change breaks the ABI." >&2 fi echo + return $abiret } -done +} +export -f run_diff + +error= +for dump in $(find $refdir -name "*.dump"); do + name=$(basename $dump) + dump2=$(find $newdir -name $name) + if [ -z "$dump2" ] || [ ! -e "$dump2" ]; then + echo "Error: cannot find $name in $newdir" >&2 + error=1 + continue + fi + echo $dump $dump2 +done | +xargs -n2 -P0 sh -c 'run_diff $0 $1' || +error=1 [ -z "$error" ] || [ -n "$warnonly" ] diff --git a/devtools/gen-abi.sh b/devtools/gen-abi.sh index f15a3b9aaf..61f7510ea1 100755 --- a/devtools/gen-abi.sh +++ b/devtools/gen-abi.sh @@ -22,5 +22,6 @@ for f in $(find $installdir -name "*.so.*"); do fi libname=$(basename $f) - abidw --out-file $dumpdir/${libname%.so*}.dump $f -done + echo $dumpdir/${libname%.so*}.dump $f +done | +xargs -n2 -P0 abidw --out-file -- 2.39.0