From 9b60eb41ff219ce185542568b9d42d3d87fd9ed8 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 28 Jul 2021 18:55:43 +0000 Subject: tcwg-benchmark.sh: Add bits from tcwg-benchmark-bare.sh Change-Id: Ic9f0a88cf71314435ecafaf7941f6247b0071463 --- tcwg-benchmark.sh | 91 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 31 deletions(-) diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh index 6c534f04..c2709722 100755 --- a/tcwg-benchmark.sh +++ b/tcwg-benchmark.sh @@ -123,6 +123,21 @@ case "$toolchain_url" in ;; "rsync://"*) ccprefix="${toolchain_url##rsync://}" + + # Extract host:port: specification from ccprefix, we don't + # need to care about :parallelize here, just pass it to run.sh + # if present. + rsync_spec=${ccprefix%:*} + rsync_host="$(echo $rsync_spec | cut -d: -f 1)" + case ${ccprefix} in + *:*:*) + rsync_port="$(echo $rsync_spec | cut -s -d: -f 2)" + ;; + *:*) + # If no port is specified, use 22 (ssh default port) + rsync_port=22 + ;; + esac # We want to access the remote toolchain via a container, to # avoid problems with the hosts's ssh server restrictions on the # number of simulaneous connexions. @@ -130,9 +145,10 @@ case "$toolchain_url" in # architecture as the machine pointed to by $toolchain_url). # Assume ccprefix looks like /path/bin/target-triplet-, and # compute 'path'. - src_toolchaindir=$(dirname "$(dirname ${ccprefix})") + src_toolchaindir=$(dirname "$(dirname ${ccprefix##*:})") toolchaindir="${WORKSPACE}/toolchain-${BUILD_NUMBER}" - rsync -az --delete "$src_toolchaindir/" "$toolchaindir/" + rsync -az --delete -e "ssh -p$rsync_port" \ + "$rsync_host:$src_toolchaindir/" "$toolchaindir/" ;; *) echo "ERROR: Cannot handle toolchain_url: $toolchain_url" @@ -254,8 +270,9 @@ esac case "$hw_tag:$reboot" in stm32:*) # 1. If the host machine isn't available on the 1st try -- give up. - reboot=false tries_left=1 + reboot=false + prepare_board=false ;; *:true) # 1. Try access after soft reboot @@ -318,11 +335,6 @@ if [ $res != 0 ]; then exit $EXTERNAL_FAIL fi -case "$testmode" in - build|verify) input_size="test" ;; - benchmark) input_size="ref" ;; -esac - if $prepare_board; then # FIXME: Implement more configurations and checks: # disable swap @@ -353,29 +365,46 @@ fi trap "cleanup_all_containers" EXIT . ./run-container.sh - -# vars are from run-container.sh sourced above -# shellcheck disable=SC2154 -remote_exec "$run_container_host:$run_container_port::-t -Snone" \ - bmk-scripts/run.sh \ - --bench "$bench_list" \ - --config "${BUILD_NUMBER}-$run_profile" \ - --cflags "$cflags" \ - --ldflags "$ldflags" \ - --ccprefix "$ccprefix" \ - --extension "$extension" \ - --hw_tag "$hw_tag" \ - --ignore_errors "$ignore_errors" \ - --input_size "$input_size" \ - --iterations "$iterations" \ - --run_profile "$run_profile" \ - ${sysroot:+--sysroot "$sysroot"} \ - --toolchain "$toolchain_type" \ - --resultsdest "bkp-01.tcwglab:/home/tcwg-benchmark/results-${results_id}/$boardname" \ - --nodename "$boardname" \ - --forceinstall "${forceinstall}" \ - ${clean_older_than:+--clean_older_than "$clean_older_than"} \ - --verbose true +declare -g run_container_host run_container_port + +case "$bench_list" in + coremark) + remote_exec "$run_container_host:$run_container_port:$WORKSPACE/bmk-scripts:-t -Snone" \ + ./coremark.sh \ + --ccprefix "$ccprefix" \ + --cflags "$cflags" \ + --ldflags "$ldflags" \ + --forceinstall "true" \ + --resultsdest "bkp-01.tcwglab:/home/tcwg-benchmark/results-${results_id}/$boardname" \ + --verbose true + ;; + *) + case "$testmode" in + build|verify) input_size="test" ;; + benchmark) input_size="ref" ;; + esac + remote_exec "$run_container_host:$run_container_port::-t -Snone" \ + bmk-scripts/run.sh \ + --bench "$bench_list" \ + --config "${BUILD_NUMBER}-$run_profile" \ + --cflags "$cflags" \ + --ldflags "$ldflags" \ + --ccprefix "$ccprefix" \ + --extension "$extension" \ + --hw_tag "$hw_tag" \ + --ignore_errors "$ignore_errors" \ + --input_size "$input_size" \ + --iterations "$iterations" \ + --run_profile "$run_profile" \ + ${sysroot:+--sysroot "$sysroot"} \ + --toolchain "$toolchain_type" \ + --resultsdest "bkp-01.tcwglab:/home/tcwg-benchmark/results-${results_id}/$boardname" \ + --nodename "$boardname" \ + --forceinstall "${forceinstall}" \ + ${clean_older_than:+--clean_older_than "$clean_older_than"} \ + --verbose true + ;; +esac if $prepare_board; then remote_exec "$boardname:::-t -Snone" \ -- cgit v1.2.3