summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-09-30 14:20:42 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-10-06 08:51:47 +0300
commit5b3a8302c30335c3e39a1b304c64abf7caac6b65 (patch)
treedf4e700faf93473271fb87fc32193733509bb549
parent9d732c1cb755c81440129856e676425ece71de9a (diff)
downloadopenembedded-core-contrib-5b3a8302c30335c3e39a1b304c64abf7caac6b65.tar.gz
build-perf-bisect: introduce -i option
For inverting the logic, i.e. values over the threshold are OK and below it fail, instead of the other way around. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xbuild-perf-bisect.sh24
1 files changed, 19 insertions, 5 deletions
diff --git a/build-perf-bisect.sh b/build-perf-bisect.sh
index 9ab63de6c9..a5fed0ee4f 100755
--- a/build-perf-bisect.sh
+++ b/build-perf-bisect.sh
@@ -35,6 +35,8 @@ Optional arguments:
(default: $build_target)
-c average over COUNT test runs (default: $test_count)
-d DL_DIR to use
+ -i invert logic: values above the threshold are OK, below it
+ FAIL
-m test method, available options are:
buildtime, buildtime2, tmpsize, esdktime, parsetime
(default: $test_method)
@@ -44,7 +46,7 @@ Optional arguments:
EOF
}
-while getopts "hb:c:d:m:nw:" opt; do
+while getopts "hb:c:d:im:nw:" opt; do
case $opt in
h) usage
exit 0
@@ -55,6 +57,8 @@ while getopts "hb:c:d:m:nw:" opt; do
;;
d) downloaddir=`realpath "$OPTARG"`
;;
+ i) invert_cmp="1"
+ ;;
m) test_method="$OPTARG"
;;
n) no_threshold="1"
@@ -359,11 +363,21 @@ log "Raw results: ${results[@]}"
if [ -n "$threshold" ]; then
if [ `echo "$result < $threshold" | bc` -eq 1 ]; then
- log "OK ($git_rev): $result ($result_h) < $threshold ($threshold_h)"
- exit 0
+ if [ -z "$invert_cmp" ]; then
+ log "OK ($git_rev): $result ($result_h) < $threshold ($threshold_h)"
+ exit 0
+ else
+ log "FAIL (inv) ($git_rev): $result ($result_h) < $threshold ($threshold_h)"
+ exit 1
+ fi
else
- log "FAIL ($git_rev): $result ($result_h) >= $threshold ($threshold_h)"
- exit 1
+ if [ -z "$invert_cmp" ]; then
+ log "FAIL ($git_rev): $result ($result_h) >= $threshold ($threshold_h)"
+ exit 1
+ else
+ log "OK (inv) ($git_rev): $result ($result_h) >= $threshold ($threshold_h)"
+ exit 0
+ fi
fi
else
log "OK ($git_rev): $result ($result_h)"