summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/build-perf-test-wrapper.sh
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-19 15:21:06 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-25 23:03:48 +0100
commitee4c5f61718ea61f1d80a1c4ca9cdafb3b28e90c (patch)
tree10f1b5c72c62545b9c72c9400d814a3d035dc897 /scripts/contrib/build-perf-test-wrapper.sh
parenta34fd3cf2798eb4d6bd79f632c6d9a13880c865b (diff)
downloadpoky-ee4c5f61718ea61f1d80a1c4ca9cdafb3b28e90c.tar.gz
build-perf-test-wrapper.sh: make archive dir configurable
Add new command line argument '-a' that can be used to define the directory where results (tarballs) are archived. Giving an empty string disables archiving which makes sense if you store results in Git. (From OE-Core rev: d53cf92847aa80724be4412801c993948a09cd27) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/build-perf-test-wrapper.sh')
-rwxr-xr-xscripts/contrib/build-perf-test-wrapper.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/scripts/contrib/build-perf-test-wrapper.sh b/scripts/contrib/build-perf-test-wrapper.sh
index 2fb4b1119a..ef2a46e3d8 100755
--- a/scripts/contrib/build-perf-test-wrapper.sh
+++ b/scripts/contrib/build-perf-test-wrapper.sh
@@ -25,6 +25,8 @@ Usage: $script [-h] [-c COMMITISH] [-C GIT_REPO]
25 25
26Optional arguments: 26Optional arguments:
27 -h show this help and exit. 27 -h show this help and exit.
28 -a ARCHIVE_DIR archive results tarball here, give an empty string to
29 disable tarball archiving
28 -c COMMITISH test (checkout) this commit 30 -c COMMITISH test (checkout) this commit
29 -C GIT_REPO commit results into Git 31 -C GIT_REPO commit results into Git
30EOF 32EOF
@@ -32,13 +34,16 @@ EOF
32 34
33 35
34# Parse command line arguments 36# Parse command line arguments
37archive_dir=~/perf-results/archives
35commitish="" 38commitish=""
36results_repo="" 39results_repo=""
37while getopts "hc:C:" opt; do 40while getopts "ha:c:C:" opt; do
38 case $opt in 41 case $opt in
39 h) usage 42 h) usage
40 exit 0 43 exit 0
41 ;; 44 ;;
45 a) archive_dir=`realpath "$OPTARG"`
46 ;;
42 c) commitish=$OPTARG 47 c) commitish=$OPTARG
43 ;; 48 ;;
44 C) results_repo=`realpath "$OPTARG"` 49 C) results_repo=`realpath "$OPTARG"`
@@ -112,13 +117,14 @@ echo -ne "\n"
112 117
113cat "$globalres_log" 118cat "$globalres_log"
114 119
115echo -ne "\n\n-----------------\n" 120if [ -n "$archive_dir" ]; then
116echo "Archiving results dir..." 121 echo -ne "\n\n-----------------\n"
117archive_dir=~/perf-results/archives 122 echo "Archiving results in $archive_dir"
118mkdir -p "$archive_dir" 123 mkdir -p "$archive_dir"
119results_basename=`basename "$results_dir"` 124 results_basename=`basename "$results_dir"`
120results_dirname=`dirname "$results_dir"` 125 results_dirname=`dirname "$results_dir"`
121tar -czf "$archive_dir/`uname -n`-${results_basename}.tar.gz" -C "$results_dirname" "$results_basename" 126 tar -czf "$archive_dir/`uname -n`-${results_basename}.tar.gz" -C "$results_dirname" "$results_basename"
127fi
122 128
123rm -rf "$build_dir" 129rm -rf "$build_dir"
124rm -rf "$results_dir" 130rm -rf "$results_dir"