Oracle Working On BPF CO-RE Support For GCC To Easily Run BPF Programs On Any Kernel
Written by Michael Larabel in Linux Kernel on 4 August 2021 at 03:00 PM EDT. 16 Comments
LINUX KERNEL --
Running eBPF kernel programs continues to be increasing popular and used for a variety of use-cases in production environments but one of the challenges is around needing to compile the (e)BPF programs for a given kernel while BPF CO-RE has been working to change that. The LLVM Clang compiler already supports the ability for BPF "Compile Once, Run Everywhere" while now Oracle engineers are working to bring the same level of support to GCC.

BPF CO-RE aims to allow BPF programs to work across kernel versions and not needing to in turn have LLVM/Clang (or GCC) on each system nor the kernel headers for compiling BPF programs on-the-fly with the conventional approach. BPF CO-RE allows for adapting the program at load-time depending upon the kernel with dynamically adjusting for differences in the kernel data structures used. At compile-time additional information on the utilized kernel data structures is recorded so when loading at run-time on a different kernel that ideally the necessary changes can be made automatically.

LLVM Clang supports BPF CO-RE while Oracle's David Faust sent out a set of patches today for bringing up this "Compile Once, Run Everywhere" support for the GNU Compiler Collection's BPF back-end.

The proposed GCC patches for now can be found on the mailing list.

More information on BPF CO-RE in general can be found via this Facebook slide deck and the BPF blog.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week