[Libreoffice-commits] buildbot.git: 5 commits - loperf/docs loperf/loperf.sh loperf/utls.sh

Matúš Kukan matus.kukan at collabora.com
Mon Feb 10 13:43:11 PST 2014


 dev/null         |binary
 loperf/loperf.sh |  144 ++++++++++++++++---------------------------------------
 loperf/utls.sh   |   69 --------------------------
 3 files changed, 44 insertions(+), 169 deletions(-)

New commits:
commit 557bcd408b2bc825e1f348f1d6fc61b78b78b6f0
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Jan 16 15:11:46 2014 +0100

    loperf: Deduplicate code into function.

diff --git a/loperf/loperf.sh b/loperf/loperf.sh
index 6a35ab4..c0a31b2 100755
--- a/loperf/loperf.sh
+++ b/loperf/loperf.sh
@@ -75,84 +75,57 @@ function launch {
     fi
 }
 
-# Do a clean launch
-echo "Start offload pvt..."
-cur_log=$(launch)
-
 # Mapping the data to array:
 #
-# offload[0] -> Ir
-# offload[1] -> Dr
-# offload[2] -> Dw
-# offload[3] -> I1mr
-# offload[4] -> D1mr
-# offload[5] -> D1mw
-# offload[6] -> ILmr
-# offload[7] -> DLmr
-# offload[8] -> DLmw
-# offload[9] -> Bc
-# offload[10] -> Bcm
-# offload[11] -> Bi
-# offload[12] -> Bim
-# offload[13] -> Ge
-
-offload_str=$(grep '^summary:' "$cur_log" | sed s/"summary: "//)
-offload=($offload_str)
-if test -n "$GZIP"; then gzip "$cur_log" > /dev/null 2>&1; fi
-
-#Collect data to csv file
-CSV_FN="$CSV_LOG_DIR"/"offload.csv"
-echo -n "$TESTDATE"$'\t'"$LOVERSION" >> "$CSV_FN"
-for i in $(seq 0 13); do
-    echo -n $'\t'${offload[$i]} >> "$CSV_FN"
-done
-# CEst = Ir + 10 Bm + 10 L1m + 20 Ge + 100 L2m + 100 LLm
-CEst=$(expr ${offload[0]} + 10 \* $(expr ${offload[12]} + ${offload[10]}) + 10 \* $(expr ${offload[3]} + ${offload[4]} + ${offload[5]}) + 20 \* ${offload[13]} + 100 \* $(expr ${offload[6]} + ${offload[7]} + ${offload[8]}))
-echo $'\t'$CEst >> "$CSV_FN"
-echo -n "$TESTDATE","$LOVERSION",$CEst >> "$CSV_HISTORY"
-
-# Loaded launch one by one
-echo "Start onload pvt..."
-find $DOCUMENTSDIR -type f |  grep -Ev "\/\." | while read f; do
-    cur_log=$(launch "$f")
-
-    # Mapping the data to array:
-    #
-    # onload[0] -> Ir
-    # onload[1] -> Dr
-    # onload[2] -> Dw
-    # onload[3] -> I1mr
-    # onload[4] -> D1mr
-    # onload[5] -> D1mw
-    # onload[6] -> ILmr
-    # onload[7] -> DLmr
-    # onload[8] -> DLmw
-    # onload[9] -> Bc
-    # onload[10] -> Bcm
-    # onload[11] -> Bi
-    # onload[12] -> Bim
-    # onload[13] -> Ge
-
-    onload_str=$(grep '^summary:' "$cur_log" | sed s/"summary: "//)
-    onload=($onload_str)
-    if test -n "$GZIP"; then gzip "$cur_log" > /dev/null 2>&1; fi
-
-    #Construct the csv file name
-    CSV_FN="$CSV_LOG_DIR"/"onload-${f#$DOCUMENTSDIR\/}".csv
+# data[0] -> Ir
+# data[1] -> Dr
+# data[2] -> Dw
+# data[3] -> I1mr
+# data[4] -> D1mr
+# data[5] -> D1mw
+# data[6] -> ILmr
+# data[7] -> DLmr
+# data[8] -> DLmw
+# data[9] -> Bc
+# data[10] -> Bcm
+# data[11] -> Bi
+# data[12] -> Bim
+# data[13] -> Ge
+
+echo -n "$TESTDATE","$LOVERSION" >> "$CSV_HISTORY"
+
+function write_data {
+    cur_log=$(launch "$1")
+
+    data=($(grep '^summary:' "$cur_log" | sed s/"summary: "//))
+    
+    test -n "$GZIP" && gzip "$cur_log" > /dev/null 2>&1
+
+    #Collect data to csv file
+    test -z "$1" && CSV_FN="$CSV_LOG_DIR"/"offload.csv"
+    test -n "$1" && CSV_FN="$CSV_LOG_DIR"/"onload-${1#$DOCUMENTSDIR\/}".csv
 
     echo -n "$TESTDATE"$'\t'"$LOVERSION" >> "$CSV_FN"
-
-    # Populate onload to CSV_FN
     for i in $(seq 0 13); do
-        echo -n $'\t'${onload[$i]} >> "$CSV_FN"
+        echo -n $'\t'${data[$i]} >> "$CSV_FN"
     done
 
     # CEst = Ir + 10 Bm + 10 L1m + 20 Ge + 100 L2m + 100 LLm
-    CEst=$(expr ${onload[0]} + 10 \* $(expr ${onload[12]} + ${onload[10]}) + 10 \* $(expr ${onload[3]} + ${onload[4]} + ${onload[5]}) + 20 \* ${onload[13]} + 100 \* $(expr ${onload[6]} + ${onload[7]} + ${onload[8]}))
+    CEst=$(expr ${data[0]} + 10 \* $(expr ${data[12]} + ${data[10]}) + 10 \* $(expr ${data[3]} + ${data[4]} + ${data[5]}) + 20 \* ${data[13]} + 100 \* $(expr ${data[6]} + ${data[7]} + ${data[8]}))
     echo $'\t'$CEst >> "$CSV_FN"
     echo -n ",$CEst" >> "$CSV_HISTORY"
+}
+
+# Do a clean launch
+echo "Start offload pvt..."
+$(write_data "")
 
+# Loaded launch one by one
+echo "Start onload pvt..."
+find $DOCUMENTSDIR -type f |  grep -Ev "\/\." | while read f; do
+    $(write_data "$f")
 done
+
 echo "" >> "$CSV_HISTORY"
 $OFFICEBIN --headless --convert-to fods --outdir logs "$CSV_HISTORY"
 
commit 751a86f53e588fdcc317bace102d5a57b69835fd
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Jan 16 14:40:28 2014 +0100

    loperf: Do not log each loperf run. Removes commented out regression checking.
    
    It does not make much sense to report individual performance regressions.
    Instead this script produces history file with all runs, so you can draw
    nice graphs with it.

diff --git a/loperf/loperf.sh b/loperf/loperf.sh
index e302972..6a35ab4 100755
--- a/loperf/loperf.sh
+++ b/loperf/loperf.sh
@@ -52,13 +52,11 @@ LOVERSION="$(get_lo_version "$OFFICEBIN")"
 DT=$(echo "$TESTDATE" | tr -s '\ \+\-\:' "_")
 
 CG_LOG="logs/callgrind/cg-lo-$DT-$LOVERSION"
-PF_LOG="logs/loperf/pf-lo-$DT-$LOVERSION.log"
 ERR_LOG="logs/error.log"
 CSV_LOG_DIR="logs/csv/"
 CSV_HISTORY="logs/history.csv"
 
 mkdir -p logs/callgrind > /dev/null 2>&1
-mkdir -p logs/loperf > /dev/null 2>&1
 mkdir -p "$CSV_LOG_DIR" > /dev/null 2>&1
 test -f "$CSV_HISTORY" || echo -e "time,git-commit,offload$(ls $DOCUMENTSDIR/* | sed s%$DOCUMENTSDIR/%,%g | tr -d '\n')" > "$CSV_HISTORY"
 
@@ -113,14 +111,6 @@ CEst=$(expr ${offload[0]} + 10 \* $(expr ${offload[12]} + ${offload[10]}) + 10 \
 echo $'\t'$CEst >> "$CSV_FN"
 echo -n "$TESTDATE","$LOVERSION",$CEst >> "$CSV_HISTORY"
 
-# Populate offload to PF_LOG
-echo " Ir Dr Dw I1mr D1mr D1mw ILmr DLmr DLmw Bc Bcm Bi Bim Ge" | tee -a "$PF_LOG"
-echo "########################################################" | tee -a "$PF_LOG"
-echo | tee -a "$PF_LOG"
-echo "Offload:" | tee -a "$PF_LOG"
-echo "$offload_str" | tee -a "$PF_LOG"
-echo | tee -a "$PF_LOG"
-
 # Loaded launch one by one
 echo "Start onload pvt..."
 find $DOCUMENTSDIR -type f |  grep -Ev "\/\." | while read f; do
@@ -146,15 +136,6 @@ find $DOCUMENTSDIR -type f |  grep -Ev "\/\." | while read f; do
     onload_str=$(grep '^summary:' "$cur_log" | sed s/"summary: "//)
     onload=($onload_str)
     if test -n "$GZIP"; then gzip "$cur_log" > /dev/null 2>&1; fi
-    # Populate onload to PF_LOG
-    echo "Load: $f" | tee -a "$PF_LOG"
-    echo "$onload_str" | tee -a "$PF_LOG"
-
-    # Populate onload delta to PF_LOG
-    for i in $(seq 0 13); do
-        onload_delta[$i]=$(expr ${onload[$i]} - ${offload[$i]})
-        echo -n ${onload_delta[$i]} " " | tee -a "$PF_LOG"
-    done
 
     #Construct the csv file name
     CSV_FN="$CSV_LOG_DIR"/"onload-${f#$DOCUMENTSDIR\/}".csv
@@ -171,20 +152,9 @@ find $DOCUMENTSDIR -type f |  grep -Ev "\/\." | while read f; do
     echo $'\t'$CEst >> "$CSV_FN"
     echo -n ",$CEst" >> "$CSV_HISTORY"
 
-    echo | tee -a "$PF_LOG"
-    echo | tee -a "$PF_LOG"
-
 done
 echo "" >> "$CSV_HISTORY"
 $OFFICEBIN --headless --convert-to fods --outdir logs "$CSV_HISTORY"
 
 # Clean old callgrind files
 find "logs/callgrind" -type f -mtime +10 -exec rm {} \;
-
-# Regression check
-# echo "Regression Status:" | tee -a "$PF_LOG"
-# echo "-----------------" | tee -a "$PF_LOG"
-# find $(dirname $(readlink -f "$PF_LOG")) -type f | grep -v "$PF_LOG" | grep log$ | while read rf; do
-#     check_regression "$PF_LOG" "$rf" | tee -a "$PF_LOG"
-# done
-# grep '^Regression found!$' "$PF_LOG" > /dev/null || echo "Congratulations, no regression found!" | tee -a "$PF_LOG"
diff --git a/loperf/utls.sh b/loperf/utls.sh
index 41bb1a0..9e0d2a7 100755
--- a/loperf/utls.sh
+++ b/loperf/utls.sh
@@ -45,75 +45,6 @@ function get_lo_version {
 
 }
 
-function is_delta_regress {
-    # input two arrays and return an array of regression or 1
-
-    a1=($1)
-    a2=($2)
-
-    if test ${#a1[@]} -eq ${#a2[@]}; then
-        for i in $(seq 0 $(expr ${#a2[@]} - 1)); do
-            arr_result[$i]=$(expr ${a1[$i]} - ${a2[$i]})
-        done
-
-        if [ ${arr_result[0]} -gt 0 ] && [ ${arr_result[3]} -gt 0 ] && [ ${arr_result[6]} -gt 0 ]; then
-            echo -n ${arr_result[@]}
-            return 0
-        else
-            return 2
-        fi
-    else
-        echo "Error: log files format is probably not consistent."
-        return 1
-    fi
-
-    echo "Error: Something was wrong when checking regression"
-    return 1
-
-}
-
-# compare two logs $1 and $2 side by side
-function check_regression {
-
-    # check if logfile $1 has regression against logfile $2
-    # append the regression stat in PF_LOG
-
-    grep 'Reg:' "$1" > /dev/null && echo "Warning: Regression status already in $1"
-
-    # find offload regression
-
-    # find onload regression
-
-    i=0
-    grep "^Load:" "$1" > /tmp/$$
-    while read fn; do
-        arr_onload_files[$i]="$fn"
-        let i=i+1
-    done< "/tmp/$$"
-
-    arr_onload_files_lens=${#arr_onload_files[@]}
-
-    for j in $(seq 0 $(expr $arr_onload_files_lens - 1)); do
-
-        delta1="$(grep -A2 "${arr_onload_files[$j]}" "$1" | tail -n1)"
-        delta2="$(grep -A2 "${arr_onload_files[$j]}" "$2" | tail -n1)"
-
-        r=$(is_delta_regress "$delta1" "$delta2")
-
-        if test $? -eq 0; then
-            echo "Regression found!"
-            echo "Document : ${arr_onload_files[$j]#Load: }"
-            echo "Reference: $2"
-            echo "Diffstats: $r"
-            echo "--------------------------------------"
-            return 0
-        fi
-
-    done
-
-    return 1
-}
-
 
 # A lovely script to compare versions from fgm/stackoverflow:)
 # http://stackoverflow.com/questions/3511006/how-to-compare-versions-of-some-products-in-unix-shell
commit ce0d4b58dce8f18c5f4c1011949fd7d2c67e414b
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Jan 16 14:35:56 2014 +0100

    loperf: Move test documents to test-files.git repository.

diff --git a/loperf/docs/empty.ods b/loperf/docs/empty.ods
deleted file mode 100644
index 6b13dbc..0000000
Binary files a/loperf/docs/empty.ods and /dev/null differ
diff --git a/loperf/docs/empty.odt b/loperf/docs/empty.odt
deleted file mode 100644
index 857387b..0000000
Binary files a/loperf/docs/empty.odt and /dev/null differ
diff --git a/loperf/docs/sample.xlsx b/loperf/docs/sample.xlsx
deleted file mode 100644
index 1c1cfc3..0000000
Binary files a/loperf/docs/sample.xlsx and /dev/null differ
commit cedb649c978fd13ae99c3853682f35263d90bf5a
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Jan 16 14:34:30 2014 +0100

    loperf: Require second parameter for directory with test documents.

diff --git a/loperf/loperf.sh b/loperf/loperf.sh
index 800e27e..e302972 100755
--- a/loperf/loperf.sh
+++ b/loperf/loperf.sh
@@ -42,6 +42,8 @@ fi
 # Post dependency check
 export OOO_DISABLE_RECOVERY=1
 OFFICEBIN="$1"
+DOCUMENTSDIR="$2"
+test -z "$DOCUMENTSDIR" && echo "missing second parameter: directory with documents to test" && exit 1
 
 TESTDATE=$(date --rfc-3339=second)
 
@@ -58,7 +60,7 @@ CSV_HISTORY="logs/history.csv"
 mkdir -p logs/callgrind > /dev/null 2>&1
 mkdir -p logs/loperf > /dev/null 2>&1
 mkdir -p "$CSV_LOG_DIR" > /dev/null 2>&1
-test -f "$CSV_HISTORY" || echo -e "time,git-commit,offload$(ls docs/* | sed s%docs/%,%g | tr -d '\n')" > "$CSV_HISTORY"
+test -f "$CSV_HISTORY" || echo -e "time,git-commit,offload$(ls $DOCUMENTSDIR/* | sed s%$DOCUMENTSDIR/%,%g | tr -d '\n')" > "$CSV_HISTORY"
 
 function launch {
 
@@ -68,7 +70,7 @@ function launch {
         unset OOO_EXIT_POST_STARTUP
         echo -n "$CG_LOG"-offload.log
     else
-        fn=${1#docs\/}
+        fn=${1#$DOCUMENTSDIR\/}
         ext=${fn##*.}
         valgrind --tool=callgrind --callgrind-out-file="$CG_LOG"-onload-"$fn".log --simulate-cache=yes --dump-instr=yes --collect-bus=yes --branch-sim=yes "$OFFICEBIN" --splash-pipe=0 --headless --convert-to "$ext" --outdir tmp "$1" > /dev/null 2>&1
         echo -n "$CG_LOG"-onload-"$fn".log
@@ -121,7 +123,7 @@ echo | tee -a "$PF_LOG"
 
 # Loaded launch one by one
 echo "Start onload pvt..."
-find docs -type f |  grep -Ev "\/\." | while read f; do
+find $DOCUMENTSDIR -type f |  grep -Ev "\/\." | while read f; do
     cur_log=$(launch "$f")
 
     # Mapping the data to array:
@@ -155,7 +157,7 @@ find docs -type f |  grep -Ev "\/\." | while read f; do
     done
 
     #Construct the csv file name
-    CSV_FN="$CSV_LOG_DIR"/"onload-${f#docs\/}".csv
+    CSV_FN="$CSV_LOG_DIR"/"onload-${f#$DOCUMENTSDIR\/}".csv
 
     echo -n "$TESTDATE"$'\t'"$LOVERSION" >> "$CSV_FN"
 
commit 1c49360b7e70f1af2ca6787e01cbad5b5c0b83f2
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Jan 16 13:56:02 2014 +0100

    loperf: Remove optional second parameter.
    
    It was used to specify additional parameters for valgrind, but we don't
    use it anymore.

diff --git a/loperf/loperf.sh b/loperf/loperf.sh
index 2942358..800e27e 100755
--- a/loperf/loperf.sh
+++ b/loperf/loperf.sh
@@ -42,7 +42,6 @@ fi
 # Post dependency check
 export OOO_DISABLE_RECOVERY=1
 OFFICEBIN="$1"
-VALGRIND_PARAMS="$2"
 
 TESTDATE=$(date --rfc-3339=second)
 
@@ -65,13 +64,13 @@ function launch {
 
     if test "$1" = ""; then
         export OOO_EXIT_POST_STARTUP=1
-        valgrind --tool=callgrind $VALGRIND_PARAMS --callgrind-out-file="$CG_LOG"-offload.log --simulate-cache=yes --dump-instr=yes --collect-bus=yes --branch-sim=yes "$OFFICEBIN" --splash-pipe=0 --headless > /dev/null 2>&1
+        valgrind --tool=callgrind --callgrind-out-file="$CG_LOG"-offload.log --simulate-cache=yes --dump-instr=yes --collect-bus=yes --branch-sim=yes "$OFFICEBIN" --splash-pipe=0 --headless > /dev/null 2>&1
         unset OOO_EXIT_POST_STARTUP
         echo -n "$CG_LOG"-offload.log
     else
         fn=${1#docs\/}
         ext=${fn##*.}
-        valgrind --tool=callgrind $VALGRIND_PARAMS --callgrind-out-file="$CG_LOG"-onload-"$fn".log --simulate-cache=yes --dump-instr=yes --collect-bus=yes --branch-sim=yes "$OFFICEBIN" --splash-pipe=0 --headless --convert-to "$ext" --outdir tmp "$1" > /dev/null 2>&1
+        valgrind --tool=callgrind --callgrind-out-file="$CG_LOG"-onload-"$fn".log --simulate-cache=yes --dump-instr=yes --collect-bus=yes --branch-sim=yes "$OFFICEBIN" --splash-pipe=0 --headless --convert-to "$ext" --outdir tmp "$1" > /dev/null 2>&1
         echo -n "$CG_LOG"-onload-"$fn".log
     fi
 }


More information about the Libreoffice-commits mailing list