diff --git a/spike/x86/cost.sh b/spike/x86/cost.sh index 87b82e6..5b9b105 100755 --- a/spike/x86/cost.sh +++ b/spike/x86/cost.sh @@ -78,6 +78,10 @@ text () { size -A "$1" 2>/dev/null | awk '$1==".text" {print $2}'; } # Best of REPS, in whole microseconds. A program that fails on one run and # not another would make this meaningless, so the exit status of the first # run is remembered and a run that disagrees with it poisons the row as -1. +# A program that hits the timeout is not timed at all: several of the corpus +# programs are agents or daemons that sit waiting for something that is not +# there, and five repetitions of a twenty-second wait, twice, is most of an +# afternoon spent measuring `timeout`. best () { exe=$1; min=; rc0= for i in $(seq "$REPS"); do @@ -88,6 +92,7 @@ best () { [ -n "$rc0" ] || rc0=$rc [ "$rc" = "$rc0" ] || { echo "-1"; return; } d=$(( (t1 - t0) / 1000 )) + [ "$d" -lt 15000000 ] || { echo "-1"; return; } if [ -z "$min" ] || [ "$d" -lt "$min" ]; then min=$d; fi done echo "$min"