aboutsummaryrefslogtreecommitdiff
path: root/stress
diff options
context:
space:
mode:
authorRenato Golin <rengolin@gmail.com>2016-04-26 11:02:23 +0100
committerRenato Golin <rengolin@gmail.com>2016-04-26 11:02:23 +0100
commit94cc104f044261f74fbff3ff587855df1a05f64d (patch)
tree7c6664fdf7e7fab54fea926b1fc6196a09b6540f /stress
downloadlinaro-scripts-94cc104f044261f74fbff3ff587855df1a05f64d.tar.gz
Initial Commit, moving from dev-private and removing private stuff
Diffstat (limited to 'stress')
-rw-r--r--stress/README.txt13
-rwxr-xr-xstress/build-llvm-forever.sh68
2 files changed, 81 insertions, 0 deletions
diff --git a/stress/README.txt b/stress/README.txt
new file mode 100644
index 0000000..40afeb2
--- /dev/null
+++ b/stress/README.txt
@@ -0,0 +1,13 @@
+Stress Tests for Board Stability
+================================
+
+This scripts are less helpful to develop LLVM, and more to make sure a
+particular platform is good enough to build LLVM on. When choosing machines
+to make buildbots or Jenkins slaves, it's important not just to get fast
+boxes, but stable and reliable.
+
+I've ran these scripts on a lot of different machines, local and remote and,
+providing you get all the necessary package requirements, they should be very
+independent of anything else. The kind of script you'd send to a hardware
+manufacturer so they can test their hardware before releasing (or at least
+before giving them to the toolchain team to use as builders).
diff --git a/stress/build-llvm-forever.sh b/stress/build-llvm-forever.sh
new file mode 100755
index 0000000..465a51f
--- /dev/null
+++ b/stress/build-llvm-forever.sh
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+
+# This script prepares and builds LLVM+Clang in a cycle
+# There are two purposes:
+# 1. Make sure the board can cope with sequential builds
+# for as long as you wish (at least 2 days non-stop)
+# 2. Make sure the builds take reasonably the same time
+#
+# That's why the script has the following features:
+#
+# * "set +e" to not fail even if the build fails, as a
+# subsequent commit can fix that, or even if the build
+# fails, we're still stressing the hardware, not the build
+# * `date` before each step, so that you can compare
+# multiple runs without having to find the `time` output
+# * Use -jCPUS, since we're not trying to get it faster, but
+# reliable, and that tells us more than -jCPUS+2, etc.
+# * Time builds and tests separately, since tests tend to be
+# more stable
+# * Don't use CCACHE, since that will defeat the purpose
+
+set +e
+
+ROOT=`pwd`
+CPUS=`grep -c proc /proc/cpuinfo`
+LINK_JOBS=
+NINJA=
+if ninja --version > /dev/null; then
+ LINK=`free -g | awk '/Mem/ {print $2}'`
+ LINK_JOBS="-DLLVM_PARALLEL_LINK_JOBS=$LINK"
+ NINJA="-G Ninja"
+fi
+
+mkdir -p build
+if [ ! -d src ]; then
+ git clone http://llvm.org/git/llvm.git src
+fi
+if [ ! -d src/tools/clang ]; then
+ cd src/tools
+ git clone http://llvm.org/git/clang.git
+fi
+cd $ROOT/build
+if [ ! -f Makefile ]; then
+ cmake ../src $NINJA \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_BUILD_TESTS=True \
+ -DLLVM_ENABLE_ASSERTIONS=True \
+ $LINK_JOBS
+fi
+
+while /bin/true; do
+ echo -n "Updating sources at "
+ date
+ cd $ROOT/src
+ git fetch origin; git pull
+ cd tools/clang
+ git fetch origin; git pull
+ cd $ROOT/build
+ echo -n "Cleaning at "
+ date
+ make -j$CPUS clean
+ echo -n "Building at "
+ date
+ make -j$CPUS
+ echo -n "Testing at "
+ date
+ make -j$CPUS check-all
+done