#!/bin/bash set -euf -o pipefail scripts=$(dirname $0) # shellcheck source=jenkins-helpers.sh . $scripts/jenkins-helpers.sh # shellcheck source=round-robin.sh . $scripts/round-robin.sh convert_args_to_variables "$@" obligatory_variables rr[ci_config] # Execution mode: baseline, bisect, jenkins-full # shellcheck disable=SC2154 rr[mode]="${rr[mode]-baseline}" # Set custom revision for one of the projects, and use baseline revisions # for all other projects. # shellcheck disable=SC2154 rr[ci_project]="${rr[ci_project]-tcwg_kernel}" # shellcheck disable=SC2154 rr[baseline_branch]="${rr[baseline_branch]-linaro-local/ci/${rr[ci_project]}/${rr[ci_config]}}" # shellcheck disable=SC2154 rr[update_baseline]="${rr[update_baseline]-update}" # shellcheck disable=SC2154 rr[top_artifacts]="${rr[top_artifacts]-$(pwd)/artifacts}" # {toolchain_name}-{toolchain_ver}-{target}-{linux}-{linux_config} IFS=- read -a ci_config < "$(pwd)"/bin/${rr[target]}-cc <> ${rr[top_artifacts]}/results echo "$linux_n_obj" >> ${rr[top_artifacts]}/results if [ $res = 0 ]; then echo "# linux build successful:" >> ${rr[top_artifacts]}/results echo "all" >> ${rr[top_artifacts]}/results fi return $res ) } # Boot linux kernel boot_linux () { ( set -euf -o pipefail local image cpu case ${rr[target]} in aarch64) image=linux/arch/arm64/boot/Image.gz cpu="-cpu cortex-a53" ;; arm) image=linux/arch/arm/boot/zImage cpu="" ;; *) assert false ;; esac local qemu qemu="$(pwd)/abe/builds/hosttools/x86_64-pc-linux-gnu/bin/qemu-system-${rr[target]}" timeout --foreground 60s "$qemu" \ -kernel $image -machine virt $cpu -m 512 \ -serial stdio -display none \ -append "console=ttyAMA0 panic=-1" -no-reboot echo "# linux boot successful:" >> ${rr[top_artifacts]}/results echo "boot" >> ${rr[top_artifacts]}/results ) } # Exit with code 0 if no regression compared to base-artifacts/results. no_regression_p () { ( set -euf -o pipefail local ref_artifacts=$1 local new_artifacts=$2 local linux_n_obj linux_n_obj=$(grep -v "^#" $new_artifacts/results | tail -n1) # Assume worst for non-existent baseline. local base_linux_n_obj="-10" if [ -f $ref_artifacts/results ]; then base_linux_n_obj=$(grep -v "^#" $ref_artifacts/results | tail -n1) fi # In log scan for errors below # - sed -e 's/"[^"]*"//g' -- removes quoted "error: app diagnostics" strings # - " error:" detects compiler errors from GCC and Clang (including GCC ICEs) # - "^ERROR:" detects linker errors # - ": undefined reference" detects missing symbols during linking # - "] Error " detects GNU make errors # Then grep for "grep" to exclude other uses of this search. # shellcheck disable=SC2154 # (defined by init_step in jenkins-helpers) cat > $run_step_artifacts/results.regressions <