diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-09-26 11:21:59 +0300 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-10-06 08:51:47 +0300 |
commit | 9d732c1cb755c81440129856e676425ece71de9a (patch) | |
tree | cd3b3d48ecb254284c03781cd5a37a3f20983f3c | |
parent | 781b9b1fe566c373d2bfc54501ac350e8be8045e (diff) | |
download | openembedded-core-contrib-9d732c1cb755c81440129856e676425ece71de9a.tar.gz |
implement build-perf-test-revs.sh
Simple wrapper for build-perf-bisect.sh for measuring multiple
revisions.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-x | build-perf-test-revs.sh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/build-perf-test-revs.sh b/build-perf-test-revs.sh new file mode 100755 index 0000000000..6897f240df --- /dev/null +++ b/build-perf-test-revs.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# Copyright (c) 2016, Intel Corporation. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms and conditions of the GNU General Public License, +# version 2, as published by the Free Software Foundation. +# +# This program is distributed in the hope it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# +# This script is a simple wrapper around the actual build performance tester +# script. This script initializes the build environment, runs +# oe-build-perf-test and archives the results. + +# +# PARSE COMMAND LINE ARGUMENTS +# +script=`basename $0` +scriptdir=`dirname $0` + +usage () { +cat << EOF +Usage: $script [-h] [-b BUILD_TARGET] [-c COUNT] [-d DL_DIR] [-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 + -m test method (buildtime, buildtime2, tmpsize, esdktime, + parsetime) + -w work directory to use +EOF +} + +while getopts "hb:c:d:m:w:" opt; do + case $opt in + h) usage + exit 0 + ;; + b|c|d|m|w) cmd_args+=(-$opt "$OPTARG") + ;; + *) usage + exit 1 + ;; + esac +done +shift "$((OPTIND - 1))" + +revisions=( HEAD ) +if [ $# -ge 1 ]; then + revisions="$@" +fi + +# Check validity of given revisions +for rev in $revisions; do + git rev-parse $rev -- > /dev/null || exit 1 +done + +# Run tests +for rev in $revisions; do + git checkout $rev -- &> /dev/null || exit 1 + $scriptdir/build-perf-bisect.sh "${cmd_args[@]}" -n + if [ $? -eq 255 ]; then + echo "build-perf-bisect failed!" + exit 1 + fi +done |