Search code examples
linux-kernelbpfbcc-bpf

How to build and deploy BPF BCC C++ apps?


There's plenty of docs for python developers, but as a C++ developer very new to BCC/BPF i'm finding it very difficult to determine where to start in building and deploying BCC-based C++ apps.

Where do i start? I've looked at the examples but they don't give any idea on how to package up a BCC C++ app for deployment on a wide range of Linux distributions.

How do i go about doing this? what issues/concerns are there?


Solution

  • I have been developing a BPF tool in C++ (https://github.com/toru/h2olog), but I think there are few documents about it. I've learned C++ binding from examples/cpp and BPF.h.

    However, I recommend using Python 3 binding for BCC unless you have performance issues on the BPF tools you'll develop. This is because C++ binding is hard to lean (as you are asking), and hard to use metaprogramming (thus we're using code generation).