mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
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. (From OE-Core rev: 7b355dc96255b06f3108a7d02ab0ed408d64bf1b) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
44fee2bb7a
commit
5c367eccf8
@@ -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"`"
|
OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`"
|
||||||
BUILDDIR="$OUTDIR/build"
|
BUILDDIR="$OUTDIR/build"
|
||||||
resultsfile="$OUTDIR/results.log"
|
resultsfile="$OUTDIR/results.log"
|
||||||
bboutput="$OUTDIR/bitbake.log"
|
cmdoutput="$OUTDIR/commands.log"
|
||||||
myoutput="$OUTDIR/output.log"
|
myoutput="$OUTDIR/output.log"
|
||||||
globalres="$clonedir/build-perf-test/globalres.log"
|
globalres="$clonedir/build-perf-test/globalres.log"
|
||||||
|
|
||||||
@@ -180,14 +180,13 @@ time_count=0
|
|||||||
declare -a SIZES
|
declare -a SIZES
|
||||||
size_count=0
|
size_count=0
|
||||||
|
|
||||||
bbtime () {
|
time_cmd () {
|
||||||
local arg="$@"
|
log " Timing: $*"
|
||||||
log " Timing: bitbake ${arg}"
|
|
||||||
|
|
||||||
if [ $verbose -eq 0 ]; then
|
if [ $verbose -eq 0 ]; then
|
||||||
/usr/bin/time -v -o $resultsfile bitbake ${arg} >> $bboutput
|
/usr/bin/time -v -o $resultsfile "$@" >> $cmdoutput
|
||||||
else
|
else
|
||||||
/usr/bin/time -v -o $resultsfile bitbake ${arg}
|
/usr/bin/time -v -o $resultsfile "$@"
|
||||||
fi
|
fi
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 0 ]; then
|
if [ $ret -eq 0 ]; then
|
||||||
@@ -206,12 +205,16 @@ bbtime () {
|
|||||||
log "More stats can be found in ${resultsfile}.${i}"
|
log "More stats can be found in ${resultsfile}.${i}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bbtime () {
|
||||||
|
time_cmd bitbake "$@"
|
||||||
|
}
|
||||||
|
|
||||||
#we don't time bitbake here
|
#we don't time bitbake here
|
||||||
bbnotime () {
|
bbnotime () {
|
||||||
local arg="$@"
|
local arg="$@"
|
||||||
log " Running: bitbake ${arg}"
|
log " Running: bitbake ${arg}"
|
||||||
if [ $verbose -eq 0 ]; then
|
if [ $verbose -eq 0 ]; then
|
||||||
bitbake ${arg} >> $bboutput
|
bitbake ${arg} >> $cmdoutput
|
||||||
else
|
else
|
||||||
bitbake ${arg}
|
bitbake ${arg}
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user