summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-27 14:58:56 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-03-01 11:46:39 +0000
commit56317f8c7c31f67194c0f56cb537e53bfe000e8d (patch)
tree5abd61b83a6929bbb8e98209985bfdf4e5ae35c5
parentb74e544b3a9a53cf28be75becca0c57298e76fd3 (diff)
tcwg_kernel-bisect.sh: Handle bisecting between branches/tags
Rename bad_rev and baseline_rev to bad_branch and baseline_branch, and resolve them to SHA1 revisions. The motivation for this change is ability to gather historical data, e.g., code size regressions from GCC/LLVM 5 to 6, to 7, to 8, and so on. The bisects are intended to be triggered manually, which is why branch handling is desired. Change-Id: I9c46270e0092e72836986a4bed08799ec6d84a00
-rw-r--r--round-robin.sh4
-rwxr-xr-xtcwg_kernel-bisect.sh27
2 files changed, 20 insertions, 11 deletions
diff --git a/round-robin.sh b/round-robin.sh
index 5c665887..81b04e95 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -349,8 +349,8 @@ check_regression ()
cat > ${rr[top_artifacts]}/trigger-bisect <<EOF
current_project=$single_component
-baseline_rev=$baseline_rev
-bad_rev=$cur_rev
+baseline_branch=$baseline_rev
+bad_branch=$cur_rev
EOF
fi
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh
index 7fb28b17..bfc8e6db 100755
--- a/tcwg_kernel-bisect.sh
+++ b/tcwg_kernel-bisect.sh
@@ -16,7 +16,7 @@ fresh_dir $artifacts "$artifacts/manifests/*" "$artifacts/jenkins/*"
convert_args_to_variables "$@"
shift "$SHIFT_CONVERTED_ARGS"
-obligatory_variables bad_rev baseline_rev build_script current_project
+obligatory_variables bad_branch baseline_branch build_script current_project
BUILD_URL="${BUILD_URL:-$(pwd)}"
reproduce_bisect="${reproduce_bisect:-false}"
@@ -43,7 +43,8 @@ case "${rr[ci_project]}/${rr[ci_config]}:$current_project" in
# Search for regressions against linux-mainline:master (aka linux-next:stable).
clone_or_update_repo $current_project stable ${rr[linux_url]}
# Just in case linux-next:stable has advanced between the build and bisect jobs,
- # use merge base between linux-next:stable and $bad_rev.
+ # use merge base between linux-next:stable and $bad_branch.
+ bad_rev="${bad_rev-$(git_rev_parse_long $current_project $bad_branch)}"
linux_next_stable="${linux_next_stable-$(git -C $current_project merge-base HEAD $bad_rev)}"
cat <<EOF | manifest_out
declare -g linux_next_stable=$linux_next_stable
@@ -56,20 +57,21 @@ esac
# Build baseline that we are going to re-use to speed-up bisection.
# (This also confirms that infrastructure is OK.)
-echo "Testing baseline_rev $baseline_rev (should be success)"
+echo "Testing baseline_branch $baseline_branch (should be success)"
$build_script \
^^ $reproduce_bisect \
%% $rel_artifacts/manifests/build-baseline.sh \
@@ $rel_artifacts/manifests/build-parameters.sh \
==rr[mode] "baseline" \
- ==rr[${current_project}_branch] "$baseline_rev" \
+ ==rr[${current_project}_branch] "$baseline_branch" \
==rr[reset_baseline] true \
==rr[top_artifacts] "$rel_artifacts/build-baseline" \
--verbose "$verbose"
-assert ! [ -f $artifacts/failures ]
-
-cd $current_project
+baseline_rev="${baseline_rev-$(git -C ${current_project} rev-parse HEAD)}"
+cat <<EOF | manifest_out
+declare -g baseline_rev=$baseline_rev
+EOF
ln -f -s "build-baseline" "$artifacts/build-$baseline_rev"
ln -f -s "build-baseline.sh" "$artifacts/manifests/build-$baseline_rev.sh"
@@ -134,6 +136,13 @@ fi
EOF
chmod +x $artifacts/test.sh
+bad_rev="${bad_rev-$(git_rev_parse_long $current_project $bad_branch)}"
+cat <<EOF | manifest_out
+declare -g bad_rev=$bad_rev
+EOF
+
+cd $current_project
+
git checkout --detach $bad_rev
$artifacts/test.sh &
res=0 && wait $! || res=$?
@@ -205,8 +214,8 @@ if [ x"$res" = x"0" ]; then
assert git merge-base --is-ancestor $last_good $bad_rev
cat > $artifacts/trigger-bisect <<EOF
current_project=$current_project
-baseline_rev=$baseline_rev
-bad_rev=$last_good
+baseline_branch=$baseline_rev
+bad_branch=$last_good
EOF
# Don't send any emails.
echo > $artifacts/jenkins/mail-recipients.txt