diff options
-rw-r--r-- | Makefile | 11 | ||||
-rwxr-xr-x | capture.sh | 12 | ||||
-rwxr-xr-x | etc/machine.sh | 26 | ||||
-rw-r--r-- | src/Specific/X25519/C64/measurements.txt | 1 |
4 files changed, 49 insertions, 1 deletions
@@ -17,7 +17,8 @@ INSTALLDEFAULTROOT := Crypto install-coqprime clean-coqprime coqprime \ specific-c specific-display display \ specific non-specific lite only-heavy printlite \ - curves-proofs no-curves-proofs + curves-proofs no-curves-proofs \ + bench c SORT_COQPROJECT = sed 's,[^/]*/,~&,g' | env LC_COLLATE=C sort | sed 's,~,,g' | uniq @@ -135,6 +136,8 @@ $(DISPLAY_NON_JAVA_VO:.vo=.log) : %Display.log : %.vo %Display.v src/Compilers/Z $(SHOW)"COQC $*Display > $@" $(HIDE)$(COQC) $(COQDEBUG) $(COQFLAGS) $*Display.v > $@.tmp && mv -f $@.tmp $@ +c: $(DISPLAY_NON_JAVA_VO:Display.vo=.c) + $(DISPLAY_NON_JAVA_VO:Display.vo=.c) : %.c : %Display.log extract-function.sh ./extract-function.sh $(patsubst %Display.log,%,$(notdir $<)) < $< > $@ @@ -150,6 +153,12 @@ DISPLAY_X25519_C64_VO := $(filter src/Specific/X25519/C64/%,$(DISPLAY_NON_JAVA_V src/Specific/X25519/C64/measure: src/Specific/X25519/C64/compiler.sh measure.c $(DISPLAY_X25519_C64_VO:Display.vo=.c) $(DISPLAY_X25519_C64_VO:Display.vo=.h) src/Specific/X25519/C64/scalarmult.c src/Specific/X25519/C64/compiler.sh -o src/Specific/X25519/C64/measure -I src/Specific/X25519/C64/ measure.c $(DISPLAY_X25519_C64_VO:Display.vo=.c) src/Specific/X25519/C64/scalarmult.c -D TIMINGS=2047 -D UUT=crypto_scalarmult_bench +src/Specific/X25519/C64/measurements.txt: src/Specific/X25519/C64/measure + ./capture.sh src/Specific/X25519/C64 + +bench: src/Specific/X25519/C64/measurements.txt + head -999999 $? + clean:: rm -f Makefile.coq diff --git a/capture.sh b/capture.sh new file mode 100755 index 000000000..8e0455713 --- /dev/null +++ b/capture.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +machine=$(etc/machine.sh) +measurement=$($1/measure | (LC_ALL=C sort -n || true) | head -1024 | tail -1) +revision=$(git rev-parse --short HEAD) + +( + grep -v "$machine" "$1/measurements.txt" 2>/dev/null || true; + echo "$measurement $machine $revision" +) | (LC_ALL=C sort -n || true) > "$1/measurements.txt.tmp" + +mv "$1/measurements.txt.tmp" "$1/measurements.txt" diff --git a/etc/machine.sh b/etc/machine.sh new file mode 100755 index 000000000..43981110b --- /dev/null +++ b/etc/machine.sh @@ -0,0 +1,26 @@ +#!/bin/sh +set -euo pipefail + +printf "$(hostname)" +printf - +grep -q '[^0-9]' /sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list && printf ht || printf noht +printf - +grep -q 1 /sys/devices/system/cpu/intel_pstate/no_turbo && printf notb || printf tb +printf - +grep -q 1 /sys/class/power_supply/AC/online && printf ac || printf noac +printf - +printf "$(gcc -march=native -Q --help=target|grep march | cut -d= -f2 | grep -ow '\S*')" +printf - + +for cpu in $(seq 1 $(nproc)); do + echo "scale=100000;pi=4*a(1);0" | bc -l & + echo $! +done | ( \ + sleep .1 ; + mhz=$(cat /proc/cpuinfo | grep "^[c]pu MHz" | cut -d: -f2 | tr -d ' ' | sort -nr | head -1); + printf "$(echo "scale=2; ($mhz + 5)/1000" | bc)ghz" + while IFS= read -r pid; do + kill "$pid"; + done ) + +printf '\n' diff --git a/src/Specific/X25519/C64/measurements.txt b/src/Specific/X25519/C64/measurements.txt new file mode 100644 index 000000000..7b3c15cc4 --- /dev/null +++ b/src/Specific/X25519/C64/measurements.txt @@ -0,0 +1 @@ +177144 ashryn-noht-notb-ac-broadwell-2.50ghz 87bf48fc |