no need for the complexity, as it is only for vendor now
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia807f7ee8aeca25d92e60e46f180ffe536eef87c
Maciej Żenczykowskicommited 2025-06-17 04:18:41 -07:00
These directories are not populated on real devices
and are not part of the test suite.
This change removes them from the BPF loader.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I719d0feb9ef1a6f0a1e41265af47916410590ac7
Maciej Żenczykowskicommited 2025-06-16 01:28:45 -07:00
Don't include <linux/bpf.h> if using vmlinux; as this causes
double inclusions.
Bug: 419635765
Test: manual; build and load a CO-RE BPF program
Change-Id: I4419778ea71b65ce46ac5e0e6358c33d7f78b82e
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
(the test is being removed as it tests the obsolete C++
platform bpf loader)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ica990e6fcc0f34374d32946298ae85f86d664dcc
Maciej Żenczykowskicommited 2025-05-23 03:00:08 -07:00
C/C++ platform bpf loader is being replaced by rust version.
This test never had much value, and additional relies on
a sepolicy violation being allowed by su.
The bpf ring buf test is far better.
Test: TreeHugger
Flag: EXEMPT test code removal
Signed-off-by: Maciej Żenczykowski maze@google.com>
Change-Id: I448cc543aa9a0c161515ae2189020bf98db7bca3
Maciej Żenczykowskicommited 2025-05-22 14:10:18 -07:00
Before this CL, the kernel version check occurred after all programs
were loaded by `open_file.load()`.
This CL moves the check before `open_file.load()`. It calls
`prog.set_autoload(false)` for programs incompatible with the current
kernel, preventing their auto-load by libbpf.
Test: Verify the program is not loaded if the kver is out of range
Bug: 410982483
Change-Id: Ifacd9dd8696a7bb4fd186ad1faf01fba9f021c6d
Before this CL, the kernel version check occurred after all maps
were loaded by `open_file.load()`.
This CL moves the check before `open_file.load()`. It calls
`map.set_autocreate(false)` for maps incompatible with the current
kernel, preventing their auto-creation by libbpf.
Test: Verify the map is not loaded if the kver is out of range
Bug: 410982483
Change-Id: I7a102dd2ef4b24f87c6efa5a105848fddc08d501
libbpf creates an array map for the .rodata section to allow BPF
programs to access its data. However, the loader does not need
to pin this map as userspace processes do not require access to it.
This does not break existing code as the legacy bpfloader did not
create a map for .rodata.
Bug: 410982483
Test: TH
Change-Id: I036c93849731c25e8d1b6a2c1778ffc60935bbe2
Currently, the owner and group apply to each BPF object file.
However, each map and program can specify a different owner and group,
even if they are in the same BPF object file.
This is a no-op for existing timeInState.bpf
Bug: 410982483
Test: TH
Change-Id: I0fa2731385645e598b4d3bb7d27200dbb6d3a8ec
This is a no-op because maps and progs of timeInState are always loaded.
They have min_kver: KVER_NONE and max_kver: KVER_INF.
Bug: 410982483
Test: atest bpfloader_tests with next CL
Change-Id: I5db1909126fb3ca43939f39653f8a2334f130e94
This is a no-op because maps and progs of timeInState are pinned under
/sys/fs/bpf/ and this directory already exists.
Bug: 410982483
Test: timeInState.bpf loaded successfully
Change-Id: Ied42ebcbde5c8727f19c31b8dc9930dac2ef5f79
The "dir" field specifies the directory where the BPF file is located.
The "prefix" field specifies the subdirectory under
/sys/fs/bpf/ where maps and programs are pinned.
These fields are required for memevents and vendor bpf.
This CL is a no-op for the existing timeInState.bpf loading
Bug: 410982483
Test: timeInState.bpf loaded successfully
Change-Id: Ic509b19490b9561173f84ace10d68c7725f8055b
Update program name to match the attach point
definition, with forward slashes `/` replaced with underscores `_`.
This is required to pin the program to the same path the legacy platform
bpf loader uses.
Bug: 410982483
Test: TH
Change-Id: Ibdb24707c58792a61da6a6c7fe5f57fb7267f6e5
This is a preparation for migrating to the Rust platform bpfloader.
Bug: 410982483
Test: m bpfRingbufProg.bpf bpfRingbufProg.o
Change-Id: I094635be14e56aac53384ac517538c2587367c44