Should speed up boot time - especially if serial console is enabled.
There's probably still enough information available to debug issues,
as any errors (which basically shouldn't happen) are still all
extensively logged.
Either way, as this now only loads platform bpf .o files, anyone seeing
boot time problems can simply flash a custom build with changes to the
platform BpfLoader to enable any extra logging as needed.
(Note that AFAICT normally ALOGV() is basically ignored)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5e404ae14c33ee319c07be42defdc270b15a54fe
BpfLoadTest was failing on android13-5.10 kernels due to the rlimit
memlock not being configured large enough for the test process. Add the
necessary call to set rlimit memlock for pre-5.11 kernels.
5.11 kernels introduced cgroup-based memory accounting for bpf as
discussed at https://lore.kernel.org/bpf/20201201215900.3569844-1-guro@fb.com/
Flag: n/a
Test: atest libbpf_load_test
Bug: 326156952
Change-Id: I8eda9fe6cee099b1fd979720a4e94d685a571943
Signed-off-by: Neill Kapron <nkapron@google.com>
I've *never* ended up using this information...
Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I621d32fb235e9cd88989e99536485674c74fa884
For platform bpf .o files per-map/prog selinux context can simply
be added by genfscon selinux policy modifications.
(while per-map/prog pin dir really only exists to support the selinux context)
Test: TreeHugger
Both before and after this patch 'adb shell find /sys/fs/bpf | wc -l' returns 103
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic700db2870c16a04c9498e529519051a672a28c8
Besides tests, we're the only user (unsurprising considering
selinux limitations on who can actually load bpf programs...)
This slightly reduces disk space consumption...
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Icadfb45d556ebf9d19b9b2ea2173c014a39b1278
The only (real) user is the platform bpfloader binary.
This is a library purely to facilitate testing.
It's easier to develop / code-search if everything is in the same directory.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iebe8a5c4f8bb9ada220acec6ed8c1be0fc9d438c
//system/bpf/bpfloader/BpfLoader.cpp is just pointlessly wordy.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I52a9dd11d2cc844a385e7971e38c7188118aaed0
This is not needed, as all platform bpf .o's are built at the same time
(and thus from the same bpf map/prog structure definitions) as
the loader itself.
This effectively undoes much of aosp/1754794
'bpf loader improvements for better long term compatibility with mainline'
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8cd6865cfb49bb282b2dcff1957dd9826e501da1
We've never used it (even in mainline) and it's probably even
less useful in platform, as it can simply be handled at build
time by appropriate Android.bp stanzas...
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I788dae8d0378556e5e4580e1ca4f2f0cd6b393dc
Unlike in mainline, this isn't actually particularly useful for
platform, as you can simply not include such programs
via Android.bp/mk stanzas at build time.
Even in mainline we've had only one user (and we've graduated
that use as well...)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com
Change-Id: I66a83e79a866c306de4c409e8b5822eac99454ec
it's now meaningless, as it only loads programs
that are part of platform and thus compiled at
the same time (there can thus be no version skew).
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5552f551bae432814b606c3618eb95833e2edb0d
Platform bpfloader version cannot skew vs platform shipped
bpf.o files, as they are built at the same time...
This is because the platform bpfloader no longer loads mainline
(and thus potentially newer) shipped bpf.o files.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I41a287cb726148269159cc7b08397a748eb70b75
(setting the sysctls is already done by NetBpfLoad.cpp before this,
while creating the loader subdir will happen after aosp/2983013,
but that is currently unused functionality anyway)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie465e4be459d5b77924799c486b5fe03bef6f521
This CL is created as a best effort to migrate test targets to the new Android ownership model.
It is based on historical data from repository history and insights from git blame.
Given the nature of this effort, there may be instances of incorrect attribution. If you find incorrect or unnecessary
attribution in this CL, please create a new CL to fix that.
For detailed guidelines and further information on the migration please refer to the link below,
go/new-android-ownership-model
Bug: 304529413
Test: N/A
Change-Id: Ifb44dde6bd09eada179228a6cbaa67e0c4d1b863