summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-03-29 17:10:21 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-29 16:23:11 +0000
commitc6f9e4a67591ffc1e0cc28f9e2480f62a8d156be (patch)
tree61af09675fbccd1ffab0a379f8bb765f0fa44ac6
parent5769b5971fdf58c0cf97ffb6fc7268b7fb802601 (diff)
downloadpoky-c6f9e4a67591ffc1e0cc28f9e2480f62a8d156be.tar.gz
scripts/contrib/build-perf-test.sh: add a global results file
Append results from each run to a single file in order to keep a history. Also do some cosmetic changes and fix some whitespace. (From OE-Core rev: 9b99b4e9284071501859df5631e9019b3000ffe9) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/contrib/build-perf-test.sh43
1 files changed, 27 insertions, 16 deletions
diff --git a/scripts/contrib/build-perf-test.sh b/scripts/contrib/build-perf-test.sh
index 2d70cfae52..0f7a3a9ae5 100755
--- a/scripts/contrib/build-perf-test.sh
+++ b/scripts/contrib/build-perf-test.sh
@@ -108,8 +108,9 @@ fi
108 108
109if [ -n "$commit" ]; then 109if [ -n "$commit" ]; then
110 echo "git checkout $commit" 110 echo "git checkout $commit"
111 git pull > /dev/null 2>&1
111 git checkout $commit || exit 1 112 git checkout $commit || exit 1
112 git pull || exit 1 113 git pull > /dev/null 2>&1
113fi 114fi
114 115
115rev=$(git rev-parse --short HEAD) || exit 1 116rev=$(git rev-parse --short HEAD) || exit 1
@@ -118,6 +119,7 @@ BUILDDIR="$OUTDIR/build"
118resultsfile="$OUTDIR/results.log" 119resultsfile="$OUTDIR/results.log"
119bboutput="$OUTDIR/bitbake.log" 120bboutput="$OUTDIR/bitbake.log"
120myoutput="$OUTDIR/output.log" 121myoutput="$OUTDIR/output.log"
122globalres="$clonedir/build-perf-test/globalres.log"
121 123
122mkdir -p $OUTDIR || exit 1 124mkdir -p $OUTDIR || exit 1
123 125
@@ -131,9 +133,10 @@ log () {
131# Config stuff 133# Config stuff
132# 134#
133 135
136rev=$(git rev-parse HEAD) || exit 1
134log "Git revision is $rev" 137log "Git revision is $rev"
135 138
136source ./oe-init-build-env $OUTDIR/build >/dev/null 139source ./oe-init-build-env $OUTDIR/build >/dev/null || exit 1
137cd $OUTDIR/build 140cd $OUTDIR/build
138 141
139[ -n "$MACHINE" ] || export MACHINE="qemux86" 142[ -n "$MACHINE" ] || export MACHINE="qemux86"
@@ -155,8 +158,12 @@ fi
155# Functions 158# Functions
156# 159#
157 160
161declare -a TIMES
162time_count=0
163
158bbtime () { 164bbtime () {
159 log "Running and timing bitbake $1" 165 log "Timing: bitbake $1"
166
160 if [ $verbose -eq 0 ]; then 167 if [ $verbose -eq 0 ]; then
161 /usr/bin/time -v -o $resultsfile bitbake "$1" >> $bboutput 168 /usr/bin/time -v -o $resultsfile bitbake "$1" >> $bboutput
162 else 169 else
@@ -164,13 +171,14 @@ bbtime () {
164 fi 171 fi
165 ret=$? 172 ret=$?
166 if [ $ret -eq 0 ]; then 173 if [ $ret -eq 0 ]; then
167 log "Finished bitbake $1" 174 t=`grep wall $resultsfile | sed 's/.*m:ss): //'`
175 log "Time: $t"
176 TIMES[(( time_count++ ))]="$t"
168 else 177 else
169 log "Exit status was non-zero. Exit..." 178 log "Exit status was non-zero. Exit..."
170 exit $ret 179 exit $ret
171 fi 180 fi
172 181
173 log "Time: `grep wall $resultsfile`"
174 #time by default overwrites the output file and we want to keep the results 182 #time by default overwrites the output file and we want to keep the results
175 #it has an append option but I don't want to clobber the results in the same file 183 #it has an append option but I don't want to clobber the results in the same file
176 i=`ls $OUTDIR/results.log* |wc -l` 184 i=`ls $OUTDIR/results.log* |wc -l`
@@ -180,7 +188,7 @@ bbtime () {
180 188
181#we don't time bitbake here 189#we don't time bitbake here
182bbnotime () { 190bbnotime () {
183 log "Running bitbake $1" 191 log "Running: bitbake $1"
184 if [ $verbose -eq 0 ]; then 192 if [ $verbose -eq 0 ]; then
185 bitbake "$1" >> $bboutput 193 bitbake "$1" >> $bboutput
186 else 194 else
@@ -198,7 +206,7 @@ bbnotime () {
198 206
199do_rmtmp() { 207do_rmtmp() {
200 log "Removing tmp" 208 log "Removing tmp"
201 rm -rf bitbake.lock pseudone tmp conf/sanity_info 209 rm -rf bitbake.lock pseudodone tmp conf/sanity_info
202} 210}
203do_rmsstate () { 211do_rmsstate () {
204 log "Removing sstate-cache" 212 log "Removing sstate-cache"
@@ -244,7 +252,7 @@ do_rmtmp
244do_rmsstate 252do_rmsstate
245do_sync 253do_sync
246bbtime "$IMAGE" 254bbtime "$IMAGE"
247log "Size of tmp dir is: `du -hc tmp | grep total`" 255log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
248log "Buildstats are saved in $OUTDIR/buildstats-test1" 256log "Buildstats are saved in $OUTDIR/buildstats-test1"
249mv tmp/buildstats $OUTDIR/buildstats-test1 257mv tmp/buildstats $OUTDIR/buildstats-test1
250} 258}
@@ -265,8 +273,10 @@ do_rmtmp
265do_rmsstate 273do_rmsstate
266do_sync 274do_sync
267bbtime "$IMAGE" 275bbtime "$IMAGE"
268log "Size of tmp dir is: `du -hc tmp | grep total`"
269sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf 276sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf
277log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
278log "Buildstats are saved in $OUTDIR/buildstats-test13"
279mv tmp/buildstats $OUTDIR/buildstats-test13
270} 280}
271 281
272 282
@@ -291,11 +301,12 @@ test1_p2
291test1_p3 301test1_p3
292test2 302test2
293 303
294log "All done." 304log "All done"
295
296
297
298
299
300
301 305
306# if we got til here write to global results
307echo "$rev" >> $globalres
308for i in "${TIMES[@]}"; do
309 echo -n "$i," >> $globalres
310done
311echo >> $globalres
312sed -i '$ s/,$//' $globalres