From patchwork Wed Jan 11 13:16:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 121836 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D106A423AE; Wed, 11 Jan 2023 14:16:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 849D540E25; Wed, 11 Jan 2023 14:16:59 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 42AE540A7D for ; Wed, 11 Jan 2023 14:16:58 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C8A2D5C018A; Wed, 11 Jan 2023 08:16:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 11 Jan 2023 08:16:55 -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=1673443015; x=1673529415; bh=6i yB4//h5/yH/tBC4wSD1jaGSSvPMY6IPNI76N/k6xk=; b=p+yw16wHSE9MjpRjff YJfwwSEgIv5rBXRD+j0IZCGZXjnGaegpQPAFlgwv/4qneoeVv7FGwLgr3BujqIGC sfGbwIAjbt5D80CfPVo9hSsEreWaCUkP2eimGnEU+zcOGqa9WN84IGE9gS8c9l9Y 0r6/lEkEd8bK3NlUdsDSzhrPy9KPZz30WBXvsvsDmsD2NlXCzF+ekk54Bcvfqtgw y55JHYONZ8cAJfYPQuRvqpmtKs/fp9sUgvDtUC11zSwc4c0aSy4ecDdDsxfKHI8n k97fsZKtacRfAhJnSMncBODgvC+wKR422+3BQb6aWemRNoVL+w8kCcd11dFb4xZq DDkA== 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=1673443015; x=1673529415; bh=6iyB4//h5/yH/ tBC4wSD1jaGSSvPMY6IPNI76N/k6xk=; b=BUK+1pKhfeIfK7x1HnqGOke8PLzLH YCfhWZZUFcQ+UWxuoAq8fw3ozw+US7HRv8U28fphLDy5c2MLYb1JNx/ZM0vwF5l/ odj/SI21JxoXjogjnWfKoubB3tbFU4euyztQAmP5MVvoA0E2eC9MIQkL39TiolYD lX06zM+eWJXuDLmKuq5ax1YS+OK+dHvIaVUmgoPZrAurC7n4nJTPCsE3iJHTxu7d ZrBVlmSYI8H4KCI2vTfQb3whXUtkwxU1VIEiealRq/vMqcaxMDT5awIc5r+XckxX NJxI3GUYbqTfPLQpv3XGBU0O2u5nRfx4WVWTRNU/QLeZApiqy1iPAVRCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeggdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfetveek hefhieelhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Jan 2023 08:16:54 -0500 (EST) From: Thomas Monjalon To: David Marchand Cc: dev@dpdk.org, Ferruh Yigit Subject: [PATCH v3] devtools: parallelize ABI check Date: Wed, 11 Jan 2023 14:16:52 +0100 Message-Id: <20230111131652.1265058-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 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, and that is a specific capability of bash. 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) --- devtools/check-abi.sh | 21 +++++++++++++-------- devtools/gen-abi.sh | 5 +++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh index c583eae2fd..d58c867c60 100755 --- a/devtools/check-abi.sh +++ b/devtools/check-abi.sh @@ -34,19 +34,18 @@ else ABIDIFF_OPTIONS="$ABIDIFF_OPTIONS --headers-dir2 $incdir2" fi -error= -for dump in $(find $refdir -name "*.dump"); do +export diff_func='run_diff() { + dump=$1 + newdir=$2 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 "Error: ABI issue reported for abidiff $ABIDIFF_OPTIONS $dump $dump2" >&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 +57,13 @@ for dump in $(find $refdir -name "*.dump"); do 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 '$newdir || +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