diff options
Diffstat (limited to 'scripts/contrib')
-rwxr-xr-x | scripts/contrib/build-perf-test.sh | 62 |
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 | |||
173 | time_count=0 | 173 | time_count=0 |
174 | 174 | ||
175 | bbtime () { | 175 | bbtime () { |
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 |
201 | bbnotime () { | 201 | bbnotime () { |
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 | ||
218 | do_rmtmp() { | 218 | do_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 | } |
222 | do_rmsstate () { | 222 | do_rmsstate () { |
223 | log "Removing sstate-cache" | 223 | log " Removing sstate-cache" |
224 | rm -rf sstate-cache | 224 | rm -rf sstate-cache |
225 | } | 225 | } |
226 | do_sync () { | 226 | do_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 | |||
263 | do_rmsstate | 263 | do_rmsstate |
264 | do_sync | 264 | do_sync |
265 | bbtime "$IMAGE" | 265 | bbtime "$IMAGE" |
266 | log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`" | 266 | log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`" |
267 | log "Buildstats are saved in $OUTDIR/buildstats-test1" | 267 | log "Buildstats are saved in $OUTDIR/buildstats-test1" |
268 | mv tmp/buildstats $OUTDIR/buildstats-test1 | 268 | mv tmp/buildstats $OUTDIR/buildstats-test1 |
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
272 | test1_p2 () { | 272 | test1_p2 () { |
273 | log "Running Test 1, part 2/3: bitbake virtual/kernel -c clean && cleansstate and time bitbake virtual/kernel" | 273 | log "Running Test 1, part 2/3: bitbake virtual/kernel -c cleansstate and time bitbake virtual/kernel" |
274 | bbnotime "virtual/kernel -c clean" | ||
275 | bbnotime "virtual/kernel -c cleansstate" | 274 | bbnotime "virtual/kernel -c cleansstate" |
276 | do_sync | 275 | do_sync |
277 | bbtime "virtual/kernel" | 276 | bbtime "virtual/kernel" |
@@ -280,12 +279,12 @@ bbtime "virtual/kernel" | |||
280 | test1_p3 () { | 279 | test1_p3 () { |
281 | log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled" | 280 | log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled" |
282 | echo "INHERIT += \"rm_work\"" >> conf/local.conf | 281 | echo "INHERIT += \"rm_work\"" >> conf/local.conf |
283 | #do_rmtmp | 282 | do_rmtmp |
284 | #do_rmsstate | 283 | do_rmsstate |
285 | do_sync | 284 | do_sync |
286 | bbtime "$IMAGE" | 285 | bbtime "$IMAGE" |
287 | sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf | 286 | sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf |
288 | log "Size of tmp dir is: `du -sh tmp | sed 's/tmp//'`" | 287 | log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`" |
289 | log "Buildstats are saved in $OUTDIR/buildstats-test13" | 288 | log "Buildstats are saved in $OUTDIR/buildstats-test13" |
290 | mv tmp/buildstats $OUTDIR/buildstats-test13 | 289 | mv 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 | |||
316 | test3 () { | ||
317 | log "Running Test 3: Parsing time metrics (bitbake -p)" | ||
318 | log " Removing tmp/cache && cache" | ||
319 | rm -rf tmp/cache cache | ||
320 | bbtime "-p" | ||
321 | log " Removing tmp/cache/default-eglibc/" | ||
322 | rm -rf tmp/cache/default-eglibc/ | ||
323 | bbtime "-p" | ||
324 | bbtime "-p" | ||
325 | } | ||
326 | |||
327 | |||
328 | |||
308 | # RUN! | 329 | # RUN! |
309 | 330 | ||
310 | test1_p1 | 331 | test1_p1 |
311 | test1_p2 | 332 | test1_p2 |
312 | test1_p3 | 333 | test1_p3 |
313 | test2 | 334 | test2 |
335 | test3 | ||
314 | 336 | ||
315 | log "All done" | 337 | log "All done, cleaning up..." |
316 | 338 | ||
317 | do_rmtmp | 339 | do_rmtmp |
318 | do_rmsstate | 340 | do_rmsstate |