scripts/contrib/build-perf-test.sh: add timings for bitbake -p
Add another test to time bitbake -p with and without cache/ or tmp/cache. (From OE-Core rev: 3ed59ee53ee7d87694670a7ba864165146b90a6b) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
a105bc40ad
commit
851f1e368b
|
@ -49,7 +49,7 @@ Options:
|
||||||
-t <val>
|
-t <val>
|
||||||
Value for BB_NUMBER_THREADS. Default is 8.
|
Value for BB_NUMBER_THREADS. Default is 8.
|
||||||
-i <image-name>
|
-i <image-name>
|
||||||
Instead of timing agains core-image-sato, use <image-name>
|
Instead of timing against core-image-sato, use <image-name>
|
||||||
-d <path>
|
-d <path>
|
||||||
Use <path> as DL_DIR
|
Use <path> as DL_DIR
|
||||||
-p <githash>
|
-p <githash>
|
||||||
|
@ -173,7 +173,7 @@ declare -a TIMES
|
||||||
time_count=0
|
time_count=0
|
||||||
|
|
||||||
bbtime () {
|
bbtime () {
|
||||||
log "Timing: bitbake $1"
|
log " Timing: bitbake $1"
|
||||||
|
|
||||||
if [ $verbose -eq 0 ]; then
|
if [ $verbose -eq 0 ]; then
|
||||||
/usr/bin/time -v -o $resultsfile bitbake "$1" >> $bboutput
|
/usr/bin/time -v -o $resultsfile bitbake "$1" >> $bboutput
|
||||||
|
@ -183,11 +183,11 @@ bbtime () {
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 0 ]; then
|
if [ $ret -eq 0 ]; then
|
||||||
t=`grep wall $resultsfile | sed 's/.*m:ss): //'`
|
t=`grep wall $resultsfile | sed 's/.*m:ss): //'`
|
||||||
log "Time: $t"
|
log " TIME: $t"
|
||||||
TIMES[(( time_count++ ))]="$t"
|
TIMES[(( time_count++ ))]="$t"
|
||||||
else
|
else
|
||||||
log "Exit status was non-zero. Exit..."
|
log "ERROR: exit status was non-zero, will report time as 0."
|
||||||
#exit $ret
|
TIMES[(( time_count++ ))]="0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#time by default overwrites the output file and we want to keep the results
|
#time by default overwrites the output file and we want to keep the results
|
||||||
|
@ -199,7 +199,7 @@ bbtime () {
|
||||||
|
|
||||||
#we don't time bitbake here
|
#we don't time bitbake here
|
||||||
bbnotime () {
|
bbnotime () {
|
||||||
log "Running: bitbake $1"
|
log " Running: bitbake $1"
|
||||||
if [ $verbose -eq 0 ]; then
|
if [ $verbose -eq 0 ]; then
|
||||||
bitbake "$1" >> $bboutput
|
bitbake "$1" >> $bboutput
|
||||||
else
|
else
|
||||||
|
@ -207,24 +207,24 @@ bbnotime () {
|
||||||
fi
|
fi
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 0 ]; then
|
if [ $ret -eq 0 ]; then
|
||||||
log "Finished bitbake $1"
|
log " Finished bitbake $1"
|
||||||
else
|
else
|
||||||
log "Exit status was non-zero. Exit.."
|
log "ERROR: exit status was non-zero. Exit.."
|
||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
do_rmtmp() {
|
do_rmtmp() {
|
||||||
log "Removing tmp"
|
log " Removing tmp"
|
||||||
rm -rf bitbake.lock pseudodone tmp conf/sanity_info
|
rm -rf bitbake.lock pseudodone conf/sanity_info cache tmp
|
||||||
}
|
}
|
||||||
do_rmsstate () {
|
do_rmsstate () {
|
||||||
log "Removing sstate-cache"
|
log " Removing sstate-cache"
|
||||||
rm -rf sstate-cache
|
rm -rf sstate-cache
|
||||||
}
|
}
|
||||||
do_sync () {
|
do_sync () {
|
||||||
log "Syncing and dropping caches"
|
log " Syncing and dropping caches"
|
||||||
sync; sync
|
sync; sync
|
||||||
if [ $reqpass -eq 0 ]; then
|
if [ $reqpass -eq 0 ]; then
|
||||||
sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
|
sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
|
||||||
|
@ -248,7 +248,7 @@ do_sync () {
|
||||||
# - time bitbake core-image-sato
|
# - time bitbake core-image-sato
|
||||||
# - collect data
|
# - collect data
|
||||||
# Part2:
|
# Part2:
|
||||||
# - bitbake virtual/kernel -c
|
# - bitbake virtual/kernel -c cleansstate
|
||||||
# - time bitbake virtual/kernel
|
# - time bitbake virtual/kernel
|
||||||
# Part3:
|
# Part3:
|
||||||
# - add INHERIT to local.conf
|
# - add INHERIT to local.conf
|
||||||
|
@ -263,15 +263,14 @@ do_rmtmp
|
||||||
do_rmsstate
|
do_rmsstate
|
||||||
do_sync
|
do_sync
|
||||||
bbtime "$IMAGE"
|
bbtime "$IMAGE"
|
||||||
log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
|
log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
|
||||||
log "Buildstats are saved in $OUTDIR/buildstats-test1"
|
log "Buildstats are saved in $OUTDIR/buildstats-test1"
|
||||||
mv tmp/buildstats $OUTDIR/buildstats-test1
|
mv tmp/buildstats $OUTDIR/buildstats-test1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
test1_p2 () {
|
test1_p2 () {
|
||||||
log "Running Test 1, part 2/3: bitbake virtual/kernel -c clean && cleansstate and time bitbake virtual/kernel"
|
log "Running Test 1, part 2/3: bitbake virtual/kernel -c cleansstate and time bitbake virtual/kernel"
|
||||||
bbnotime "virtual/kernel -c clean"
|
|
||||||
bbnotime "virtual/kernel -c cleansstate"
|
bbnotime "virtual/kernel -c cleansstate"
|
||||||
do_sync
|
do_sync
|
||||||
bbtime "virtual/kernel"
|
bbtime "virtual/kernel"
|
||||||
|
@ -280,12 +279,12 @@ bbtime "virtual/kernel"
|
||||||
test1_p3 () {
|
test1_p3 () {
|
||||||
log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled"
|
log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled"
|
||||||
echo "INHERIT += \"rm_work\"" >> conf/local.conf
|
echo "INHERIT += \"rm_work\"" >> conf/local.conf
|
||||||
#do_rmtmp
|
do_rmtmp
|
||||||
#do_rmsstate
|
do_rmsstate
|
||||||
do_sync
|
do_sync
|
||||||
bbtime "$IMAGE"
|
bbtime "$IMAGE"
|
||||||
sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf
|
sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf
|
||||||
log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
|
log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
|
||||||
log "Buildstats are saved in $OUTDIR/buildstats-test13"
|
log "Buildstats are saved in $OUTDIR/buildstats-test13"
|
||||||
mv tmp/buildstats $OUTDIR/buildstats-test13
|
mv tmp/buildstats $OUTDIR/buildstats-test13
|
||||||
}
|
}
|
||||||
|
@ -305,14 +304,37 @@ bbtime "$IMAGE -c rootfs"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Test 3
|
||||||
|
# parsing time metrics
|
||||||
|
#
|
||||||
|
# Start with
|
||||||
|
# i) "rm -rf tmp/cache; time bitbake -p"
|
||||||
|
# ii) "rm -rf tmp/cache/default-eglibc/; time bitbake -p"
|
||||||
|
# iii) "time bitbake -p"
|
||||||
|
|
||||||
|
|
||||||
|
test3 () {
|
||||||
|
log "Running Test 3: Parsing time metrics (bitbake -p)"
|
||||||
|
log " Removing tmp/cache && cache"
|
||||||
|
rm -rf tmp/cache cache
|
||||||
|
bbtime "-p"
|
||||||
|
log " Removing tmp/cache/default-eglibc/"
|
||||||
|
rm -rf tmp/cache/default-eglibc/
|
||||||
|
bbtime "-p"
|
||||||
|
bbtime "-p"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# RUN!
|
# RUN!
|
||||||
|
|
||||||
test1_p1
|
test1_p1
|
||||||
test1_p2
|
test1_p2
|
||||||
test1_p3
|
test1_p3
|
||||||
test2
|
test2
|
||||||
|
test3
|
||||||
|
|
||||||
log "All done"
|
log "All done, cleaning up..."
|
||||||
|
|
||||||
do_rmtmp
|
do_rmtmp
|
||||||
do_rmsstate
|
do_rmsstate
|
||||||
|
|
Loading…
Reference in New Issue