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 6D6ED4237C; Mon, 9 Jan 2023 10:34:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 116E440689; Mon, 9 Jan 2023 10:34:40 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 6863740687 for ; Mon, 9 Jan 2023 10:34:38 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A10E05C0134; Mon, 9 Jan 2023 04:34:37 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 09 Jan 2023 04:34:37 -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=1673256877; x=1673343277; bh=4b GJ0jRiBfyc1arD1I5b2usTLOKX9/lo/IDBICFM46M=; b=dUXWDAaAuYIyM7Upju 2KhzP+zTlIZouvBp/D5TjODWlY3USDXoNd2C7GFzUwbwSr9i5BUy8l0ei8xAfkIQ /a1furo9yBejwJBqUea713Gq+Dqc+iwo0PELp95sHTeSxq5kn/VvXHf1ceNSPR3X OQWxN5dLTSMDsX90rjunMUvfHnxy5mFuoSFnCZuPyOkdIZL1BU/s5H9HNCgQ1QFR SXExEoinhCLDHNX97Nx9pBJvgqOTweGZOnIWbMJdAIayfQOpWgLE3vUPo466PLbE A8kaUy6kJm6mI+gjNC3igDxHdL0QfHBNqOrPV4DwwewYZ3XXCo4dNL16Z0jvJ0l5 cBrw== 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=1673256877; x=1673343277; bh=4bGJ0jRiBfyc1 arD1I5b2usTLOKX9/lo/IDBICFM46M=; b=qHkfT4ujXwcsvfPG8vHKpcIUWtXSl N2kQGcYQptgWQzlngzyanJb8RM2kaxRPY63GkPmrdkzQAJt+6TPUaaPWdjk6MNoe pmivmU7cvo/nuWIKjxvGhG78bztIEipkEOOkJOz4RD1A6Gv1/I28ia6iwwkLGXKD 3QdnAvDvDeL38583D0efonRd2TQuX1nRCEe7uUChs36UiCPJfQdsK4Qeee0lyiYL atFoPRJDsP7vyEtI4laWnZJbnd0VMb3I8D5m1bY2TDWIz1OAFYUW7azRSU6vdE6g Sj8rRjSz533NxpJdxDePP3ByGU45o0xXIPb+FGUnqku05IaEDOVxgRaxQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrkeeiucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh ephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghsucfo ohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtffrrg htthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteevkeehhfei lefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Jan 2023 04:34:36 -0500 (EST) From: Thomas Monjalon To: David Marchand Cc: dev@dpdk.org Subject: [PATCH v2] devtools: parallelize ABI check Date: Mon, 9 Jan 2023 10:34:28 +0100 Message-Id: <20230109093428.358903-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 with -f, and that is a specific capability of bash. Signed-off-by: Thomas Monjalon --- v2: - find dump2 inside the function - force bash because of export -f --- devtools/check-abi.sh | 20 +++++++++++++------- devtools/gen-abi.sh | 5 +++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/devtools/check-abi.sh b/devtools/check-abi.sh index c583eae2fd..4409f65ccd 100755 --- a/devtools/check-abi.sh +++ b/devtools/check-abi.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2019 Red Hat, Inc. @@ -34,19 +34,18 @@ else ABIDIFF_OPTIONS="$ABIDIFF_OPTIONS --headers-dir2 $incdir2" fi -error= -for dump in $(find $refdir -name "*.dump"); do +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 + return 1 fi abidiff $ABIDIFF_OPTIONS $dump $dump2 || { abiret=$? echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $dump $dump2'" >&2 - error=1 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,14 @@ for dump in $(find $refdir -name "*.dump"); do echo "ABIDIFF_ABI_INCOMPATIBLE_CHANGE, this change breaks the ABI." >&2 fi echo + return 1 } -done +} +export -f run_diff + +error= +find $refdir -name "*.dump" | +xargs -n1 -P0 sh -c '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 -- 2.39.0