summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/contrib/build-perf-test-wrapper.sh37
1 files changed, 32 insertions, 5 deletions
diff --git a/scripts/contrib/build-perf-test-wrapper.sh b/scripts/contrib/build-perf-test-wrapper.sh
index 19bee1dd03..7cbb5d794f 100755
--- a/scripts/contrib/build-perf-test-wrapper.sh
+++ b/scripts/contrib/build-perf-test-wrapper.sh
@@ -33,7 +33,9 @@ Optional arguments:
33 -c COMMITISH test (checkout) this commit, <branch>:<commit> can be 33 -c COMMITISH test (checkout) this commit, <branch>:<commit> can be
34 specified to test specific commit of certain branch 34 specified to test specific commit of certain branch
35 -C GIT_REPO commit results into Git 35 -C GIT_REPO commit results into Git
36 -d DOWNLOAD_DIR directory to store downloaded sources in
36 -E EMAIL_ADDR send email report 37 -E EMAIL_ADDR send email report
38 -g GLOBALRES_DIR where to place the globalres file
37 -P GIT_REMOTE push results to a remote Git repository 39 -P GIT_REMOTE push results to a remote Git repository
38 -R DEST rsync reports to a remote destination 40 -R DEST rsync reports to a remote destination
39 -w WORK_DIR work dir for this script 41 -w WORK_DIR work dir for this script
@@ -51,19 +53,26 @@ get_os_release_var () {
51commitish="" 53commitish=""
52oe_build_perf_test_extra_opts=() 54oe_build_perf_test_extra_opts=()
53oe_git_archive_extra_opts=() 55oe_git_archive_extra_opts=()
54while getopts "ha:c:C:E:P:R:w:x" opt; do 56while getopts "ha:c:C:d:E:g:P:R:w:x" opt; do
55 case $opt in 57 case $opt in
56 h) usage 58 h) usage
57 exit 0 59 exit 0
58 ;; 60 ;;
59 a) archive_dir=`realpath -s "$OPTARG"` 61 a) mkdir -p "$OPTARG"
62 archive_dir=`realpath -s "$OPTARG"`
60 ;; 63 ;;
61 c) commitish=$OPTARG 64 c) commitish=$OPTARG
62 ;; 65 ;;
63 C) results_repo=`realpath -s "$OPTARG"` 66 C) mkdir -p "$OPTARG"
67 results_repo=`realpath -s "$OPTARG"`
68 ;;
69 d) download_dir=`realpath -s "$OPTARG"`
64 ;; 70 ;;
65 E) email_to="$OPTARG" 71 E) email_to="$OPTARG"
66 ;; 72 ;;
73 g) mkdir -p "$OPTARG"
74 globalres_dir=`realpath -s "$OPTARG"`
75 ;;
67 P) oe_git_archive_extra_opts+=("--push" "$OPTARG") 76 P) oe_git_archive_extra_opts+=("--push" "$OPTARG")
68 ;; 77 ;;
69 R) rsync_dst="$OPTARG" 78 R) rsync_dst="$OPTARG"
@@ -86,6 +95,17 @@ if [ $# -ne 0 ]; then
86 exit 1 95 exit 1
87fi 96fi
88 97
98if [ -n "$email_to" ]; then
99 if ! [ -x "$(command -v phantomjs)" ]; then
100 echo "ERROR: Sending email needs phantomjs."
101 exit 1
102 fi
103 if ! [ -x "$(command -v optipng)" ]; then
104 echo "ERROR: Sending email needs optipng."
105 exit 1
106 fi
107fi
108
89# Open a file descriptor for flock and acquire lock 109# Open a file descriptor for flock and acquire lock
90LOCK_FILE="/tmp/oe-build-perf-test-wrapper.lock" 110LOCK_FILE="/tmp/oe-build-perf-test-wrapper.lock"
91if ! exec 3> "$LOCK_FILE"; then 111if ! exec 3> "$LOCK_FILE"; then
@@ -146,11 +166,18 @@ if [ -z "$base_dir" ]; then
146fi 166fi
147echo "Using working dir $base_dir" 167echo "Using working dir $base_dir"
148 168
169if [ -z "$download_dir" ]; then
170 download_dir="$base_dir/downloads"
171fi
172if [ -z "$globalres_dir" ]; then
173 globalres_dir="$base_dir"
174fi
175
149timestamp=`date "+%Y%m%d%H%M%S"` 176timestamp=`date "+%Y%m%d%H%M%S"`
150git_rev=$(git rev-parse --short HEAD) || exit 1 177git_rev=$(git rev-parse --short HEAD) || exit 1
151build_dir="$base_dir/build-$git_rev-$timestamp" 178build_dir="$base_dir/build-$git_rev-$timestamp"
152results_dir="$base_dir/results-$git_rev-$timestamp" 179results_dir="$base_dir/results-$git_rev-$timestamp"
153globalres_log="$base_dir/globalres.log" 180globalres_log="$globalres_dir/globalres.log"
154machine="qemux86" 181machine="qemux86"
155 182
156mkdir -p "$base_dir" 183mkdir -p "$base_dir"
@@ -161,7 +188,7 @@ auto_conf="$build_dir/conf/auto.conf"
161echo "MACHINE = \"$machine\"" > "$auto_conf" 188echo "MACHINE = \"$machine\"" > "$auto_conf"
162echo 'BB_NUMBER_THREADS = "8"' >> "$auto_conf" 189echo 'BB_NUMBER_THREADS = "8"' >> "$auto_conf"
163echo 'PARALLEL_MAKE = "-j 8"' >> "$auto_conf" 190echo 'PARALLEL_MAKE = "-j 8"' >> "$auto_conf"
164echo "DL_DIR = \"$base_dir/downloads\"" >> "$auto_conf" 191echo "DL_DIR = \"$download_dir\"" >> "$auto_conf"
165# Disabling network sanity check slightly reduces the variance of timing results 192# Disabling network sanity check slightly reduces the variance of timing results
166echo 'CONNECTIVITY_CHECK_URIS = ""' >> "$auto_conf" 193echo 'CONNECTIVITY_CHECK_URIS = ""' >> "$auto_conf"
167# Possibility to define extra settings 194# Possibility to define extra settings