iovisor / iovisor/bcc

Ahead-of-time compilation

Open
#1,887 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

In order to allow deployment on more minimally-configured Linux systems, I think providing an option for ahead-of-time compilation would be valuable. Meaning, only a small subset of the bcc library (an ELF loader for example) and none of the C header files/clang would be needed when the BPF syscalls are actually made. The ELF file could be created on another system.

I'm aware of many of the difficulties that would be associated with this with the current design.
For example, the clang frontend assumes it can run BPF syscalls at compile time, especially when rewriting process-local FD's for maps.
This could be mitigated by offloading this work to the loader, similar to the [Linux kernel examples](https://github.com/torvalds/linux/blob/9d3cce1e8b8561fed5f383d22a4d6949db4eadbe/samples/bpf/bpf_load.c#L579).
I'm also aware that this would make the generated eBPF bytecode target a specific Linux version and arch, considering the `bpf_probe_read` translations would be invalid on a different version.

Would this be against the current use case and target of bcc to implement this feature?
To be clear, I'm not asking for it to be made, but if it were to be made, would the PR(s) be accepted?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing bcc's current clang frontend and loader design, then compare the proposed loader responsibilities with the Linux kernel example bpf_load.c linked in the issue. Clarify whether ahead-of-time compilation fits bcc's target use case and define the required deployment and compatibility boundaries before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
compilers, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.