diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-09-28 14:59:20 +0300 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-10-06 08:51:47 +0300 |
commit | 781b9b1fe566c373d2bfc54501ac350e8be8045e (patch) | |
tree | 64535c524aa72d828a1b0f7d924b8630fd413ef3 | |
parent | 9f35d0bf40a6744430f31ea4c5d380263b0ac128 (diff) | |
download | openembedded-core-contrib-781b9b1fe566c373d2bfc54501ac350e8be8045e.tar.gz |
build-perf-bisect: introduce -n option
Causes no threshold to be required, making all results pass. Useful for
just measuring perf.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-x | build-perf-bisect.sh | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/build-perf-bisect.sh b/build-perf-bisect.sh index 5dfa4a0610..9ab63de6c9 100755 --- a/build-perf-bisect.sh +++ b/build-perf-bisect.sh @@ -27,7 +27,7 @@ test_count=1 usage () { cat << EOF -Usage: $script [-h] [-b BUILD_TARGET] [-c COUNT] [-d DL_DIR] [-m TEST_METHOD] [-w WORKDIR] THRESHOLD +Usage: $script [-h] [-b BUILD_TARGET] [-c COUNT] [-d DL_DIR] [-m TEST_METHOD] [-w WORKDIR] [-n | THRESHOLD] Optional arguments: -h show this help and exit. @@ -38,11 +38,13 @@ Optional arguments: -m test method, available options are: buildtime, buildtime2, tmpsize, esdktime, parsetime (default: $test_method) + -n no threshold, do not do any comparison, all successful + builds return 0 -w work directory to use EOF } -while getopts "hb:c:d:m:w:" opt; do +while getopts "hb:c:d:m:nw:" opt; do case $opt in h) usage exit 0 @@ -55,6 +57,8 @@ while getopts "hb:c:d:m:w:" opt; do ;; m) test_method="$OPTARG" ;; + n) no_threshold="1" + ;; w) workdir=`realpath "$OPTARG"` ;; *) usage @@ -64,8 +68,8 @@ while getopts "hb:c:d:m:w:" opt; do done shift "$((OPTIND - 1))" -if [ $# -ne 1 ]; then - echo "Invalid number of positional arguments ($# instead of 1)" +if [ -z "$no_threshold" -a $# -ne 1 ]; then + echo "Invalid number of positional arguments. You must use -n or give a threshold" usage exit 255 fi @@ -314,8 +318,10 @@ case "$test_method" in exit 255 esac -threshold=`h_to_raw $1` -threshold_h=`raw_to_h $threshold` +if [ -z "$no_threshold" ]; then + threshold=`h_to_raw $1` + threshold_h=`raw_to_h $threshold` +fi trap cleanup EXIT @@ -351,10 +357,15 @@ result_h=`raw_to_h $result` log "Raw results: ${results[@]}" -if [ `echo "$result < $threshold" | bc` -eq 1 ]; then - log "OK ($git_rev): $result ($result_h) < $threshold ($threshold_h)" - exit 0 +if [ -n "$threshold" ]; then + if [ `echo "$result < $threshold" | bc` -eq 1 ]; then + log "OK ($git_rev): $result ($result_h) < $threshold ($threshold_h)" + exit 0 + else + log "FAIL ($git_rev): $result ($result_h) >= $threshold ($threshold_h)" + exit 1 + fi else - log "FAIL ($git_rev): $result ($result_h) >= $threshold ($threshold_h)" - exit 1 + log "OK ($git_rev): $result ($result_h)" + exit 0 fi |