aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-30 13:23:13 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-10-06 08:49:59 +0300
commitbca7e728586011e255f90aee0f5f9e1db76f7386 (patch)
treea4c0cf894772781c425cb4518b8ed43dc9a19f3b
parentd452986f76db81321ec9bf7889cdf0fc714e2857 (diff)
downloadopenembedded-core-contrib-bca7e728586011e255f90aee0f5f9e1db76f7386.tar.gz
openembedded-core-contrib-bca7e728586011e255f90aee0f5f9e1db76f7386.tar.bz2
openembedded-core-contrib-bca7e728586011e255f90aee0f5f9e1db76f7386.zip
build-perf-bisect: always do cleanup
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xbuild-perf-bisect.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/build-perf-bisect.sh b/build-perf-bisect.sh
index 6ad63a7a8e..b026cf93dc 100755
--- a/build-perf-bisect.sh
+++ b/build-perf-bisect.sh
@@ -141,6 +141,15 @@ do_sync () {
sleep 2
}
+cleanup () {
+ $cleanup_func "$@"
+}
+
+cleanup_default () {
+ cd $workdir
+ run_cmd rm -rf $builddir
+}
+
#
# TEST METHODS
@@ -154,10 +163,6 @@ buildtime () {
result=`time_cmd bitbake $1` || exit 125
result_h=`s_to_hms $result`
-
- log "removing build directory"
- cd $workdir
- run_cmd rm -rf $builddir
}
tmpsize () {
@@ -171,10 +176,6 @@ tmpsize () {
result=`du -s tmp* | cut -f1` || exit 255
result_h=`kib_to_gib $result`
-
- log "removing build directory"
- cd $workdir
- run_cmd rm -rf $builddir
}
esdktime () {
@@ -190,8 +191,9 @@ esdktime () {
result=`time_cmd "${esdk_installer[-1]}" -y -d "esdk-deploy"` || exit 125
result_h=`s_to_hms $result`
+}
- log "removing deploy directories"
+cleanup_esdktime () {
run_cmd rm -rf esdk-deploy tmp*
}
@@ -203,10 +205,13 @@ parsetime () {
result_h=`s_to_hms $result`
}
+
#
# MAIN SCRIPT
#
build_target=$1
+cleanup_func=cleanup_default
+
builddir="$workdir/build-$git_rev-$timestamp"
case "$test_method" in
@@ -222,6 +227,7 @@ case "$test_method" in
threshold=`hms_to_s $2`
threshold_h=`s_to_hms $threshold`
builddir="$workdir/build"
+ cleanup_func=cleanup_esdktime
;;
parsetime)
threshold=`hms_to_s $2`
@@ -233,6 +239,8 @@ case "$test_method" in
exit 255
esac
+trap cleanup EXIT
+
#Initialize build environment
mkdir -p $workdir