mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-13 20:12:26 +00:00
bisection: update section, add gem5 linux boot bisect script
This commit is contained in:
13
README.adoc
13
README.adoc
@ -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
12
bisect-gem5-linux-boot
Executable 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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user