diff options
-rw-r--r-- | README | 20 | ||||
-rw-r--r-- | cpu2000.cfg | 58 | ||||
-rw-r--r-- | cpu2006.cfg | 38 | ||||
-rw-r--r-- | cpu2xxx.cfg | 67 | ||||
-rw-r--r-- | linux-aarch64-122.tar.bz2 | bin | 0 -> 6589968 bytes | |||
-rw-r--r-- | linux-armv7l-gcc4-linaro.in | 230 | ||||
-rwxr-xr-x | spec2xxx-check | 4 | ||||
-rwxr-xr-x | spec2xxx-install | 20 | ||||
-rwxr-xr-x | spec2xxx-prepare | 70 | ||||
-rwxr-xr-x | spec2xxx-run | 52 |
10 files changed, 299 insertions, 260 deletions
@@ -27,9 +27,9 @@ $ export SPEC=/tmp/spec2000 $ export CONFIG=myconfig $ ./spec2xxx-install <path>/SPEC_CPU2000v1.3.1.tar.xz -$ ./spec2xxx-prepare ./linux-armv7l-gcc4-linaro.in arm-linux-gnueabihf- -$ ./spec2xxx-build -$ ./spec2xxx-run +$ ./spec2xxx-prepare arm-linux-gnueabihf- '-fsomething1 -fsomething2' +$ ./spec2xxx-build -e O2 +$ ./spec2xxx-run -e O2 $ ./spec2xxx-result ./result Here both mycomp and myboard should be able to ssh password-lessly to each @@ -40,9 +40,17 @@ Mycomp (aka host) then mounts myboard:/tmp/spec2000 at its /tmp/spec2000 to access SPEC files. Spec2xxx-prepare prepares SPEC for building/running myconfig configuration. -The first argument is required and specifies template config file (see -template *.in files included with these scripts). The second argument -specifies optional prefix to add to compiler names. +The scripts uses supplied *.cfg templates to generate SPEC config file +tweaked for $TARGET. The first argument specifies prefix to add +to compiler names, e.g., CROSS_COMPILE in linux-kernel world; this prefix can +be empty ''. Compiler is expected to run on $HOST and produce code for $TARGET. +The second argument specifies compiler optimization flags to use. Note that +included templates have -O2 and -O3 optimization profiles with -mcpu/-mfpu +settings guessed from the $TARGET. To use these profile specify "-e O2" or +"-e O3" when building and running SPEC. +The third argument specifies alternative location to read /proc/cpuinfo from; +it should be used only in exceptional circumstances, e.g., with pre-production +kernels. Spec2xxx-build builds SPEC. Any arguments are passed to runspec. Compilation is done on host by mounting myboard:/tmp/spec2000 at the same location on host diff --git a/cpu2000.cfg b/cpu2000.cfg new file mode 100644 index 0000000..0468a27 --- /dev/null +++ b/cpu2000.cfg @@ -0,0 +1,58 @@ +################################################################ +# Company name +################################################################ + +company_name = Linaro +tester_name = Linaro + +################################################################ +# Benchmark noise handling (via number of iterations) +################################################################ + +176.gcc=default=default=default: +iterations = @ITERATIONS_2@ + +300.twolf=default=default=default: +iterations = @ITERATIONS_4@ + +################################################################ +# Portability Flags +################################################################ + +default=default=default=default: +PORTABILITY = @DSPEC_CPU2000_LP64@ + +# vortex has an aliasing violation. See: +# http://gcc.gnu.org/ml/gcc/2005-09/msg00579.html +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23449 +255.vortex=default=default=default: +CPORTABILITY = -fno-strict-aliasing + +# LINUX_i386 is little endian and close enough to ARM +186.crafty=default=default=default: +CPORTABILITY = -DLINUX_i386 + +# G++ needs needs -fpermissive to accept the code +252.eon=default=default=default: +CXXPORTABILITY = -DHAS_ERRLIST -fpermissive + +# LINUX_I386 is little endian and close enough to ARM +253.perlbmk=default=default=default: +CPORTABILITY = -DSPEC_CPU2000_NEED_BOOL -DSPEC_CPU2000_LINUX_I386 + +254.gap=default=default=default: +CPORTABILITY = -DSYS_HAS_MALLOC_PROTO -DSYS_HAS_CALLOC_PROTO -DSYS_IS_USG -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -fno-strict-overflow + +# ARM defaults to unsigned char. This flag can be used for all hosts +# as it makes the char type more explicit +300.twolf=default=default=default: +CPORTABILITY = -DHAVE_SIGNED_CHAR + +# galgel won't build in parallel +178.galgel=default=default=default: +FPORTABILITY = -ffixed-form +makeflags = + +# facerec won't build in parallel +187.facerec=default=default=default: +makeflags = diff --git a/cpu2006.cfg b/cpu2006.cfg new file mode 100644 index 0000000..47cd9b1 --- /dev/null +++ b/cpu2006.cfg @@ -0,0 +1,38 @@ +################################################################ +# Company name +################################################################ + +test_sponsor = Linaro +tester = Linaro + +################################################################ +# Benchmark noise handling (via number of iterations) +################################################################ + +##################################################################### +# Portability Flags +##################################################################### + +default=default=default=default: +PORTABILITY = @DSPEC_CPU_LP64@ + +400.perlbench=default=default=default: +CPORTABILITY = -DSPEC_CPU_LINUX_X64 + +462.libquantum=default=default=default: +CPORTABILITY = -DSPEC_CPU_LINUX + +464.h264ref=default=default=default: +CPORTABILITY = -fsigned-char + +483.xalancbmk=default=default=default: +CXXPORTABILITY = -DSPEC_CPU_LINUX + +481.wrf=default=default=default: +CPORTABILITY = -DSPEC_CPU_CASE_FLAG -DSPEC_CPU_LINUX + +482.sphinx3=default=default=default: +CXXPORTABILITY = -fsigned-char + +447.dealII: +CXXPORTABILITY = -include cstddef -include cstring -include cstdlib diff --git a/cpu2xxx.cfg b/cpu2xxx.cfg new file mode 100644 index 0000000..94b7915 --- /dev/null +++ b/cpu2xxx.cfg @@ -0,0 +1,67 @@ +############################################################################### +# Configuration for benchmarking at Linaro +############################################################################### + +license_num = 4114 +hw_model = @HW_MODEL@ +hw_cpu = @HW_CPU@ +hw_fpu = @HW_FPU@ + +sw_os = @SW_OS@ +sw_compiler = @SW_COMPILER@ + +action = validate +tune = base +output_format = asc,config + +check_md5 = 1 +reportable = 1 +runlist = int fp +teeout = yes +teerunout = yes +makeflags = -j@PARALLELIZE@ +submit = @SUBMIT@ +use_submit_for_speed = 1 + +iterations = @ITERATIONS@ + +default=default=default=default: +CC = @CC@ +CXX = @CXX@ +FC = @FORTRAN@ +F77 = @FORTRAN@ + +##################################################################### +# Optimization +##################################################################### + +default=default=default=default: +COPTIMIZE = @OPTIMIZE@ +CXXOPTIMIZE = @OPTIMIZE@ +FOPTIMIZE = @OPTIMIZE@ +F77OPTIMIZE = @OPTIMIZE@ + +default=default=O2=default: +COPTIMIZE = -O2 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ +CXXOPTIMIZE = -O2 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ +FOPTIMIZE = -O2 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ +F77OPTIMIZE = -O2 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ + +default=default=O3=default: +COPTIMIZE = -O3 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ +CXXOPTIMIZE = -O3 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ +FOPTIMIZE = -O3 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ +F77OPTIMIZE = -O3 -fno-common @MCPU@ @MFPU@ @OPTIMIZE@ + +default=peak=default=default: +PASS1_CFLAGS = -fprofile-generate=@PROFILEDIR@/$(BENCHMARK) +PASS1_CXXFLAGS = -fprofile-generate=@PROFILEDIR@/$(BENCHMARK) +PASS1_FFLAGS = -fprofile-generate=@PROFILEDIR@/$(BENCHMARK) +PASS1_F77FLAGS = -fprofile-generate=@PROFILEDIR@/$(BENCHMARK) +PASS1_LDFLAGS = -fprofile-generate=@PROFILEDIR@/$(BENCHMARK) +PASS2_CFLAGS = -fprofile-use=@PROFILEDIR@/$(BENCHMARK) +PASS2_CXXFLAGS = -fprofile-use=@PROFILEDIR@/$(BENCHMARK) +PASS2_FFLAGS = -fprofile-use=@PROFILEDIR@/$(BENCHMARK) +PASS2_F77FLAGS = -fprofile-use=@PROFILEDIR@/$(BENCHMARK) +PASS2_LDFLAGS = -fprofile-use=@PROFILEDIR@/$(BENCHMARK) +fdo_pre0 = rm -rf @PROFILEDIR@; mkdir -p @PROFILEDIR@ diff --git a/linux-aarch64-122.tar.bz2 b/linux-aarch64-122.tar.bz2 Binary files differnew file mode 100644 index 0000000..b2b9ab5 --- /dev/null +++ b/linux-aarch64-122.tar.bz2 diff --git a/linux-armv7l-gcc4-linaro.in b/linux-armv7l-gcc4-linaro.in deleted file mode 100644 index 1fb8c09..0000000 --- a/linux-armv7l-gcc4-linaro.in +++ /dev/null @@ -1,230 +0,0 @@ -############################################################################### -# Configuration for a generic Cortex-A15 -# -# Copyright (c) 2010,2011 Linaro -# Contributors: -# Michael Hope - initial implementation. Based on the SPEC examples. -# -############################################################################### -# -# To run: -# runspec --config linux-armv7l-gcc4-linaro -# -# The extension 'gcc4-high-opt' uses high optimization and is enabled by -# default. -# -# See below for other configurations. The Linaro ARM standard -# configuration tunes for the A15 and enables NEON. Try: -# runspec --config linux-armv7l-gcc4-linaro -e gcc4-o3-neon-opt -# -# and see gcc4-o3-noen-opt below for details. -# -############################################################################### - -# These variables below are defaults and should be modified according to the -# system under test. -company_name = Linaro -hw_model = Toolchain Reference Board -hw_cpu = Cortex-A15 -hw_cpu_mhz = 1000 -hw_disk = Flash Drive, 8 GB -hw_fpu = Integrated -hw_memory = 1 GB -hw_avail = 2010 -test_date = -sw_file = Linux/ext4 -sw_os = Linaro 11.05 -hw_vendor = -tester_name = Linaro -license_num = 4114 - -hw_ncpu = 2 -hw_ncpuorder = 2 -hw_ocache = N/T -hw_other = None -hw_parallel = No -hw_pcache = N/T -hw_scache = N/T -hw_tcache = N/A -sw_state = Multi-user - -VENDOR = -action = validate -tune = base -# The train workload is fine on a A15 for day to day tests -#size = train -# The Linaro standard is five iterations -#iterations = 5 -output_format = asc,config -ext = gcc4-high-opt - -check_md5 = 1 -# Don't do reportable runs unless commanded -#reportable = 1 -# Run everything -runlist = int fp -teeout = yes -teerunout = yes -# Build in parallel by default -makeflags = -j@PARALLELIZE@ -submit=@SUBMIT@ -command_add_redirect=1 -use_submit_for_speed = 1 - - -# Defaults -default=default=default=default: -CC = @CC@ -CXX = @CXX@ -FC = @FORTRAN@ -F77 = @FORTRAN@ -sw_avail= Jan-2011 -sw_compiler0000 = Linaro GCC 4.6-2011.06-0 compiler for ARM - -################################################################ -# Portability Flags -################################################################ - -176.gcc=default=default=default: -# gcc has high variance. Run more iterations. -iterations = 5 - -# vortex has an aliasing violation. See: -# http://gcc.gnu.org/ml/gcc/2005-09/msg00579.html -# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23449 -255.vortex=default=default=default: -notes0045= 255.vortex= CPORTABILITY=-fno-strict-aliasing -CPORTABILITY = -fno-strict-aliasing - -# LINUX_i386 is little endian and close enough to ARM -186.crafty=default=default=default: -notes0050= 186.crafty: CPORTABILITY=-DLINUX_i386 -CPORTABILITY = -DLINUX_i386 - -# G++ needs needs -fpermissive to accept the code -252.eon=default=default=default: -notes0051= 252.eon: CXXPORTABILITY=-DHAS_ERRLIST -fpermissive -CXXPORTABILITY = -DHAS_ERRLIST -fpermissive - -# LINUX_I386 is little endian and close enough to ARM -253.perlbmk=default=default=default: -notes0052= 253.perlbmk: CPORTABILITY=-DSPEC_CPU2000_LINUX_I386 -DSPEC_CPU2000_NEED_BOOL -CPORTABILITY = -DSPEC_CPU2000_NEED_BOOL -DSPEC_CPU2000_LINUX_I386 - -254.gap=default=default=default: -notes0055= 254.gap: CPORTABILITY=-DSYS_IS_USG -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -wnotes0056= -DSYS_HAS_CALLOC_PROTO -DSYS_HAS_MALLOC_PROTO -CPORTABILITY = -DSYS_HAS_MALLOC_PROTO -DSYS_HAS_CALLOC_PROTO -DSYS_IS_USG -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -fno-strict-overflow - -# ARM defaults to unsigned char. This flag can be used for all hosts -# as it makes the char type more explicit -300.twolf=default=default=default: -CPORTABILITY = -DHAVE_SIGNED_CHAR -# twolf has high variance. Run more iterations. -iterations = 7 - -# galgel won't build in parallel -178.galgel=default=default=default: -notes0050= 178.galgel: -ffixed-form -FPORTABILITY= -ffixed-form -makeflags = - -# facerec won't build in parallel -187.facerec=default=default=default: -makeflags = - -# For a 64 bit host: -# notes0045= 255.vortex= CPORTABILITY=-DSPEC_CPU2000_LP64 -fno-strict-aliasing -# CPORTABILITY = -DSPEC_CPU2000_LP64 -fno-strict-aliasing -# -# 252.eon=default=default=default: -# notes0051= 252.eon: CXXPORTABILITY=-DHAS_ERRLIST -DSPEC_CPU2000_LP64 -fpermissive -# CXXPORTABILITY = -DHAS_ERRLIST -DSPEC_CPU2000_LP64 -fpermissive -# -# 253.perlbmk=default=default=default: -# notes0052= 253.perlbmk: CPORTABILITY=-DSPEC_CPU2000_LINUX_I386 -DSPEC_CPU2000_NEED_BOOL -# notes0053= -DSPEC_CPU2000_LP64 -# CPORTABILITY = -DSPEC_CPU2000_NEED_BOOL -DSPEC_CPU2000_LINUX_I386 -DSPEC_CPU2000_LP64 -# -# 254.gap=default=default=default: -# notes0055= 254.gap: CPORTABILITY=-DSYS_IS_USG -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -# notes0056= -DSYS_HAS_CALLOC_PROTO -DSYS_HAS_MALLOC_PROTO -# notes0057= -DSPEC_CPU2000_LP64 -# CPORTABILITY = -DSYS_HAS_MALLOC_PROTO -DSYS_HAS_CALLOC_PROTO -DSYS_IS_USG -DSYS_HAS_IOCTL_PROTO -DSYS_HAS_TIME_PROTO -DSPEC_CPU2000_LP64 - -################################################################ -# Baseline Tuning Flags -################################################################ - -default=base=gcc4-o2=default: -notes0080= Baseline C: gcc -O2 -fno-common -notes0085= Baseline C++: g++ -O2 -fno-common -COPTIMIZE = -O2 -fno-common -CXXOPTIMIZE = -O2 -fno-common -FOPTIMIZE = -O2 -fno-common -F77OPTIMIZE = -O2 -fno-common - -default=base=gcc4-o3=default: -notes0080= Baseline C: gcc -O3 -fno-common -notes0085= Baseline C++: g++ -O3 -fno-common -COPTIMIZE = -O3 -fno-common -CXXOPTIMIZE = -O3 -fno-common -FOPTIMIZE = -O3 -fno-common -F77OPTIMIZE = -O3 -fno-common - -default=base=gcc4-o2-a15=default: -notes0080= Baseline C: gcc -O2 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -notes0085= Baseline C++: g++ -O2 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -COPTIMIZE = -O2 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -CXXOPTIMIZE = -O2 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -FOPTIMIZE = -O2 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -F77OPTIMIZE = -O2 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 - -default=base=gcc4-o3-a15=default: -notes0080= Baseline C: gcc -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -notes0085= Baseline C++: g++ -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -COPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -CXXOPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -FOPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -F77OPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 - -# Highest Optimization. ARM specific. Some tests may fail at the moment. -default=base=gcc4-unsafe-a15=default: -notes0080= Baseline C: gcc -O3 -fno-common -notes0085= Baseline C++: g++ -O3 -fno-common -COPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -ffast-math -funsafe-loop-optimizations -CXXOPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -ffast-math -funsafe-loop-optimizations -FOPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -ffast-math -funsafe-loop-optimizations -F77OPTIMIZE = -O3 -fno-common -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad -ffast-math -funsafe-loop-optimizations - -# The special target 'cbuild' is used for the automated build. Values -# are replaced by the script. -default=base=cbuild-extension=default: -notes0080= cbuild-notes0080 -notes0085= cbuild-notes0085 -COPTIMIZE = cbuild-COPTIMIZE -CXXOPTIMIZE = cbuild-CXXOPTIMIZE -FOPTIMIZE = cbuild-FOPTIMIZE -F77OPTIMIZE = cbuild-F77OPTIMIZE - -# The special target 'cbuild' is used for the automated build. Values -# are replaced by the script. -default=base=cbuild-extension-pgo=default: -notes0080= cbuild-notes0080 -notes0085= cbuild-notes0085 -profiledir = cbuild-TOPDIR/out/profile -COPTIMIZE = cbuild-COPTIMIZE -CXXOPTIMIZE = cbuild-CXXOPTIMIZE -FOPTIMIZE = cbuild-FOPTIMIZE -F77OPTIMIZE = cbuild-F77OPTIMIZE -PASS1_CFLAGS = -fprofile-generate=$(profiledir)/$(BENCHMARK) -PASS1_CXXFLAGS = -fprofile-generate=$(profiledir)/$(BENCHMARK) -PASS1_FFLAGS = -fprofile-generate=$(profiledir)/$(BENCHMARK) -PASS1_F77FLAGS = -fprofile-generate=$(profiledir)/$(BENCHMARK) -PASS1_LDFLAGS = -fprofile-generate=$(profiledir)/$(BENCHMARK) -PASS2_CFLAGS = -fprofile-use=$(profiledir)/$(BENCHMARK) -PASS2_CXXFLAGS = -fprofile-use=$(profiledir)/$(BENCHMARK) -PASS2_FFLAGS = -fprofile-use=$(profiledir)/$(BENCHMARK) -PASS2_F77FLAGS = -fprofile-use=$(profiledir)/$(BENCHMARK) -PASS2_LDFLAGS = -fprofile-use=$(profiledir)/$(BENCHMARK) -fdo_pre0 = rm -rf ${profiledir}; mkdir -p ${profiledir} diff --git a/spec2xxx-check b/spec2xxx-check index e554cdb..24c5f9d 100755 --- a/spec2xxx-check +++ b/spec2xxx-check @@ -41,6 +41,10 @@ else fi ssh $target true +if [ "$(ssh $target echo \$SHELL)" != "/bin/bash" ]; then + echo "$target is using non-bash shell" + exit 1 +fi mkdir -p $spec spec=$(cd $spec; pwd) diff --git a/spec2xxx-install b/spec2xxx-install index 2026e6e..c5819ab 100755 --- a/spec2xxx-install +++ b/spec2xxx-install @@ -60,9 +60,13 @@ case "$specver" in arch=linux-armv7l toolstar=linux-armv7l-122.tar.bz2 ;; + "aarch64") + arch=linux-aarch64 + toolstar=linux-aarch64-122.tar.bz2 + ;; *) - arch="linux-$cpu" toolstar="build" + ;; esac ;; "cpu2006v1.2") @@ -78,8 +82,8 @@ case "$specver" in toolstar=linux-apm-arm64-118.tar ;; *) - arch="linux-$cpu" toolstar="build" + ;; esac ;; esac @@ -87,13 +91,19 @@ esac case "$toolstar" in "") ;; "build") + arch="linux-$cpu" + # Make sure bash is used for building perl echo "/bin/bash \$@" > $spec/bin/sh chmod +x $spec/bin/sh - # Patch up perl sources case "$specver" in "cpu2000v1.3") + # Patch up specmd5sum + sed -i -e "/^int/d" -e "/^getline/d" -e "/^getdelim/d" \ + $spec/tools/src/specmd5sum/lib/getline.h + + # Patch up perl sources sed -i -e "s#command line#command\.line#" \ $spec/tools/src/perl-5.8.7/makedepend.SH sed -i -e "/asm\/page.h/d" \ @@ -103,8 +113,10 @@ case "$toolstar" in # Find where libm.so and libdl.so are libpth=$(ssh $target find /usr -name libm.so | sed -e "s#/libm.so##") + # config.guess can be too old to know about new architecture. + configflags="--build=$cpu-unknown-linux-gnu" - ssh $target "cd $spec && PATH=$spec/bin:\$PATH PERLFLAGS='-A libs=-lm -A libs=-ldl -A libs=-lcrypt -Dlibpth=$libpth' $spec/tools/src/buildtools && . shrc && packagetools $arch" + ssh $target "cd $spec && PATH=$spec/bin:\$PATH PERLFLAGS='-A libs=-lm -A libs=-ldl -A libs=-lcrypt -Dlibpth=$libpth' CONFIGFLAGS=\"$configflags\" $spec/tools/src/buildtools && . shrc && packagetools $arch" # Clean up rm $spec/bin/sh diff --git a/spec2xxx-prepare b/spec2xxx-prepare index 1204682..8b274b3 100755 --- a/spec2xxx-prepare +++ b/spec2xxx-prepare @@ -9,8 +9,9 @@ host=$HOST target=$TARGET spec=$SPEC config=$CONFIG -config_tmpl=$1 -cc_prefix=$2 +cc_prefix=$1 +optimize="$2" +cpuinfo=$3 if [ "$host" != "$target" ]; then local=false @@ -32,12 +33,71 @@ EOF chmod +x $spec/bin/ssh-$config-$cc done -cat $config_tmpl | sed \ +if [ "$cpuinfo" = "" ]; then + cpuinfo=$spec/cpuinfo + ssh $target cat /proc/cpuinfo > $cpuinfo +fi + +hw_model="$(cat $cpuinfo | grep Hardware | head -n 1 | sed -e 's/.*: //')" +hw_cpu="$(cat $cpuinfo | grep "model name\|Processor" | head -n 1 | sed -e 's/.*: //')" +hw_fpu="$(cat $cpuinfo | grep Features | head -n 1 | sed -e 's/.*: //')" + +sw_os="$(ssh $target uname -r | head -n 1)" + +sw_compiler="$(${cc_prefix}gcc -v 2>&1 | tail -n 1)" +sw_compiler="$sw_compiler $(${cc_prefix}gcc -v 2>&1 | grep 'Configured with' | head -n 1)" + +case "$hw_cpu" in + *"v7l"*) mcpu="-mcpu=cortex-a15" ;; + *"aarch64"*) mcpu="-mcpu=cortex-a57" ;; + *) mcpu="" ;; +esac + +case "$hw_fpu" in + *"neon"*"vfpv4"*) mfpu="-mfpu=neon-vfpv4" ;; + *) mfpu="" ;; +esac + +arch="$(ssh $target uname -p)" +case "$arch" in + "aarch64"|"x86_64") + spec_cpu2000_lp64="-DSPEC_CPU2000_LP64" + spec_cpu_lp64="-DSPEC_CPU_LP64" + ;; + "armv7l"|"ia32"|*) + spec_cpu2000_lp64="" + spec_cpu_lp64="" + ;; +esac + +cfg_tmpl="$(dirname $0)/cpu2xxx.cfg" +if grep CPU2000 $spec/shrc; then + cfg_tmpl="$cfg_tmpl $(dirname $0)/cpu2000.cfg" +fi +if grep CPU2006 $spec/shrc; then + cfg_tmpl="$cfg_tmpl $(dirname $0)/cpu2006.cfg" +fi + +cat $cfg_tmpl | sed \ + -e "s#@HW_MODEL@#$hw_model#" \ + -e "s#@HW_CPU@#$hw_cpu#" \ + -e "s#@HW_FPU@#$hw_fpu#" \ + -e "s#@SW_OS@#$sw_os#" \ + -e "s#@SW_COMPILER@#$sw_compiler#" \ + -e "s#@PARALLELIZE@#$(getconf _NPROCESSORS_ONLN)#" \ + -e "s#@SUBMIT@#taskset 0x2 \$command#" \ + -e "s#@ITERATIONS@#5#" \ + -e "s#@ITERATIONS_2@#7#" \ + -e "s#@ITERATIONS_4@#9#" \ -e "s#@CC@#ssh-$config-gcc#" \ -e "s#@CXX@#ssh-$config-g++#" \ -e "s#@FORTRAN@#ssh-$config-gfortran#" \ - -e "s#@SUBMIT@#taskset 0x2 \$command#" \ - -e "s#@PARALLELIZE@#$(getconf _NPROCESSORS_ONLN)#" \ + -e "s#@OPTIMIZE@#$optimize#" \ + -e "s#@MCPU@#$mcpu#" \ + -e "s#@MFPU@#$mfpu#" \ + -e "s#@PROFILEDIR@#$spec#" \ + -e "s#@DSPEC_CPU2000_LP64@#$spec_cpu2000_lp64#" \ + -e "s#@DSPEC_CPU_LP64@#$spec_cpu_lp64#" \ > $spec/config/$config.tmp if ! diff -u $spec/config/$config.tmp $spec/config/$config.cfg | head -n 8 | grep __MD5__; then diff --git a/spec2xxx-run b/spec2xxx-run index 89ada3a..bd4150f 100755 --- a/spec2xxx-run +++ b/spec2xxx-run @@ -10,6 +10,11 @@ spec=$SPEC config=$CONFIG opts="$@" +doservices=false +dofreqscaling=false +dotaskbind=true +donetwork=false + spec=$(cd $spec; pwd) if ssh $target echo \$USER | grep root; then @@ -18,8 +23,8 @@ else sudo=sudo fi -if ssh $target $sudo initctl list >/dev/null \ - || ssh $target croutonversion >/dev/null 2>&1; then +if $doservices && \ + (ssh $target $sudo initctl list >/dev/null || ssh $target croutonversion >/dev/null 2>&1); then # Stop all but few services. Note all stopped services in stopped-services # file to restart them after benchmarks. Network and SSH server are # handled separately. @@ -47,28 +52,34 @@ if ssh $target $sudo initctl list >/dev/null \ fi # Disable frequency scaling -old_governor=$(ssh $target cpufreq-info -p | cut -f 3 -d " ") -if [ "x$old_governor" = "x" ] \ - || ! ssh $target $sudo cpufreq-set -g performance; then - old_governor="" - echo FREQUENCY SCALING NOT SUPPORTED +old_governor="" +if $dofreqscaling; then + old_governor=$(ssh $target cpufreq-info -p | cut -f 3 -d " ") + if [ "x$old_governor" = "x" ] || ! ssh $target $sudo cpufreq-set -g performance; then + old_governor="" + echo FREQUENCY SCALING NOT SUPPORTED + fi fi # Bind all existing processes to CPU #0. We then run benchmarks on CPU #1. -if ssh $target $sudo taskset -a -p 0x1 1; then +if $dotaskbind && \ + (ssh $target $sudo taskset -a -p 0x1 1); then ssh $target "for p in \$(ps ax --format='%p' | tail -n +2); do $sudo taskset -a -p 0x1 \$p 2>&1; done | wc" else echo CPU BIND NOT SUPPORTED fi # Figure out how to stop/start network. -if ssh $target croutonversion >/dev/null 2>&1; then +if $donetwork && \ + (ssh $target croutonversion >/dev/null 2>&1); then network_before="$sudo chroot /proc/1/root /bin/bash -c 'stop shill && stop wpasupplicant' && sleep 2" network_after="$sudo chroot /proc/1/root /bin/bash -c 'start wpasupplicant && start shill' && $sudo /sbin/iptables -P INPUT ACCEPT" -elif ssh $target "$sudo stop network-interface INTERFACE=lo && $sudo start network-interface INTERFACE=lo"; then +elif $donetwork && \ + (ssh $target "$sudo stop network-interface INTERFACE=lo && $sudo start network-interface INTERFACE=lo"); then network_before="$sudo stop network-interface INTERFACE=eth0 && sleep 2" network_after="$sudo start network-interface INTERFACE=eth0" -elif ssh $target "$sudo ifdown lo && $sudo ifup lo"; then +elif $donetwork && \ + (ssh $target "$sudo ifdown lo && $sudo ifup lo"); then network_before="$sudo ifdown eth0 && sleep 2" network_after="$sudo ifup eth0" else @@ -76,13 +87,22 @@ else network_after="echo NETWORK CONTROL NOT SUPPORTED" fi +if ssh $target croutonversion >/dev/null 2>&1 \ + || ssh $target "$sudo initctl status ssh" | grep process; then + ssh_before="$sudo stop ssh" + ssh_after="$sudo start ssh" +else + ssh_before="$sudo /etc/init.d/ssh stop" + ssh_after="$sudo /etc/init.d/ssh start" +fi + cmd="true" -cmd="$cmd && $sudo stop ssh" +cmd="$cmd && $ssh_before" cmd="$cmd && $network_before" cmd="$cmd && ps auxf" cmd="$cmd && (cd $spec && . shrc && runspec -c $config $opts) || true" cmd="$cmd && $network_after" -cmd="$cmd && $sudo start ssh" +cmd="$cmd && $ssh_after" # Send /the/ command. ssh -fn $target "nohup /bin/bash -c \"$cmd\" >$spec/runspec.$(date +%Y%m%dT%H%M%S) 2>&1 &" @@ -96,7 +116,8 @@ set -x # Undo benchmark environment preparations. -if ssh $target $sudo taskset -a -p 0xFFFFFFFF 1; then +if $dotaskset && \ + (ssh $target $sudo taskset -a -p 0xFFFFFFFF 1); then ssh $target "for p in \$(ps ax --format='%p' | tail -n +2); do $sudo taskset -a -p 0xFFFFFFFF \$p 2>&1; done | wc" else echo CPU BIND NOT SUPPORTED @@ -106,7 +127,8 @@ if [ "x$old_governor" != "x" ]; then ssh $target $sudo cpufreq-set -g $old_governor fi -if ssh $target $sudo initctl list >/dev/null || ssh $target croutonversion >/dev/null 2>&1; then +if $doservices && \ + (ssh $target $sudo initctl list >/dev/null || ssh $target croutonversion >/dev/null 2>&1); then sudo_old=$sudo if ssh $target croutonversion >/dev/null 2>&1; then sudo="$sudo chroot /proc/1/root sudo" |