Skip to contentSkip to conversation

build-perf-test.sh: more generic timing function

PATCH New Markus Lehtonen 1 participant 2 messages Jan 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 build-perf-test.sh: more generic timing function

Make it possible to time also other than bitbake commands. The name of the log file is changed from bitbake.log to commands.log.

---
 scripts/contrib/build-perf-test.sh | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
scripts/contrib/build-perf-test.sh +10 -7
index cdd7885..105b54b 100755
@@ -128,7 +128,7 @@ rev=$(git rev-parse --short HEAD)  || exit 1
 OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`"
 BUILDDIR="$OUTDIR/build"
 resultsfile="$OUTDIR/results.log"
-bboutput="$OUTDIR/bitbake.log"
+cmdoutput="$OUTDIR/commands.log"
 myoutput="$OUTDIR/output.log"
 globalres="$clonedir/build-perf-test/globalres.log"
 
@@ -180,14 +180,13 @@ time_count=0
 declare -a SIZES
 size_count=0
 
-bbtime () {
-    local arg="$@"
-    log "   Timing: bitbake ${arg}"
+time_cmd () {
+    log "   Timing: $*"
 
     if [ $verbose -eq 0 ]; then 
-        /usr/bin/time -v -o $resultsfile bitbake ${arg} >> $bboutput
+        /usr/bin/time -v -o $resultsfile "$@" >> $cmdoutput
     else
-        /usr/bin/time -v -o $resultsfile bitbake ${arg}
+        /usr/bin/time -v -o $resultsfile "$@"
     fi
     ret=$?
     if [ $ret -eq 0 ]; then
@@ -206,12 +205,16 @@ bbtime () {
     log "More stats can be found in ${resultsfile}.${i}"    
 }
 
+bbtime () {
+    time_cmd bitbake "$@"
+}
+
 #we don't time bitbake here
 bbnotime () {
     local arg="$@"
     log "   Running: bitbake ${arg}"
     if [ $verbose -eq 0 ]; then
-        bitbake ${arg} >> $bboutput
+        bitbake ${arg} >> $cmdoutput
     else
         bitbake ${arg}
     fi
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 build-perf-test.sh: add eSDK testing

Add simple initial eSDK test. Currently, only download size and installation time of eSDK is measured. The eSDK to be tested is generated from the same image that the other tests are run for. This patch will add two new fields to the global results log and that needs to be taken into account when examining the results.

---
 scripts/contrib/build-perf-test.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
scripts/contrib/build-perf-test.sh +24 -0
index 105b54b..f1f44d3 100755
@@ -353,6 +353,29 @@ test3 () {
     bbtime -p
 }
 
+#
+# Test 4 - eSDK
+# Measure: eSDK size and installation time
+test4 () {
+    log "Running Test 4: eSDK size and installation time"
+    bbnotime $IMAGE -c do_populate_sdk_ext
+
+    esdk_installer=(tmp/deploy/sdk/*-toolchain-ext-*.sh)
+
+    if [ ${#esdk_installer[*]} -eq 1 ]; then
+        s=$((`stat -c %s "$esdk_installer"` / 1024))
+        SIZES[(( size_count++ ))]="$s"
+        log "Download SIZE of eSDK is: $s kB"
+
+        do_sync
+        time_cmd "$esdk_installer" -y -d "tmp/esdk-deploy"
+    else
+        log "ERROR: other than one sdk found (${esdk_installer[*]}), reporting size and time as 0."
+        SIZES[(( size_count++ ))]="0"
+        TIMES[(( time_count++ ))]="0"
+    fi
+
+}
 
 
 # RUN!
@@ -362,6 +385,7 @@ test1_p2
 test1_p3
 test2
 test3
+test4
 
 # if we got til here write to global results
 write_results
Signature · 1 line
2.1.4