summaryrefslogtreecommitdiff
path: root/bpfloader
diff options
context:
space:
mode:
authorConnor O'Brien <connoro@google.com>2022-01-18 21:41:16 -0800
committerConnor O'Brien <connoro@google.com>2022-01-24 21:24:26 +0000
commit35425e5a884342b6b3ce50d990080288e3b3140b (patch)
tree1addf60d269a6bff12b5c8b79e104adf288dfc61 /bpfloader
parent00fa9635f8ccf36c8ae57b113e80d6c19c5c19c3 (diff)
downloadbpf-35425e5a884342b6b3ce50d990080288e3b3140b.tar.gz
bpfloader: load map BTF via btfloader
btfloader uses upstream libbpf & libelf to parse the BTF sections of a bpf .o file, load BTF information into the kernel, and identify the BTF type ids corresponding to each map's keys and values. Extend bpfloader to run btfloader on any .o file with a .BTF section. We pass btfloader socket and pipe fds, which it will use to send back a BTF fd and the key & value type ids, respectively. To ensure a btfloader bug can't block bpfloader indefinitely, wait for btfloader to run with a short timeout and use nonblocking socket & pipe for communication. Finally, add a check to BpfLoadTest to verify that map BTF is loaded as expected. Test: build & boot; existing programs load successfully Test: libbpf_load_test Signed-off-by: Connor O'Brien <connoro@google.com> Change-Id: I7bac83a08c2dc452bdb9030f1e74781116c1dd5c
Diffstat (limited to 'bpfloader')
-rw-r--r--bpfloader/Android.bp1
1 files changed, 1 insertions, 0 deletions
diff --git a/bpfloader/Android.bp b/bpfloader/Android.bp
index beff687..4dbabfa 100644
--- a/bpfloader/Android.bp
+++ b/bpfloader/Android.bp
@@ -55,6 +55,7 @@ cc_binary {
init_rc: ["bpfloader.rc"],
required: [
+ "btfloader",
"time_in_state.o"
],