Skip to contentSkip to conversation

Small fixes for the build perf script

PATCH New Stefan Stanacar 1 participant 3 messages Jun 12, 2013

lore
Share & tools
lore
#0 lore raw

cover Small fixes for the build perf script

The following changes since commit b87429fdb45f82ebe4060fea8c4ecd6e4bc1ae52:

bitbake: Add missing file that went out of sync (2013-06-12 13:13:21 +0100)

are available in the git repository at:

git://mirror.rb.intel.com/git.yoctoproject.org/poky-contrib stefans/perf-test3

for you to fetch changes up to 18d3270bff2b2d28d879db0c9646a588d457b688:

scripts/contrib/build-perf-test.sh: fix passing arguments (2013-06-12 18:00:17 +0300)

----------------------------------------------------------------
Stefan Stanacar (2):
scripts/contrib/build-perf-test.sh: add branch name and sizes to results scripts/contrib/build-perf-test.sh: fix passing arguments

 scripts/contrib/build-perf-test.sh | 60 +++++++++++++++++++++++---------------
 1 file changed, 36 insertions(+), 24 deletions(-)

Stefan Stanacar (2):
scripts/contrib/build-perf-test.sh: add branch name and sizes to
results
scripts/contrib/build-perf-test.sh: fix passing arguments

 scripts/contrib/build-perf-test.sh | 60 +++++++++++++++++++++++---------------
 1 file changed, 36 insertions(+), 24 deletions(-)
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/2 scripts/contrib/build-perf-test.sh: add branch name and sizes to results

Be more descriptive about the revision we are running on
in the global results file: add branch:commit and git describe fields. Also add the sizes for tmp dir not only times. (previously these were only available in the output.log)

---
 scripts/contrib/build-perf-test.sh | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
scripts/contrib/build-perf-test.sh +17 -7
index 0af2cfe..8d243f0 100755
@@ -112,9 +112,9 @@ if [ $reqpass -ne 0 ]; then
 fi
 
 if [ -n "$commit" ]; then
-            echo "git checkout $commit"
+            echo "git checkout -f $commit"
             git pull > /dev/null 2>&1
-            git checkout $commit || exit 1
+            git checkout -f $commit || exit 1
             git pull > /dev/null 2>&1
 fi
 
