summaryrefslogtreecommitdiff
path: root/scripts/contrib
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-01-21 19:46:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 10:58:39 +0000
commit7b355dc96255b06f3108a7d02ab0ed408d64bf1b (patch)
treef8cfd1c2b39ad1244b9da28b0148bccc8ec3bc5f /scripts/contrib
parente4d5df521f22ed13eca27f24899af27c7a49990a (diff)
downloadopenembedded-core-7b355dc96255b06f3108a7d02ab0ed408d64bf1b.tar.gz
openembedded-core-7b355dc96255b06f3108a7d02ab0ed408d64bf1b.tar.bz2
openembedded-core-7b355dc96255b06f3108a7d02ab0ed408d64bf1b.zip
build-perf-test.sh: more generic timing function
Make it possible to time also other than bitbake commands. The name of the log file is changed from bitbake.log to commands.log. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-xscripts/contrib/build-perf-test.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/contrib/build-perf-test.sh b/scripts/contrib/build-perf-test.sh
index cdd7885dca..105b54b35c 100755
--- a/scripts/contrib/build-perf-test.sh
+++ b/scripts/contrib/build-perf-test.sh
@@ -128,7 +128,7 @@ rev=$(git rev-parse --short HEAD) || exit 1
OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`"
BUILDDIR="$OUTDIR/build"
resultsfile="$OUTDIR/results.log"
-bboutput="$OUTDIR/bitbake.log"
+cmdoutput="$OUTDIR/commands.log"
myoutput="$OUTDIR/output.log"
globalres="$clonedir/build-perf-test/globalres.log"
@@ -180,14 +180,13 @@ time_count=0
declare -a SIZES
size_count=0
-bbtime () {
- local arg="$@"
- log " Timing: bitbake ${arg}"
+time_cmd () {
+ log " Timing: $*"
if [ $verbose -eq 0 ]; then
- /usr/bin/time -v -o $resultsfile bitbake ${arg} >> $bboutput
+ /usr/bin/time -v -o $resultsfile "$@" >> $cmdoutput
else
- /usr/bin/time -v -o $resultsfile bitbake ${arg}
+ /usr/bin/time -v -o $resultsfile "$@"
fi
ret=$?
if [ $ret -eq 0 ]; then
@@ -206,12 +205,16 @@ bbtime () {
log "More stats can be found in ${resultsfile}.${i}"
}
+bbtime () {
+ time_cmd bitbake "$@"
+}
+
#we don't time bitbake here
bbnotime () {
local arg="$@"
log " Running: bitbake ${arg}"
if [ $verbose -eq 0 ]; then
- bitbake ${arg} >> $bboutput
+ bitbake ${arg} >> $cmdoutput
else
bitbake ${arg}
fi