summaryrefslogtreecommitdiff
path: root/bpfloader
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2021-11-18 12:23:02 -0800
committerMaciej Żenczykowski <maze@google.com>2021-11-19 01:18:12 +0000
commite49e0c60cd52a3ff80b57f7aa4faf79d9d6a911e (patch)
tree0bd3156e404771ac9fd3c91ecc04f64d97f03d41 /bpfloader
parent210d6be5ac0dd8e76c683cb0f5d194ce3a19d224 (diff)
downloadbpf-e49e0c60cd52a3ff80b57f7aa4faf79d9d6a911e.tar.gz
document how to debug bpfloader failures
Test: N/A Bug: 204131517 Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ia6a8ca026f3ab403443e130dceb2aca0ce0f2343
Diffstat (limited to 'bpfloader')
-rw-r--r--bpfloader/bpfloader.rc24
1 files changed, 24 insertions, 0 deletions
diff --git a/bpfloader/bpfloader.rc b/bpfloader/bpfloader.rc
index 53219f4..0d92cd8 100644
--- a/bpfloader/bpfloader.rc
+++ b/bpfloader/bpfloader.rc
@@ -57,6 +57,30 @@ service bpfloader /system/bin/bpfloader
#
rlimit memlock 1073741824 1073741824
oneshot
+ #
+ # How to debug bootloops caused by 'bpfloader-failed'.
+ #
+ # 1. On some lower RAM devices (like wembley) you may need to first enable developer mode
+ # (from the Settings app UI), and change the developer option "Logger buffer sizes"
+ # from the default (wembley: 64kB) to the maximum (1M) per log buffer.
+ # Otherwise buffer will overflow before you manage to dump it and you'll get useless logs.
+ #
+ # 2. comment out 'reboot_on_failure reboot,bpfloader-failed' below
+ # 3. rebuild/reflash/reboot
+ # 4. as the device is booting up capture bpfloader logs via:
+ # adb logcat -s 'bpfloader:*' 'LibBpfLoader:*'
+ #
+ # something like:
+ # $ adb reboot; sleep 1; adb wait-for-device; adb root; sleep 1; adb wait-for-device; adb logcat -s 'bpfloader:*' 'LibBpfLoader:*'
+ # will take care of capturing logs as early as possible
+ #
+ # 5. look through the logs from the kernel's bpf verifier that bpfloader dumps out,
+ # it usually makes sense to search back from the end and find the particular
+ # bpf verifier failure that caused bpfloader to terminate early with an error code.
+ # This will probably be something along the lines of 'too many jumps' or
+ # 'cannot prove return value is 0 or 1' or 'unsupported / unknown operation / helper',
+ # 'invalid bpf_context access', etc.
+ #
reboot_on_failure reboot,bpfloader-failed
# we're not really updatable, but want to be able to load bpf programs shipped in apexes
updatable