From patchwork Wed Jul 20 17:09:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Horman X-Patchwork-Id: 14924 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 744134B79; Wed, 20 Jul 2016 19:10:10 +0200 (CEST) Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id BCBD94AAD for ; Wed, 20 Jul 2016 19:10:08 +0200 (CEST) Received: from cpe-2606-a000-111b-40ed-7aac-c0ff-fec2-933b.dyn6.twc.com ([2606:a000:111b:40ed:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1bPv0T-0003Ll-JR; Wed, 20 Jul 2016 13:10:06 -0400 From: Neil Horman To: dev@dpdk.org Cc: Neil Horman , Neil Horman , Thomas Monjalon , "Mcnamara, John" Date: Wed, 20 Jul 2016 13:09:48 -0400 Message-Id: <1469034588-1847-1-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 2.5.5 X-Spam-Score: -1.0 (-) X-Spam-Status: No Subject: [dpdk-dev] [PATCH] validate_abi: build faster by augmenting make with job count X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Neil Horman John Mcnamara and I were discussing enhacing the validate_abi script to build the dpdk tree faster with multiple jobs. Theres no reason not to do it, so this implements that requirement. It uses a MAKE_JOBS variable that can be set by the user to limit the job count. By default the job count is set to the number of online cpus. Signed-off-by: Neil Horman CC: Thomas Monjalon CC: "Mcnamara, John" --- scripts/validate-abi.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh index c36ad61..1c9627b 100755 --- a/scripts/validate-abi.sh +++ b/scripts/validate-abi.sh @@ -97,6 +97,12 @@ fixup_config() { #trap on ctrl-c to clean up trap cleanup_and_exit SIGINT +if [ -z "$MAKE_JOBS" ] +then + # This counts the number of cpus on the system + MAKE_JOBS=`lscpu -p=cpu | grep -v "#" | wc -l` +fi + #Save the current branch CURRENT_BRANCH=`git branch | grep \* | cut -d' ' -f2` @@ -183,7 +189,7 @@ log "INFO" "Configuring DPDK $TAG1" make config T=$TARGET O=$TARGET > $VERBOSE 2>&1 log "INFO" "Building DPDK $TAG1. This might take a moment" -make O=$TARGET > $VERBOSE 2>&1 +make -j$MAKE_JOBS O=$TARGET > $VERBOSE 2>&1 if [ $? -ne 0 ] then @@ -214,7 +220,7 @@ log "INFO" "Configuring DPDK $TAG2" make config T=$TARGET O=$TARGET > $VERBOSE 2>&1 log "INFO" "Building DPDK $TAG2. This might take a moment" -make O=$TARGET > $VERBOSE 2>&1 +make -j$MAKE_JOBS O=$TARGET > $VERBOSE 2>&1 if [ $? -ne 0 ] then