Should make integration with BpfLoader written in rust easier.
While at it add simple wrappers around ALOG{V,D,I,W,E}(),
which may come in handy as bpfloader runs early enough that
logging must be to the kernel dmesg ringbuffer instead...
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia49c605bae63241b74d04e2e0f58fd089c23993d
Maciej Żenczykowskiauthored and Neill Kaproncommited 2024-08-07 21:20:02 +00:00
Prep work to make legacy BpfLoader usable as a library from rust.
Note: fixups to make this actually build will be in the next commit.
Generated via:
cd //system/bpf/loader
echo >> Loader.cpp
cat BpfLoader.cpp >> Loader.cpp
rm BpfLoader.cpp
Test: will not build, requires followup
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id3a942bd0d217f3b689f165666b73e1f2834d33f
Maciej Żenczykowskicommited 2024-08-06 15:25:56 -07:00
The only non-test use of the library is the BpfLoader,
so it makes sense for everything to use the same tag.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iddc0472a39db292fef31b2e195b3ab919d884f7d
Maciej Żenczykowskicommited 2024-05-01 05:17:05 -07:00
Move setting 'bpf.progs_loaded' property to 1 into mainline.
This doesn't terribly matter, but it gives mainline bpf loading
code a chance to run after platform and perform any required
finalization.
While at it also use distinctive error return values,
as these are often the only thing that init reports about
a bpfloader failure.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If502cf07c8ceed306c18821075a92f99437da4dd
Maciej Żenczykowskicommited 2024-04-30 23:53:07 -07:00
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
Maciej Żenczykowskicommited 2024-04-30 22:37:04 -07:00
I've *never* ended up using this information...
Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I621d32fb235e9cd88989e99536485674c74fa884
Maciej Żenczykowskicommited 2024-03-11 04:01:21 +00:00
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
Maciej Żenczykowskicommited 2024-03-11 04:01:07 +00:00
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
Maciej Żenczykowskicommited 2024-03-11 04:00:13 +00:00