*) error "Unknown load specification: $2";;
esac;
shift 2;;
+ -u) OPT_UPDATE=1; shift;;
esac
done
}
start_load() {
+ unset LATESTER_CONTROL_HACKBENCH
case $load in
none) ;;
- cpu) sshgw 'hackbench -g 3 -l 100000' & loadpid=$!;;
+ cpu) export LATESTER_CONTROL_HACKBENCH=$(sshgw 'nohup setpgid hackbench -g 3 -l 100000 >/dev/null & echo $!');;
eth) ping -f -s 60000 -q 192.168.2.3 & loadpid=$!;; # TODO: Generate eth load from another computer
can) latester -q -d can1 -i 0x7ff & loadpid=$!;;
*) error "Unknown load specification: $load"
kill_load() {
case $load in
none) ;;
- cpu) kill $loadpid; sshgw "killall -q hackbench || :";;
+ cpu) sshgw "kill -9 -$LATESTER_CONTROL_HACKBENCH; killall -q -9 hackbench || :";;
eth) kill $loadpid;;
can) kill $loadpid;;
*) error "Unknown load specification: $load"
}
_measure() {
+ if [[ "$OPT_UPDATE" && -f plot.sh && ( plot.sh -nt $test.sh ) ]]; then echo "skiping: up-to-date"; return; fi
# Remove data from the last measurement
rm -rf *
# Kill load generators left possibly from the past runs