EBPF: Difference between revisions

No edit summary
No edit summary
Line 7: Line 7:


==Compiling eBPF==
==Compiling eBPF==
===BCC===
The BPF Compiler Collection automates much of the process of turning eBPF source into a kernel object, but much of this (as of 2019-09) requires Python. The BPF object of bcc.py can take raw eBPF text, and return an object which can be easily attached to a variety of eBPF targets.
===LLVM===
===LLVM===
LLVM has enjoyed <tt>bpf</tt> backend support since 3.7. Compile using <tt>-target bpf</tt>. <tt>readelf</tt> on the resulting object ought look like:
LLVM has enjoyed <tt>bpf</tt> backend support since 3.7. Compile using <tt>-target bpf</tt>. <tt>readelf</tt> on the resulting object ought look like: