summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2016-07-20 15:02:17 -0400
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-22 12:47:48 +0200
commit30301d0cace947f2b989caeec8a824565f873570 (patch)
tree1f74c1b23782e8c062101938fa393158878cd5df
parentf08455321fe4e8ff30064efcedd6fba75156b89d (diff)
downloaddpdk-30301d0cace947f2b989caeec8a824565f873570.zip
dpdk-30301d0cace947f2b989caeec8a824565f873570.tar.gz
dpdk-30301d0cace947f2b989caeec8a824565f873570.tar.xz
scripts: validate ABI faster with parallel make jobs
John Mcnamara and I were discussing enhancing 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 DPDK_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@tuxdriver.com>
-rwxr-xr-xscripts/validate-abi.sh15
1 files 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