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 A8EBF423AF; Wed, 11 Jan 2023 20:53:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8868340A7D; Wed, 11 Jan 2023 20:53:56 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id A4A0A40693 for ; Wed, 11 Jan 2023 20:53:55 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id DCBFE5C0052; Wed, 11 Jan 2023 14:53:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 11 Jan 2023 14:53:54 -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 :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1673466834; x=1673553234; bh=bn UCTEtRY/z4Rtah7Ij9YW4SX3OQ3e5zyH7VTHOs2Qc=; b=nXc06Q7lrQJ4qrnvD7 CCkjfnrMOGcPBvQS/mZbzM887bnnn55ueEAxSZQ6RK5ovHHq56lKNjxjsu/0YYrC 1XCSBn5Ymotxtm9rVpZza02dHRgBYbUhuuWk37s6I5to0eijat2sxqRG1iT4z71A CYP5XWj/4GeRkT+c4JvpJW+VO8zHIRwLyntKAD4C9ynJRDZ7NY3RmvI7uSEvVESk dck+QXMDTq+D3Zf4Eeqhn83v7uJZm+b/LyYinBp2lt8I0H8z9no7n9hJwm72fKuS m5IEnLGmXda5c996hQylSArjr0ljyrW1vSsMPQPYe1mOxABK8ifhPX9cnRwWAaMr RYPg== 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:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1673466834; x=1673553234; bh=bnUCTEtRY/z4R tah7Ij9YW4SX3OQ3e5zyH7VTHOs2Qc=; b=Sh8DHWqBZ0h1degTC4/bXba6jGIc1 FUE5Q+EfXaVFfD1aCaPZyEdxYHS8lf5WS8TGlU+06Gi5SYuxKxbTJxnGCkZwyjEF 53a9AtrcHtx6n/j5ZOTl3172PwdsGShrYbPawaeaUyax9q8fRoDaBoQ3FW/O+G4w OgSJEh8Nffa7ubFkeYmE/JOowWtSKS5AyYogHqWpqui0at/nCyrsLW0w8X7rXOol 6jhkC8kB10VRvxfLcceoEAIt2FvLsy/EgpAcm+tl8hriOUG+o0gnz3e2WdiBoQfA mP9hNOp9KOZYY94N7sUmzmMlNlbpUcj4xgaB4+P3XBG33OnZfPWtMrrgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeggddufedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Jan 2023 14:53:53 -0500 (EST) From: Thomas Monjalon To: David Marchand Cc: dev@dpdk.org, bruce.richardson@intel.com, Ferruh Yigit Subject: [PATCH v4] devtools: parallelize ABI check Date: Wed, 11 Jan 2023 20:53:45 +0100 Message-Id: <20230111195345.1275693-1-thomas@monjalon.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230107133953.306784-1-thomas@monjalon.net> References: <20230107133953.306784-1-thomas@monjalon.net> 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. POSIX shell does not support function export except using an "eval trick". Required variables are also exported. Signed-off-by: Thomas Monjalon Tested-by: Ferruh Yigit --- v2: - find dump2 inside the function - force bash because of export -f v3: - revert to POSIX sh - use POSIX eval instead of export -f (issues on Ubuntu) v4: - export all required variables - remove useless stdout echo calls --- devtools/check-abi.sh | 23 +++++++++++++---------- devtools/gen-abi.sh | 5 +++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh index c583eae2fd..31eceb42e6 100755 --- a/devtools/check-abi.sh +++ b/devtools/check-abi.sh @@ -34,20 +34,18 @@ else ABIDIFF_OPTIONS="$ABIDIFF_OPTIONS --headers-dir2 $incdir2" fi -error= -for dump in $(find $refdir -name "*.dump"); do +export newdir ABIDIFF_OPTIONS +export diff_func='run_diff() { + dump=$1 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 + return 1 + fi; abidiff $ABIDIFF_OPTIONS $dump $dump2 || { abiret=$? - echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $dump $dump2'" >&2 - error=1 - echo + echo "Error: ABI issue reported for abidiff $ABIDIFF_OPTIONS $dump $dump2" >&2 if [ $(($abiret & 3)) -ne 0 ]; then echo "ABIDIFF_ERROR|ABIDIFF_USAGE_ERROR, this could be a script or environment issue." >&2 fi @@ -57,8 +55,13 @@ for dump in $(find $refdir -name "*.dump"); do if [ $(($abiret & 8)) -ne 0 ]; then echo "ABIDIFF_ABI_INCOMPATIBLE_CHANGE, this change breaks the ABI." >&2 fi - echo + return 1 } -done +}' + +error= +find $refdir -name "*.dump" | +xargs -n1 -P0 sh -c 'eval "$diff_func"; run_diff $0' || +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