]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
build-perf-bisect: introduce -j and -t options
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 21 Oct 2016 12:15:20 +0000 (15:15 +0300)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 21 Oct 2016 12:24:47 +0000 (15:24 +0300)
For controlling the parallelism of the build.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
build-perf-bisect.sh
build-perf-test-revs.sh

index ec070a4b5104a4be5222f7798876dbd490c8cc37..52c00650a6a2a3cbfaf107cb85b750fb66915ae4 100755 (executable)
@@ -24,10 +24,12 @@ build_target="core-image-sato"
 workdir=`realpath build-perf-bisect`
 test_method="buildtime"
 test_count=1
+parallel_make='${@oe.utils.cpu_count()}'
+bb_number_threads='${@oe.utils.cpu_count()}'
 
 usage () {
 cat << EOF
-Usage: $script [-h] [-b BUILD_TARGET] [-c COUNT] [-d DL_DIR] [-m TEST_METHOD] [-w WORKDIR] [-n | THRESHOLD]
+Usage: $script [-h] [-b BUILD_TARGET] [-c COUNT] [-d DL_DIR] [-j MAKE_JOBS] [-t BB_THREADS] [-m TEST_METHOD] [-w WORKDIR] [-n | THRESHOLD]
 
 Optional arguments:
   -h                show this help and exit.
@@ -37,16 +39,20 @@ Optional arguments:
   -d                DL_DIR to use
   -i                invert logic: values above the threshold are OK, below it
                         FAIL
+  -j                number of make jobs, i.e. PARALLEL_MAKE to use in bitbake
+                        conf (default: $parallel_make)
   -m                test method, available options are:
                         buildtime, buildtime2, tmpsize, esdktime, esdksize,
                         parsetime (default: $test_method)
   -n                no threshold, do not do any comparison, all successful
                         builds return 0
+  -t                number of task threads, i.e. BB_NUMBER_THREADS to use
+                        in bitbake conf (default: $bb_number_threads)
   -w                work directory to use
 EOF
 }
 
-while getopts "hb:c:d:im:nw:" opt; do
+while getopts "hb:c:d:ij:m:nt:w:" opt; do
     case $opt in
         h)  usage
             exit 0
@@ -59,10 +65,14 @@ while getopts "hb:c:d:im:nw:" opt; do
             ;;
         i)  invert_cmp="1"
             ;;
+        j)  parallel_make="$OPTARG"
+            ;;
         m)  test_method="$OPTARG"
             ;;
         n)  no_threshold="1"
             ;;
+        t)  bb_number_threads="$OPTARG"
+            ;;
         w)  workdir=`realpath "$OPTARG"`
             ;;
         *)  usage
@@ -352,6 +362,8 @@ mkdir -p $workdir
 
 echo DL_DIR = \"$downloaddir\" >> conf/local.conf
 echo CONNECTIVITY_CHECK_URIS = \"\" >> conf/local.conf
+echo PARALLEL_MAKE = \"-j $parallel_make\" >> conf/local.conf
+echo BB_NUMBER_THREADS = \"$bb_number_threads\" >> conf/local.conf
 
 # Do actual build
 log "TESTING REVISION $git_rev (#$git_rev_cnt), AVERAGING OVER $test_count TEST RUNS"
index 6897f240df8c3fc3efe46c7a079ca755bda803a2..d469a21f4082067fd03e5e3a54dc1d0475e28ee6 100755 (executable)
@@ -24,25 +24,27 @@ scriptdir=`dirname $0`
 
 usage () {
 cat << EOF
-Usage: $script [-h] [-b BUILD_TARGET] [-c COUNT] [-d DL_DIR] [-m TEST_METHOD] [-w WORKDIR] [REV1 [REV2]...]
+Usage: $script [-h] [-b BUILD_TARGET] [-c COUNT] [-d DL_DIR] [-j MAKE_JOBS] [-t BB_THREADS] [-m TEST_METHOD] [-w WORKDIR] [REV1 [REV2]...]
 
 Optional arguments:
   -h                show this help and exit.
   -b                build target to test
   -c                average over COUNT test runs
   -d                DL_DIR to use
+  -j                number of make jobs, i.e. PARALLEL_MAKE to use
   -m                test method (buildtime, buildtime2, tmpsize, esdktime,
                         parsetime)
+  -t                number of task threads, i.e. BB_NUMBER_THREADS to use
   -w                work directory to use
 EOF
 }
 
-while getopts "hb:c:d:m:w:" opt; do
+while getopts "hb:c:d:j:m:t:w:" opt; do
     case $opt in
         h)  usage
             exit 0
             ;;
-        b|c|d|m|w)  cmd_args+=(-$opt "$OPTARG")
+        b|c|d|j|m|t|w)  cmd_args+=(-$opt "$OPTARG")
             ;;
         *)  usage
             exit 1