summaryrefslogtreecommitdiff
path: root/cortex-strings-bench.sh
blob: dfbb9e71ce39edb2c3ce073b06298b172f138c05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

function run {
  echo
  echo "+++ RUNNING: $@"
  bash -c "$@"
  if [ $? -ne 0 ]; then
    echo >&2
    echo "*** ABORTING" >&2
    echo "*** Failing command: $@" >&2
    rmmod modex 2>/dev/null #just in case
    exit
  fi
}

topdir=$(dirname `readlink -f $0`)
rm -f stdout stderr
cores=1
nproc
if [ $? -eq 0 ]; then
  cores=`nproc`
  echo "nproc says we have $cores cores"
else
  echo "Could not determine number of cores, assuming 1" >&2
fi
run "git clone -b bernie_benchmarking git://git.linaro.org/people/bernie.ogden/cbuild2"
run "git clone -b bench_all_variants git://git.linaro.org/people/bernie.ogden/cortex-strings.git"
run "git clone git://git.linaro.org/people/bernie.ogden/kernel_module"
run "cd kernel_module && make ARCH=arm EXTRA_CFLAGS=\"$3\" -C /usr/src/linux-headers-$(uname -r) SUBDIRS=\$PWD modules && insmod modex.ko"
run "mkdir cortex-strings-build"
run "cd cortex-strings-build && CFLAGS=\"$3\" ../cortex-strings/configure && make -j -l $cores"
run "${topdir}/controlled_run.sh \"date && cat /dev/modex && cd ${topdir}/cortex-strings-build && python ../cortex-strings/scripts/bench.py -f $1 -v $2 && cat /dev/modex && date\" 2>&1 | tee controlled_output"
run "rmmod modex"