diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2022-09-06 08:08:20 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2022-09-07 10:05:00 +0000 |
commit | ef11d493b5df12c55ac37f158813aa09b83fcf0f (patch) | |
tree | 59d938123882e17c77f3f5758e6251408eff7511 /round-robin-bisect.sh | |
parent | e20e5a5fc710c89909b0440246f6f47a4756a35e (diff) |
round-robin-bisect.sh: Cleanup code to try interesting-commits
Change-Id: I8cea9498291773ccb2e9f6ee51365aae92b470a6
Diffstat (limited to 'round-robin-bisect.sh')
-rwxr-xr-x | round-robin-bisect.sh | 89 |
1 files changed, 50 insertions, 39 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh index 8eb67d0d..20774553 100755 --- a/round-robin-bisect.sh +++ b/round-robin-bisect.sh @@ -310,19 +310,6 @@ if ! git -C $current_project bisect log \ ln -f -s "build-$bad_rev" "$artifacts/build-bad" fi -# Clone interesting-commits.git repo, which contains a list of SHA1s -# that might cut down bisection time. Mostly, these are first_bad and -# last_good commits. -icommits="bisect/interesting-commits" -interesting_commits_rev=${interesting_commits_rev-master} -clone_or_update_repo $icommits $interesting_commits_rev \ - https://git-us.linaro.org/toolchain/ci/interesting-commits.git \ - auto master -interesting_commits_rev=$(git -C $icommits rev-parse HEAD) -cat <<EOF | manifest_out -declare -g interesting_commits_rev=$interesting_commits_rev -EOF - # Print first_bad revision (if detected) get_first_bad () { @@ -355,9 +342,6 @@ print_tested_revs () ) } -# Try to reduce bisection range by testing regressions (and their parents) -# identified in other configurations. -mkdir -p $icommits/$current_project/sha1 # Generate list of commits inside the bisection range. commits_to_test=$artifacts/git-logs/commits_to_test git -C $current_project bisect view --pretty=%H > $commits_to_test @@ -368,33 +352,60 @@ commits_in_range=$artifacts/git-logs/commits_in_range cp $commits_to_test $commits_in_range print_tested_revs >> $commits_in_range -interesting_sha1s=() +# Try to reduce bisection range by testing regressions (and their parents) +# identified in other configurations. +print_interesting_commits () +{ + ( + set -euf -o pipefail -# These loop can generate lots of console noise. -# -# Bisecting linux-next.git regressions is difficult enough due to how -# the tree is constructed, so we prefer to not use interesting-commits -# when $rebase_workaround is true. This makes linux-next bisects as -# natural as they can be. -# Hopefully, this will get us out of an infinite bisect loop we are -# currently seeing. -set +x -while read sha1 && ! $rebase_workaround; do - # Ignore commits outside of bisection range. - if ! grep -q "^$sha1\$" $commits_to_test; then - continue + # Bisecting linux-next.git regressions is difficult enough due to how + # the tree is constructed, so we prefer to not use interesting-commits + # when $rebase_workaround is true. This makes linux-next bisects as + # natural as they can be. + if $rebase_workaround; then + return fi - prev_sha1s=() - while read prev_sha1; do - if ! grep -q "^$prev_sha1\$" $commits_to_test; then + + # Clone interesting-commits.git repo, which contains a list of SHA1s + # that might cut down bisection time. Mostly, these are first_bad and + # last_good commits. + local icommits="bisect/interesting-commits" + clone_or_update_repo $icommits master \ + https://git-us.linaro.org/toolchain/ci/interesting-commits.git \ + auto master >/dev/null 2>&1 + + local project_dir + project_dir=$icommits/$(interesting_subdir $current_project) + + if ! [ -d "$project_dir" ]; then + return + fi + + # Below loop can generate lots of console noise. + set +x + + local sha1 + while read sha1; do + # Ignore commits outside of bisection range. + if ! grep -q "^$sha1\$" $commits_to_test; then continue fi - prev_sha1s+=("$prev_sha1") - done < <(cd "$icommits/$(interesting_subdir $current_project $sha1)" - find -name last_good -print0 | xargs -0 cat | sort -u) - interesting_sha1s+=("${prev_sha1s[@]}" "$sha1") -done < <(cd "$icommits/$(interesting_subdir $current_project)"; ls) -if $verbose; then set -x; fi + while read prev_sha1; do + if ! grep -q "^$prev_sha1\$" $commits_to_test; then + continue + fi + echo "$prev_sha1" + done < <(cd "$project_dir/$sha1" + find -name last_good -print0 | xargs -0 cat | sort -u) + # Print last_good revisions first, then print out first_bad sha1. + # It's a minor heuristic optimization in bisect order. + echo "$sha1" + done < <(cd "$project_dir"; ls) + ) +} + +IFS=" " read -r -a interesting_sha1s <<< "$(print_interesting_commits)" echo "We have ${#interesting_sha1s[@]} interesting commits to try" while [ ${#interesting_sha1s[@]} != 0 ] \ |