All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: dev@dpdk.org
Cc: Neil Horman <nhorman@tuxdriver.com>,
	Neil Horman <nhorman@tuxdrier.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>,
	"Mcnamara, John" <john.mcnamara@intel.com>
Subject: [PATCH v2] validate_abi: build faster by augmenting make with job count
Date: Wed, 20 Jul 2016 15:02:17 -0400	[thread overview]
Message-ID: <1469041337-13765-1-git-send-email-nhorman@tuxdriver.com> (raw)
In-Reply-To: <6330653.K6A9CLrOZy@xps13>

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 <nhorman@tuxdrier.com>
CC: Thomas Monjalon <thomas.monjalon@6wind.com>
CC: "Mcnamara, John" <john.mcnamara@intel.com>

---
Change notes

v2) switch variable to DPDK_MAKE_JOBS
    make provision for no existance of lscpu
---
 scripts/validate-abi.sh | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
index c36ad61..feda6c8 100755
--- a/scripts/validate-abi.sh
+++ b/scripts/validate-abi.sh
@@ -97,6 +97,17 @@ fixup_config() {
 #trap on ctrl-c to clean up
 trap cleanup_and_exit SIGINT
 
+if [ -z "$DPDK_MAKE_JOBS" ]
+then
+	# This counts the number of cpus on the system
+	if [ -e /usr/bin/lscpu ]
+	then
+		DPDK_MAKE_JOBS=`lscpu -p=cpu | grep -v "#" | wc -l`
+	else
+		DPDK_MAKE_JOBS=1
+	fi
+fi
+
 #Save the current branch
 CURRENT_BRANCH=`git branch | grep \* | cut -d' ' -f2`
 
@@ -183,7 +194,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$DPDK_MAKE_JOBS O=$TARGET > $VERBOSE 2>&1
 
 if [ $? -ne 0 ]
 then
@@ -214,7 +225,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$DPDK_MAKE_JOBS O=$TARGET > $VERBOSE 2>&1
 
 if [ $? -ne 0 ]
 then
-- 
2.5.5

  parent reply	other threads:[~2016-07-20 19:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 17:09 [PATCH] validate_abi: build faster by augmenting make with job count Neil Horman
2016-07-20 17:40 ` Thomas Monjalon
2016-07-20 17:48   ` Neil Horman
2016-07-20 19:47     ` Wiles, Keith
2016-07-20 20:15       ` Thomas Monjalon
2016-07-20 20:16       ` Neil Horman
2016-07-20 22:32         ` Wiles, Keith
2016-07-21 13:54           ` Neil Horman
2016-07-21 14:09             ` Wiles, Keith
2016-07-21 15:06               ` Neil Horman
2016-07-21 15:22                 ` Wiles, Keith
2016-07-21 18:34                   ` Neil Horman
2016-07-24 18:08                     ` Wiles, Keith
2016-08-01 11:49                       ` Neil Horman
2016-08-01 16:16                         ` Wiles, Keith
2016-08-01 18:08                           ` Neil Horman
2016-07-20 19:02   ` Neil Horman [this message]
2016-07-22 10:46     ` [PATCH v2] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469041337-13765-1-git-send-email-nhorman@tuxdriver.com \
    --to=nhorman@tuxdriver.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=nhorman@tuxdrier.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.