diff options
Diffstat (limited to 'scripts/contrib/build-perf-test-wrapper.sh')
-rwxr-xr-x | scripts/contrib/build-perf-test-wrapper.sh | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/scripts/contrib/build-perf-test-wrapper.sh b/scripts/contrib/build-perf-test-wrapper.sh index 19bee1dd03..0a85e6e708 100755 --- a/scripts/contrib/build-perf-test-wrapper.sh +++ b/scripts/contrib/build-perf-test-wrapper.sh @@ -4,15 +4,7 @@ # # 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. -# +# SPDX-License-Identifier: GPL-2.0-only # # This script is a simple wrapper around the actual build performance tester # script. This script initializes the build environment, runs @@ -33,7 +25,9 @@ Optional arguments: -c COMMITISH test (checkout) this commit, <branch>:<commit> can be specified to test specific commit of certain branch -C GIT_REPO commit results into Git + -d DOWNLOAD_DIR directory to store downloaded sources in -E EMAIL_ADDR send email report + -g GLOBALRES_DIR where to place the globalres file -P GIT_REMOTE push results to a remote Git repository -R DEST rsync reports to a remote destination -w WORK_DIR work dir for this script @@ -51,19 +45,26 @@ get_os_release_var () { commitish="" oe_build_perf_test_extra_opts=() oe_git_archive_extra_opts=() -while getopts "ha:c:C:E:P:R:w:x" opt; do +while getopts "ha:c:C:d:E:g:P:R:w:x" opt; do case $opt in h) usage exit 0 ;; - a) archive_dir=`realpath -s "$OPTARG"` + a) mkdir -p "$OPTARG" + archive_dir=`realpath -s "$OPTARG"` ;; c) commitish=$OPTARG ;; - C) results_repo=`realpath -s "$OPTARG"` + C) mkdir -p "$OPTARG" + results_repo=`realpath -s "$OPTARG"` + ;; + d) download_dir=`realpath -s "$OPTARG"` ;; E) email_to="$OPTARG" ;; + g) mkdir -p "$OPTARG" + globalres_dir=`realpath -s "$OPTARG"` + ;; P) oe_git_archive_extra_opts+=("--push" "$OPTARG") ;; R) rsync_dst="$OPTARG" @@ -89,7 +90,7 @@ fi # Open a file descriptor for flock and acquire lock LOCK_FILE="/tmp/oe-build-perf-test-wrapper.lock" if ! exec 3> "$LOCK_FILE"; then - echo "ERROR: Unable to open lock file" + echo "ERROR: Unable to open loemack file" exit 1 fi if ! flock -n 3; then @@ -146,11 +147,18 @@ if [ -z "$base_dir" ]; then fi echo "Using working dir $base_dir" +if [ -z "$download_dir" ]; then + download_dir="$base_dir/downloads" +fi +if [ -z "$globalres_dir" ]; then + globalres_dir="$base_dir" +fi + timestamp=`date "+%Y%m%d%H%M%S"` git_rev=$(git rev-parse --short HEAD) || exit 1 build_dir="$base_dir/build-$git_rev-$timestamp" results_dir="$base_dir/results-$git_rev-$timestamp" -globalres_log="$base_dir/globalres.log" +globalres_log="$globalres_dir/globalres.log" machine="qemux86" mkdir -p "$base_dir" @@ -161,7 +169,7 @@ auto_conf="$build_dir/conf/auto.conf" echo "MACHINE = \"$machine\"" > "$auto_conf" echo 'BB_NUMBER_THREADS = "8"' >> "$auto_conf" echo 'PARALLEL_MAKE = "-j 8"' >> "$auto_conf" -echo "DL_DIR = \"$base_dir/downloads\"" >> "$auto_conf" +echo "DL_DIR = \"$download_dir\"" >> "$auto_conf" # Disabling network sanity check slightly reduces the variance of timing results echo 'CONNECTIVITY_CHECK_URIS = ""' >> "$auto_conf" # Possibility to define extra settings @@ -207,7 +215,7 @@ if [ -n "$results_repo" ]; then if [ -n "$email_to" ]; then echo "Emailing test report" os_name=`get_os_release_var PRETTY_NAME` - "$script_dir"/oe-build-perf-report-email.py --to "$email_to" --subject "Build Perf Test Report for $os_name" --text $report_txt --html $report_html "${OE_BUILD_PERF_REPORT_EMAIL_EXTRA_ARGS[@]}" + "$script_dir"/oe-build-perf-report-email.py --to "$email_to" --subject "Build Perf Test Report for $os_name" --text $report_txt "${OE_BUILD_PERF_REPORT_EMAIL_EXTRA_ARGS[@]}" fi # Upload report files, unless we're on detached head |