summaryrefslogtreecommitdiff
path: root/ezbench.sh
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-07-27 12:17:44 +0100
committerMartin Peres <martin.peres@linux.intel.com>2015-07-27 16:31:15 +0300
commit621ba9bb5d885e46e7d46c6fac8226a1516e678c (patch)
tree84e10995115d8dff12c5e58ec7a4d7690d43bcf7 /ezbench.sh
parent6800c09d7ef2a8a089079548afc6aa118c64bd95 (diff)
Allow the user to provide an optional run name to concatenate results
v2: ()Martin Peres) - add the documentation in show-help
Diffstat (limited to 'ezbench.sh')
-rwxr-xr-xezbench.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/ezbench.sh b/ezbench.sh
index 9ae5f9a..73fa829 100755
--- a/ezbench.sh
+++ b/ezbench.sh
@@ -51,6 +51,7 @@ function show_help {
echo " -b benchmark1 benchmark2 ..."
echo " -H <git-commit-id> benchmark the commits preceeding this one"
echo " -m <make command> (default: 'make -j8 install', '' to skip the compilation)"
+ echo " -N <log folder's name> (default: current date and time)"
echo ""
echo " Other actions:"
echo " -h/?: Show this help message"
@@ -66,7 +67,7 @@ function available_tests {
}
no_compile=
-while getopts "h?p:n:H:r:b:m:l" opt; do
+while getopts "h?p:n:N:H:r:b:m:l" opt; do
case "$opt" in
h|\?)
show_help
@@ -76,6 +77,8 @@ while getopts "h?p:n:H:r:b:m:l" opt; do
;;
n) lastNCommits=$OPTARG
;;
+ N) name=$OPTARG
+ ;;
H) uptoCommit=$OPTARG
;;
r) rounds=$OPTARG
@@ -127,9 +130,9 @@ then
fi
# redirect the output to both a log file and stdout
-logsFolder="$ezBenchDir/logs/$(date +"%Y-%m-%d-%T")"
-mkdir $logsFolder || exit 1
-exec > >(tee $logsFolder/results)
+logsFolder="$ezBenchDir/logs/${name:-$(date +"%Y-%m-%d-%T")}"
+[ -d $logsFolder ] || mkdir -p $logsFolder || exit 1
+exec > >(tee -a $logsFolder/results)
exec 2>&1
# Check the git repo, saving then displaying the HEAD commit