@@ -144,8 +144,9 @@ log () {
 # Config stuff
 #
 
-rev=$(git rev-parse HEAD) || exit 1
-log "Git revision is $rev"
+branch=`git branch 2>&1 | grep "^* " | tr -d "* "`
+gitcommit=$(git rev-parse HEAD)  || exit 1
+log "Running on $branch:$gitcommit"
 
 source ./oe-init-build-env $OUTDIR/build >/dev/null || exit 1
 cd $OUTDIR/build
@@ -175,6 +176,8 @@ echo "CONNECTIVITY_CHECK_URIS =\"\"" >> conf/local.conf
 
 declare -a TIMES
 time_count=0
+declare -a SIZES
+size_count=0
 
 bbtime () {
     log "   Timing: bitbake $1"
@@ -240,10 +243,13 @@ do_sync () {
 }
 
 write_results() {
-    echo -n "`uname -n`,$rev," >> $globalres
+    echo -n "`uname -n`,$branch:$gitcommit,`git describe`," >> $globalres
     for i in "${TIMES[@]}"; do
         echo -n "$i," >> $globalres
     done
+    for i in "${SIZES[@]}"; do
+        echo -n "$i," >> $globalres
+    done
     echo >> $globalres
     sed -i '$ s/,$//' $globalres
 }
@@ -276,7 +282,9 @@ test1_p1 () {
     do_rmsstate
     do_sync
     bbtime "$IMAGE"
-    log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
+    s=`du -sh tmp | sed 's/tmp//'`
+    SIZES[(( size_count++ ))]="$s"
+    log "SIZE of tmp dir is: $s"
     log "Buildstats are saved in $OUTDIR/buildstats-test1"
     mv tmp/buildstats $OUTDIR/buildstats-test1
 }
@@ -297,7 +305,9 @@ test1_p3 () {
     do_sync
     bbtime "$IMAGE"
     sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf
-    log "SIZE of tmp dir is: `du -sh tmp | sed 's/tmp//'`"
+    s=`du -sh tmp | sed 's/tmp//'`
+    SIZES[(( size_count++ ))]="$s"
+    log "SIZE of tmp dir is: $s"
     log "Buildstats are saved in $OUTDIR/buildstats-test13"
     mv tmp/buildstats $OUTDIR/buildstats-test13
 }
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 2/2 scripts/contrib/build-perf-test.sh: fix passing arguments

In reply to Stefan Stanacar

Don't pass arguments to bitbake as a single one, because this will break when the bitbake double-exec is removed.

---
 scripts/contrib/build-perf-test.sh | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)
scripts/contrib/build-perf-test.sh +19 -17
index 8d243f0..ce0fb9a 100755
@@ -180,12 +180,13 @@ declare -a SIZES
 size_count=0
 
 bbtime () {
-    log "   Timing: bitbake $1"
+    local arg="$@"
+    log "   Timing: bitbake ${arg}"
 
     if [ $verbose -eq 0 ]; then 
-        /usr/bin/time -v -o $resultsfile bitbake "$1" >> $bboutput
+        /usr/bin/time -v -o $resultsfile bitbake ${arg} >> $bboutput
     else
-        /usr/bin/time -v -o $resultsfile bitbake "$1" 
+        /usr/bin/time -v -o $resultsfile bitbake ${arg}
     fi
     ret=$?
     if [ $ret -eq 0 ]; then
@@ -206,18 +207,19 @@ bbtime () {
 
 #we don't time bitbake here
 bbnotime () {
-    log "   Running: bitbake $1"
+    local arg="$@"
+    log "   Running: bitbake ${arg}"
     if [ $verbose -eq 0 ]; then
-        bitbake "$1" >> $bboutput
+        bitbake ${arg} >> $bboutput
     else
-        bitbake "$1" 
+        bitbake ${arg}
     fi
     ret=$?
     if [ $ret -eq 0 ]; then
-        log "   Finished bitbake $1"
+        log "   Finished bitbake ${arg}"
     else
         log "ERROR: exit status was non-zero. Exit.."
-        exit $?
+        exit $ret
     fi
 
 }
@@ -277,11 +279,11 @@ write_results() {
 
 test1_p1 () {
     log "Running Test 1, part 1/3: Measure wall clock of bitbake $IMAGE and size of tmp/ dir"
-    bbnotime "$IMAGE -c fetchall"
+    bbnotime $IMAGE -c fetchall
     do_rmtmp
     do_rmsstate
     do_sync
-    bbtime "$IMAGE"
+    bbtime $IMAGE
     s=`du -sh tmp | sed 's/tmp//'`
     SIZES[(( size_count++ ))]="$s"
     log "SIZE of tmp dir is: $s"
@@ -292,9 +294,9 @@ test1_p1 () {
 
 test1_p2 () {
     log "Running Test 1, part 2/3: bitbake virtual/kernel -c cleansstate and time bitbake virtual/kernel"
-    bbnotime "virtual/kernel -c cleansstate"
+    bbnotime virtual/kernel -c cleansstate
     do_sync
-    bbtime "virtual/kernel"
+    bbtime virtual/kernel
 }
 
 test1_p3 () {
@@ -303,7 +305,7 @@ test1_p3 () {
     do_rmtmp
     do_rmsstate
     do_sync
-    bbtime "$IMAGE"
+    bbtime $IMAGE
     sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf
     s=`du -sh tmp | sed 's/tmp//'`
     SIZES[(( size_count++ ))]="$s"
@@ -323,7 +325,7 @@ test2 () {
     log "Running Test 2: Measure wall clock of bitbake $IMAGE -c rootfs with sstate"
     do_rmtmp
     do_sync
-    bbtime "$IMAGE -c rootfs"
+    bbtime $IMAGE -c rootfs
 }
 
 
@@ -340,11 +342,11 @@ test3 () {
     log "Running Test 3: Parsing time metrics (bitbake -p)"
     log "   Removing tmp/cache && cache"
     rm -rf tmp/cache cache
-    bbtime "-p"
+    bbtime -p
     log "   Removing tmp/cache/default-eglibc/"
     rm -rf tmp/cache/default-eglibc/
-    bbtime "-p"
-    bbtime "-p"
+    bbtime -p
+    bbtime -p
 }
 
 
Signature · 1 line
1.8.1.4