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
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
//system/bpf/bpfloader/BpfLoader.cpp is just pointlessly wordy.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I52a9dd11d2cc844a385e7971e38c7188118aaed0
Maciej Żenczykowskicommited 2024-03-11 04:00:05 +00:00