diff --git a/.gitignore b/.gitignore index 8000dd9..12cc177 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ .vagrant +Vagrantfile +*.json +opack_installer_latest +results +ssh-config diff --git a/Makefile b/Makefile index 13e08fd..27ea5a9 100644 --- a/Makefile +++ b/Makefile @@ -5,22 +5,38 @@ RELEASE_DIR= ../skzbsd-build/release INSTALL_ISO= $(RELEASE_DIR)/install$(CUSTOM_VERS).iso OPACK_TARGET= skzbsd-run OPACK_SYS_VERSION= snapshots -OPACK_SYS_CPU= 2 -OPACK_SYS_MEMORY= 1024 +OPACK_SYS_CPU= 8 +OPACK_SYS_MEMORY= 16384 +OPACK_SYS_DISK_SIZE= 10240 OPACK_SYS_ISO_SHA256SUM= $(shell grep install$(CUSTOM_VERS).iso $(RELEASE_DIR)/SHA256 | awk '{print $$NF}') OPACK_SYS_ISO_URL= ../$(INSTALL_ISO) OPACK_SYS_SETS_LOCATION= cd0 -OPACK_SYS_SETS= +* -x* -game* -man* -comp* -bsd.rd -OPACK_SYS_HEADLESS= false OPACK_NO_SIGCHK= yes +#OPACK_SYS_SETS= +* -x* -game* -man* -comp* -bsd.rd +OPACK_SYS_SETS= +* +OPACK_SYS_USER= root +OPACK_SYS_HEADLESS= true include ../skz-opack/src/opack.mk +SPEC2006_SRC= ../spec2006-openbsd + + $(INSTALL_ISO): - make -C ../skzbsd-build/ release + make -C ../skzbsd-build/ all -all: $(INSTALL_ISO) opack - vagrant ssh -c "uname -a; sysctl kern.version; ls -lh /bsd.booted" - vagrant ssh -c "doas ksh -c 'echo sysctl kern.securelevel=-1 > /etc/rc.securelevel; echo kern.allowdt=1 >> /etc/sysctl.conf; echo kern.allowkmem=1 >> /etc/sysctl.conf; reboot'" - echo "run 'btrace /usr/share/btrace/kprofile.bt'" +ssh-config: opack + (echo Host $(OPACK_TARGET) && (vagrant ssh-config | sed '1d')) > $@ +all: $(INSTALL_ISO) ssh-config + scp -F ssh-config -q -r src root@$(OPACK_TARGET):/root/run + scp -F ssh-config -q -r $(SPEC2006_SRC) root@$(OPACK_TARGET):/var/spec2006 + vagrant ssh -c "make -C run bootstrap" + vagrant reload > /dev/null + vagrant ssh -c "make -C run all" + mkdir -p results + scp -F ssh-config -q -r $(OPACK_TARGET):/var/spec2006/result/* results + +clean: + rm -rf results ssh-config + $(MAKE) opack-clean diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..af2c19d --- /dev/null +++ b/src/Makefile @@ -0,0 +1,64 @@ +# SPEC2006 options +SIZE?="ref" +ITERATIONS?="1" + +OCTOPUS_URL=https://git.sk4.nz/sk4nz/octopus.git +SPEC2006_URL=https://git.sk4.nz/sk4nz/spec2006-openbsd.git + +RUNOPTS=-I --noreportable --verbose 5\ +-F /var/spec2006/config/openbsd.xml \ +-S hw_cpu_name="$$(sysctl -n hw.model)" \ +-S hw_cpu_char="$$(dmesg | grep cpu | grep cache | cut -d':' -f2 | sort | uniq | cut -c 2-)" \ +-S hw_cpu_mhz="$$(sysctl -n hw.cpuspeed)" \ +-S hw_memory="$$(sysctl -n hw.physmem)" \ +-S test_date="$$(date "+%d-%m-%Y")" \ +-S sw_os="$$((uname -a; sysctl -n kern.version) | tr '\n' ' ')" \ +-S hw_nchips="$$(lscpu | grep Socket | awk "{print \$$NF}")" \ +-S hw_ncoresperchip="$$(lscpu | grep "per socket" | awk "{print \$$NF}")" \ +-S hw_nthreadspercore="$$(lscpu | (grep "per core" | awk "{print \$$NF}") || echo 1)" \ +-S hw_ncores="$$(sysctl -n hw.ncpufound)" \ +-S hw_ncpuorder="$$(lscpu | grep Order | awk "{ print \$$(NF-1), \$$NF }")" \ +-S hw_pcache="$$(lscpu | grep L1 | awk "{ print \$$NF}" | uniq)" \ +-S hw_scache="$$(lscpu | grep L2 | awk "{ print \$$NF}")" \ +-S hw_tcache="$$(lscpu | grep L3 | awk "{ print \$$NF}")" \ +-S hw_disk="$$(disklabel -h sd0 | grep "total bytes" | cut -d':' -f3 | tr -d ' ')" \ +-S hw_other="$$(sysctl -n hw.vendor hw.product | tr '\n' ' ')$$(dmesg | grep bios | grep version | cut -d':' -f2 | sort | uniq)" \ +-S sw_compiler="$$(clang -v 2>&1 | head -n 1)" \ +-S sw_compiler2="$$(sysctl hw.smt)" + +.PHONY: bootstrap + +bootstrap: + @echo $$(date) - Bootstrapping SPEC + @mkdir -p /spec + @ln -s /var/spec2006 /spec/cpu2006 + @cd /var/spec2006/tools/src && CFLAGS='-fPIC' CONFIGFLAGS='--build=x86_64-unknown-openbsd' sh ./buildtools > build.log 2>&1 + @cd /var/spec2006 && . ./shrc && ./bin/scripts.misc/genmanifest.sh > manifest.out.log 2>&1 && ./bin/packagetools OpenBSD > package.OpenBSD.out 2>&1 + @echo 'cd /var/spec2006 && . ./shrc && cd /root' >> /root/.profile + @-pkg_add -I lscpu > /dev/null 2>&1 || pkg_add -I -D snap lscpu > /dev/null 2>&1 + @echo sysctl kern.securelevel=-1 > /etc/rc.securelevel + @echo kern.allowdt=1 >> /etc/sysctl.conf + @echo kern.allowkmem=1 >> /etc/sysctl.conf + @-sync + @echo $$(date) - SPEC bootstrapping complete + +rate: + @echo $$(date) - Run SPECINT2006 Rate. $(SIZE) size - $(ITERATIONS) iterations - $$(sysctl -n hw.ncpufound) workloads + @btrace /usr/share/btrace/kprofile.bt > /var/spec2006/result/rate.kprofile & cd /var/spec2006 && . ./shrc && \ + runspec -c int_rate_openbsd \ + -n $(ITERATIONS) \ + --rate=$$(sysctl -n hw.ncpufound) \ + $(RUNOPTS) \ + --size=$(SIZE) \ + int > /var/spec2006/result/rate.log; kill -2 $$(ps aux | grep btrace | grep -v grep | awk '{print $$2}') + +speed: + @echo $$(date) - Run SPECINT2006 Speed. $(SIZE) size - $(ITERATIONS) iterations + @btrace /usr/share/btrace/kprofile.bt > /var/spec2006/result/speed.kprofile && cd /var/spec2006 && . ./shrc && \ + runspec -c int_speed_openbsd \ + -n $(ITERATIONS) \ + $(RUNOPTS) \ + --size=$(SIZE) \ + int > /var/spec2006/result/speed.log; kill -2 $$(ps aux | grep btrace | grep -v grep | awk '{print $$2}') + +all: rate