-
Notifications
You must be signed in to change notification settings - Fork 212
Add check for BTF sysfs #3847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check for BTF sysfs #3847
Conversation
7c99876
to
e639510
Compare
The BTF sysfs interface is important because it provides a standardized way for the kernel to expose BPF Type Format (BTF) data to user space, enabling advanced introspection of kernel and module types. This accessibility is crucial for BPF tooling, such as bpftool and libbpf, to perform type-aware operations, debugging, and verification.The BTF sysfs files are at /sys/kernel/btf/ by standard, where each entry corresponds to BTF data for the kernel or loaded kernel modules. Add bpf testsuite which can be expanded with more tests
e639510
to
545e589
Compare
44972ce
to
44d83f3
Compare
@LiliDeng LGTM |
@rlmenge is it expected to see case fail against image
|
Correct. There is a bug where we claim to have full bpf support but our modules are being stripped of btf data and the fix has not yet gone in yet. The fix is here: microsoft/azurelinux#13813. I was asked to merge a test to check for this before merging the fix |
This PR adds a check for the presence of BTF data on the target system by verifying the existence of the /sys/kernel/btf/ directory with both kernel (vmlinux) and loaded module data
This directory indicates that BTF (BPF Type Format) data is available, which is crucial for certain BPF features and tools. BTF data is required for advanced BPF capabilities and observability on modern Linux kernels. Ensuring its presence helps validate system readiness for BPF workloads. Currently this test has been validated for AzureLinux scenarios.
Specifically this PR
verify_btf_sysfs_exists
to ensure /sys/kernel/btf/vmlinux and /sys/kernel/btf/ are present.Testing
Confirmed it will not run on a non AzL3 system (CBL-Mariner 2.0)
Confirm the check fails gracefully on systems without /sys/kernel/btf/.
Run the new check on a target AZL3 VM system and verify it passes on systems with BTF support.