bisection: update section, add gem5 linux boot bisect script

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-21 00:00:00 +00:00
parent c247f98d23
commit 8d40a61e1a
4 changed files with 24 additions and 7 deletions

View File

@ -15212,7 +15212,7 @@ However, for many types of crashes, it is trivial to bisect down to the offendin
For example, when updating from QEMU `v2.12.0` to `v3.0.0-rc3`, the Linux kernel boot started to panic for `arm`.
We then bisected it as explained at: https://stackoverflow.com/questions/4713088/how-to-use-git-bisect/22592593#22592593 with the link:qemu-bisect-boot[] script:
We then bisected it as explained at: https://stackoverflow.com/questions/4713088/how-to-use-git-bisect/22592593#22592593 with the link:bisect-qemu-linux-boot[] script:
....
root_dir="$(pwd)"
@ -15220,20 +15220,20 @@ cd "$(./getvar qemu_source_dir)"
git bisect start
# Check that our test script fails on v3.0.0-rc3 as expected, and mark it as bad.
"${root_dir}/qemu-bisect-boot"
"${root_dir}/bisect-qemu-linux-boot"
# Should output 1.
echo #?
git bisect bad
# Same for the good end.
git checkout v2.12.0
"${root_dir}/qemu-bisect-boot"
"${root_dir}/bisect-qemu-linux-boot"
# Should output 0.
echo #?
git bisect good
# This leaves us at the offending commit.
git bisect run ../bisect-qemu-linux-boot
git bisect run "${root_dir}/bisect-qemu-linux-boot"
# Clean up after the bisection.
git bisect reset
@ -15241,7 +15241,10 @@ git submodule update
"${root_dir}/build-qemu" --clean --qemu-build-id bisect
....
TODO broken, fix: An example of Linux kernel commit bisection on gem5 boots can be found at: link:bisect-linux-boot-gem5[].
Other bisection helpers include:
* link:bisect-linux-boot-gem5[]
* link:bisect-gem5-linux-boot[]
[[path-properties]]
=== path_properties

12
bisect-gem5-linux-boot Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# https://github.com/cirosantilli/linux-kernel-module-cheat#bisection
set -eu
cd ../..
./build-gem5 --gem5-build-id bisect
set +e
# Setup for quick failures:
# https://stackoverflow.com/questions/4713088/how-to-use-git-bisect/22592593#22592593
timeout 5 ./run --emulator gem5 --gem5-build-id bisect --quit-after-boot
if [ $? -ne 124 ]; then
exit 1
fi

View File

@ -1,9 +1,10 @@
#!/usr/bin/env bash
# https://github.com/cirosantilli/linux-kernel-module-cheat#bisection
set -eu
./build-linux --clean "$@"
./build-linux "$@"
set +e
./run --eval 'm5 exit' "$@" || status=$?
./run --quit-after-boot "$@" || status=$?
# https://stackoverflow.com/questions/4713088/how-to-use-git-bisect/22592593#22592593
if [ "$status" -eq 125 ] || [ "$status" -gt 127 ]; then
status=1

View File

@ -1,6 +1,7 @@
#!/usr/bin/env bash
# https://github.com/cirosantilli/linux-kernel-module-cheat#bisection
set -eu
git submodule update --recursive
cd ../..
./build-qemu --arch aarch64 --qemu-build-id bisect
./run --arch aarch64 --kernel-cli 'init=/lkmc/linux/poweroff.out' --qemu-build-id bisect
./run --arch aarch64 --qemu-build-id bisect --quit-after-boot