ebpf icon indicating copy to clipboard operation
ebpf copied to clipboard

Ensure the ELF reader works for objects built without BTF

Open ti-mo opened this issue 6 months ago • 7 comments

Follow-up to https://github.com/cilium/ebpf/pull/1807.

Loading BPF objects without BTF info has always been supported, and although there's little reason to disable compiling with BTF nowadays, we should have at least some tests that somewhat verify this doesn't regress. Some users may not need BTF or don't want their users to be able to inspect it. Either we decide to always require BTF (feels heavy-handed and unnecessary), or we ensure it keeps working.

Some suggestions:

  • Build loader.c without BTF on the latest toolchain. Most map defs are BTF, but there are still some legacy ones. Add a test that loads it and compares the CollectionSpec to a well-known definition like TestLoadCollectionSpec.
  • Separate .c file with a subset of loader.c to lower the footprint of the test.
  • Run some discovery in the code base to find code paths that require BTF and make sure proper errors are returned and there are no panics.

ti-mo avatar Jun 23 '25 09:06 ti-mo

can I work on this ?

7h3-3mp7y-m4n avatar Jun 23 '25 10:06 7h3-3mp7y-m4n

@7h3-3mp7y-m4n Sure! Assigned the issue to you.

ti-mo avatar Jun 23 '25 12:06 ti-mo

Hey! I also wanted to work on this. @7h3-3mp7y-m4n, are you busy? If so, can I pick this up?

Al-Masih-ad-Dajjal avatar Jun 23 '25 12:06 Al-Masih-ad-Dajjal

If you are that eager, then you can pick this up! Good luck @Al-Masih-ad-Dajjal

7h3-3mp7y-m4n avatar Jun 23 '25 16:06 7h3-3mp7y-m4n

hey @ti-mo , can you please assign this to me ?

Al-Masih-ad-Dajjal avatar Jun 25 '25 20:06 Al-Masih-ad-Dajjal

Hi, I’d like to work on this issue. Could you assign me if it’s still available?

gajjuu avatar Sep 24 '25 11:09 gajjuu

Hi, I appreciate the interest, but given there's little movement here I'll remove all current assignments and leave it that way. If someone ends up finding some improvements in this area, please just send a PR. Thank you!

ti-mo avatar Nov 12 '25 14:11 ti-mo