summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-03-29 17:10:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-29 16:23:11 +0000
commit851f1e368bea57e090a924330a08a793abfcfa55 (patch)
treeae76c18d1f14ec505e94f8db0abae43c47c0690d
parenta105bc40adcfcca752b3a81f16488e8b902deb4d (diff)
downloadpoky-851f1e368bea57e090a924330a08a793abfcfa55.tar.gz
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>
-rwxr-xr-xscripts/contrib/build-perf-test.sh62
1 files changed, 42 insertions, 20 deletions
diff --git a/scripts/contrib/build-perf-test.sh b/scripts/contrib/build-perf-test.sh
index 103475d320..44a902c135 100755
--- a/scripts/contrib/build-perf-test.sh
+++ b/scripts/contrib/build-perf-test.sh
@@ -49,7 +49,7 @@ Options:
49 -t <val> 49 -t <val>
50 Value for BB_NUMBER_THREADS. Default is 8. 50 Value for BB_NUMBER_THREADS. Default is 8.
51 -i <image-name> 51 -i <image-name>
52 Instead of timing agains core-image-sato, use <image-name> 52 Instead of timing against core-image-sato, use <image-name>
53 -d <path> 53 -d <path>
54 Use <path> as DL_DIR 54 Use <path> as DL_DIR
55 -p <githash> 55 -p <githash>
@@ -173,7 +173,7 @@ declare -a TIMES
173time_count=0 173time_count=0
174 174
175bbtime () { 175bbtime () {
176 log "Timing: bitbake $1" 176 log " Timing: bitbake $1"
177 177
178 if [ $verbose -eq 0 ]; then 178 if [ $verbose -eq 0 ]; then
179 /usr/bin/time -v -o $resultsfile bitbake "$1" >> $bboutput 179 /usr/bin/time -v -o $resultsfile bitbake "$1" >> $bboutput
@@ -183,11 +183,11 @@ bbtime () {
183 ret=$? 183 ret=$?
184 if [ $ret -eq 0 ]; then 184 if [ $ret -eq 0 ]; then
185 t=`grep wall $resultsfile | sed 's/.*m:ss): //'` 185 t=`grep wall $resultsfile | sed 's/.*m:ss): //'`
186 log "Time: $t" 186 log " TIME: $t"
187 TIMES[(( time_count++ ))]="$t" 187 TIMES[(( time_count++ ))]="$t"
188 else 188 else
189 log "Exit status was non-zero. Exit..." 189 log "ERROR: exit status was non-zero, will report time as 0."
190 #exit $ret 190 TIMES[(( time_count++ ))]="0"
191 fi 191 fi
192 192
193 #time by default overwrites the output file and we want to keep the results 193 #time by default overwrites the output file and we want to keep the results
@@ -199,7 +199,7 @@ bbtime () {
199 199
200#we don't time bitbake here 200#we don't time bitbake here
201bbnotime () { 201bbnotime () {
202 log "Running: bitbake $1" 202 log " Running: bitbake $1"
203 if [ $verbose -eq 0 ]; then 203 if [ $verbose -eq 0 ]; then
204 bitbake "$1" >> $bboutput 204 bitbake "$1" >> $bboutput
205 else 205 else
@@ -207,24 +207,24 @@ bbnotime () {
207 fi 207 fi
208 ret=$? 208 ret=$?
209 if [ $ret -eq 0 ]; then 209 if [ $ret -eq 0 ]; then
210 log "Finished bitbake $1" 210 log " Finished bitbake $1"
211 else 211 else
212 log "Exit status was non-zero. Exit.." 212 log "ERROR: exit status was non-zero. Exit.."
213 exit $? 213 exit $?
214 fi 214 fi
215 215
216} 216}
217 217
218do_rmtmp() { 218do_rmtmp() {
219 log "Removing tmp" 219 log " Removing tmp"
220 rm -rf bitbake.lock pseudodone tmp conf/sanity_info 220 rm -rf bitbake.lock pseudodone conf/sanity_info cache tmp
221} 221}
222do_rmsstate () { 222do_rmsstate () {
223 log "Removing sstate-cache" 223 log " Removing sstate-cache"
224 rm -rf sstate-cache 224 rm -rf sstate-cache
225} 225}
226do_sync () { 226do_sync () {
227 log "Syncing and dropping caches" 227 log " Syncing and dropping caches"
228 sync; sync 228 sync; sync
229 if [ $reqpass -eq 0 ]; then 229 if [ $reqpass -eq 0 ]; then
230 sudo sh -c "echo 3 > /proc/sys/vm/drop_caches" 230 sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
@@ -248,7 +248,7 @@ do_sync () {
248# - time bitbake core-image-sato 248# - time bitbake core-image-sato
249# - collect data 249# - collect data
250# Part2: 250# Part2:
251# - bitbake virtual/kernel -c 251# - bitbake virtual/kernel -c cleansstate
252# - time bitbake virtual/kernel 252# - time bitbake virtual/kernel
253# Part3: 253# Part3:
254# - add INHERIT to local.conf 254# - add INHERIT to local.conf
@@ -263,15 +263,14 @@ do_rmtmp
263do_rmsstate 263do_rmsstate
264do_sync 264do_sync
265bbtime "$IMAGE" 265bbtime "$IMAGE"
266log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`" 266log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
267log "Buildstats are saved in $OUTDIR/buildstats-test1" 267log "Buildstats are saved in $OUTDIR/buildstats-test1"
268mv tmp/buildstats $OUTDIR/buildstats-test1 268mv tmp/buildstats $OUTDIR/buildstats-test1
269} 269}
270 270
271 271
272test1_p2 () { 272test1_p2 () {
273log "Running Test 1, part 2/3: bitbake virtual/kernel -c clean && cleansstate and time bitbake virtual/kernel" 273log "Running Test 1, part 2/3: bitbake virtual/kernel -c cleansstate and time bitbake virtual/kernel"
274bbnotime "virtual/kernel -c clean"
275bbnotime "virtual/kernel -c cleansstate" 274bbnotime "virtual/kernel -c cleansstate"
276do_sync 275do_sync
277bbtime "virtual/kernel" 276bbtime "virtual/kernel"
@@ -280,12 +279,12 @@ bbtime "virtual/kernel"
280test1_p3 () { 279test1_p3 () {
281log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled" 280log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled"
282echo "INHERIT += \"rm_work\"" >> conf/local.conf 281echo "INHERIT += \"rm_work\"" >> conf/local.conf
283#do_rmtmp 282do_rmtmp
284#do_rmsstate 283do_rmsstate
285do_sync 284do_sync
286bbtime "$IMAGE" 285bbtime "$IMAGE"
287sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf 286sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf
288log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`" 287log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
289log "Buildstats are saved in $OUTDIR/buildstats-test13" 288log "Buildstats are saved in $OUTDIR/buildstats-test13"
290mv tmp/buildstats $OUTDIR/buildstats-test13 289mv tmp/buildstats $OUTDIR/buildstats-test13
291} 290}
@@ -305,14 +304,37 @@ bbtime "$IMAGE -c rootfs"
305} 304}
306 305
307 306
307# Test 3
308# parsing time metrics
309#
310# Start with
311# i) "rm -rf tmp/cache; time bitbake -p"
312# ii) "rm -rf tmp/cache/default-eglibc/; time bitbake -p"
313# iii) "time bitbake -p"
314
315
316test3 () {
317log "Running Test 3: Parsing time metrics (bitbake -p)"
318log " Removing tmp/cache && cache"
319rm -rf tmp/cache cache
320bbtime "-p"
321log " Removing tmp/cache/default-eglibc/"
322rm -rf tmp/cache/default-eglibc/
323bbtime "-p"
324bbtime "-p"
325}
326
327
328
308# RUN! 329# RUN!
309 330
310test1_p1 331test1_p1
311test1_p2 332test1_p2
312test1_p3 333test1_p3
313test2 334test2
335test3
314 336
315log "All done" 337log "All done, cleaning up..."
316 338
317do_rmtmp 339do_rmtmp
318do_rmsstate 340do_rmsstate