#!/bin/bash set -euf -o pipefail scripts=$(dirname $0) . $scripts/jenkins-helpers.sh . $scripts/round-robin.sh convert_args_to_variables "$@" obligatory_variables rr[ci_config] ssh_host ssh_port # Execution mode: baseline, bisect, jenkins-full rr[mode]="${rr[mode]-baseline}" # Set custom revision for one of the projects, and use baseline revisions # for all other projects. rr[ci_project]="${rr[ci_project]-tcwg_bmk}" rr[baseline_branch]="${rr[baseline_branch]-linaro-local/ci/${rr[ci_project]}/${rr[ci_config]}}" rr[reset_baseline]="${rr[reset_baseline]-false}" rr[top_artifacts]="${rr[top_artifacts]-$(pwd)/artifacts}" # {toolchain_name}-{toolchain_ver}-{target}-{bmk}-{cflags} IFS=- read -a ci_config < "${rr[top_artifacts]}/results_id" ) } # Exit with code 0 if no regression compared to base-artifacts/results. no_regression_p () { ( set -euf -o pipefail if ! [ -f base-artifacts/results ]; then return 0 fi local build_result_ref build_result_new build_result_ref=$(tail -n1 base-artifacts/results) build_result_new=$(tail -n1 ${rr[top_artifacts]}/results) if [ $build_result_new -lt $build_result_ref ]; then return 1 fi if ! [ -f base-artifacts/results_id ]; then return 0 fi local results_ref results_ref=$(cat base-artifacts/results_id) $scripts/tcwg-benchmark-results.sh --results_ref $results_ref --results_id $results_id --top_artifacts "${rr[top_artifacts]}" --verbose $verbose # Skip header line tail -n +2 ${rr[top_artifacts]}/results.csv | \ while IFS=, read -r bmk symbol speed size; do # Skip case where we have no info ("n/a") if [ "$size" != "n/a" ]; then if [ "$size" -gt 100 ]; then echo "Regression in bench $bmk, symbol $symbol size increased ($size vs 100)" return 1 fi fi done ) } run_step stop_on_fail -10 reset_artifacts case "${rr[toolchain]}" in gnu) run_step stop_on_fail x prepare_abe run_step skip_on_fail -9 build_abe binutils run_step skip_on_fail -8 build_abe stage1 run_step skip_on_fail -7 build_abe linux run_step skip_on_fail -6 build_abe glibc run_step skip_on_fail -5 build_abe stage2 ;; llvm) run_step skip_on_fail -1 build_llvm ;; esac run_step skip_on_fail 0 benchmark run_step reset_on_fail x check_regression run_step stop_on_fail x update_baseline run_step stop_on_fail x push_baseline trap "" EXIT