speedtest_osbuild.sh 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. #!/bin/sh
  2. # Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
  3. # All rights reserved.
  4. # This component and the accompanying materials are made available
  5. # under the terms of the License "Eclipse Public License v1.0"
  6. # which accompanies this distribution, and is available
  7. # at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8. #
  9. # Initial Contributors:
  10. # Nokia Corporation - initial contribution.
  11. #
  12. # Contributors:
  13. #
  14. # Description:
  15. # Build automation for Symbian OS with Raptor
  16. # Author: Timothy N Murphy
  17. #
  18. #
  19. # You can edit these:
  20. H=/home/tmurphy
  21. export H
  22. export EPOCROOT="$H/baselineos"
  23. export LOGBASEDIR=~/public_html/buildlogs
  24. export BUILDROOT="$H/baselineos"
  25. export SOURCEROOT="$H/baselineos/fsupdate"
  26. export SYSDEF="$H/baselineos/system_definition_fsupdate.xml"
  27. export PREEXPORTSYSDEF="$SBS_HOME/test/envelope/preexport.xml"
  28. #export PARALLEL=0
  29. genstats() {
  30. if [ "$1.stats" -ot "$1.log" ]; then
  31. python "$SBS_HOME/bin/buildstats.py" "$1.log" > "$1.stats" &&
  32. #python "$SBS_HOME/bin/failedstats.py" -m "$1.log" > "$1.failed";
  33. (
  34. cd $EPOCROOT/epoc32 && find "release" > "$1.release_files" && find "build" > "$1.build_files" && find include > "$1.include_files"
  35. )
  36. fi;
  37. }
  38. cd $BUILDROOT
  39. # Don't edit the rest:
  40. ###################################################
  41. export KEY=`date +%d_%m_%y`
  42. export DAILYDIR="$LOGBASEDIR/$KEY"
  43. export BUILDNAME="`basename \"$SYSDEF\" | sed 's#\.[^.][^.]*$##'`"
  44. export LOGNAME="${BUILDNAME}_${KEY}"
  45. export PLATFORM=armv5
  46. export TESTLOG="$DAILYDIR/parallel_speedtest.log"
  47. for BUILDNUM in {1..50}; do
  48. if [ ! -d "$DAILYDIR/$BUILDNUM" ]; then
  49. break
  50. fi
  51. if [ ! -f "$DAILYDIR/$BUILDNUM/${LOGNAME}_$BUILDNUM.log" ]; then
  52. break
  53. fi
  54. done
  55. # make the day's directory
  56. mkdir -p "$DAILYDIR"
  57. echo "testrun: $TESTLOG, build $BUILDNUM of the day:"
  58. echo '<testrun>' > "$TESTLOG"
  59. # Loop through different cluster loads
  60. #for PARALLEL in 52 48 44 40 36 32 28 24 20 16 8 4; do
  61. for PARALLEL in 44 40 36 32 28 24 20 16 8 4; do
  62. export PARALLEL i
  63. echo "Parallel: $PARALLEL"
  64. (
  65. echo "<test type='performance' name='speedtest' >"
  66. echo " <parameters parallel='$PARALLEL' start='`date`' />"
  67. echo " <logfile>$DAILYDIR/$BUILDNUM/${LOGNAME}_$BUILDNUM.log</logfile>"
  68. MAKEFILE=$TESTBASE/test$CODEFACTOR.mk
  69. echo ""
  70. OUTDIR="$DAILYDIR/$BUILDNUM"
  71. TIMELOG="$OUTDIR/${LOGNAME}_$BUILDNUM.time"
  72. echo " <build number='$BUILDNUM' of='$KEY' output='$OUTDIR'><![CDATA["
  73. if [ ! -d "$OUTDIR" ]; then
  74. mkdir -p "$OUTDIR" || exit 1
  75. fi
  76. set -x
  77. # Make sure that our "stop signal" is clear
  78. SIGNALTOSTOPFILE="$OUTDIR/${LOGNAME}_$BUILDNUM.stop"
  79. rm -f "$SIGNALTOSTOPFILE"
  80. echo "EPOCROOT is $EPOCROOT"
  81. export PATH=$EPOCROOT/epoc32/tools:$PATH
  82. (
  83. echo "Annihilating epoc32 tree(s)"
  84. # wipe the epoc32 directory first
  85. chmod -R u+rw "$EPOCROOT/epoc32" &&
  86. rm -rf "$EPOCROOT/epoc32" &&
  87. echo "epoc32 tree withered"
  88. )
  89. (
  90. # unzip the pre-prepared epoc32 trees
  91. cd $EPOCROOT &&
  92. (
  93. unzip -o $BUILDROOT/epoc32.zip | grep "epoc32/" | sed 's#.* \(epoc32/.*\)#\1#' | xargs touch &&
  94. unzip -o $BUILDROOT/variant.zip | grep "epoc32/" | sed 's#.* \(epoc32/.*\)#\1#' | xargs touch
  95. ) > "$OUTDIR/unzip" &&
  96. chmod -R u+rw "$EPOCROOT/epoc32" &&
  97. echo "unzipped skeleton epoc32 tree"
  98. ) && (
  99. echo "Pre-export"
  100. $SBS_HOME/bin/sbs -d -k -s "$PREEXPORTSYSDEF" -a "$SOURCEROOT" -c $PLATFORM EXPORT > $OUTDIR/${LOGNAME}_$BUILDNUM.preexport 2>&1 || {
  101. echo "Pre-export failed";
  102. exit 1
  103. }
  104. )
  105. echo "Prepping makefiles"
  106. (
  107. echo "<times>\n"
  108. export TIMEFORMAT=$'<time stage='prepmake'>%3R</time>\n'
  109. time cp performance_Makefile $EPOCROOT/epoc32/build/Makefile
  110. ) > "$TIMELOG" 2>&1
  111. echo "Running Make"
  112. (
  113. # The build process
  114. export TIMEFORMAT=$'<time stage='make' parallel='$PARALLEL'>%3R</time>\n'
  115. time /usr/local/raptor/make-pvm-381/pvmgmake -j$PARALLEL --debug=j -k -f $MAKEFILE > "$OUTDIR/${LOGNAME}_$BUILDNUM.log" 2>&1
  116. touch "$SIGNALTOSTOPFILE"
  117. echo "</times>\n"
  118. ) >> "$TIMELOG" 2>&1 &
  119. (
  120. set +x
  121. # Concurrent process to continuously update statistics
  122. echo ""
  123. while [ 1 -eq 1 ]; do
  124. sleep 20
  125. echo -n "."
  126. if [ -e "$SIGNALTOSTOPFILE" ]; then
  127. rm -f "$SIGNALTOSTOPFILE"
  128. break
  129. fi
  130. done
  131. echo ""
  132. )
  133. set +x
  134. genstats "$OUTDIR/${LOGNAME}_$BUILDNUM"
  135. echo " ]]></build>"
  136. echo "</test>"
  137. ) >> "$TESTLOG" 2>&1
  138. BUILDNUM=$[ $BUILDNUM + 1 ]
  139. # use a new output directory
  140. done # PARALLEL
  141. echo -e "<testrun_stat endtime='`date`'\n />" >> "$TESTLOG"
  142. echo "</testrun>" >> "$TESTLOG"