Loading clang built eBPF objects with libbcc
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 3
Description
Hi Guys,
I am trying to use libbcc in Android to load eBPF code required for various usecases. Currently the libbcc API only supports taking a string containing C source code and building/loading that.
Some usecases in Android are building objects using clang command directly and loading it using a custom written loader, I want to be able to use libbcc to do the same so I can also use other features in libbcc such as map support, tracepoints, etc.
I could re-use some code from the Linux kernel's eBPF ELF parser from tools/lib/bpf/ but that's GPL v2.0, but Android is Apache 2.0, so this will not work.
I am thinking of spending some time to make libbcc to be able to do that (load clang built eBPF objects). Any ideas or thoughts about how to go about this? Anything to look out for? Thanks a lot.
CC: @yonghong-song @4ast @palmtenor @pchaigno @drzaeus77
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the existing libbcc API that accepts C source and the Linux kernel eBPF ELF parser in tools/lib/bpf/, both mentioned in the issue. Investigate how clang-built eBPF objects could be loaded under Android's licensing constraints; done means libbcc can load those objects while retaining map and tracepoint support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100