This library provides Python bindings for libbpf on Linux, making it easier to load eBPF object files. It is designed to be used together with PythonBPF, the eBPF compiler for Python. With these bindings, you can attach eBPF programs to kernel events directly from Python.
All programs written with this are to be run with a sudo
Python interpreter.
Note: This project is under active development and not ready for production use.
- A compiler with C++11 support
- Pip 10+ or CMake >= 4.1
- Ninja or Pip 10+
pip install pylibbpf
Clone this repository and pip install. Note the --recursive
option which is
needed for the pybind11 submodule:
sudo apt install libelf-dev
git clone --recursive https://github.com/varun-r-mallya/pylibbpf.git
pip install .
With the setup.py
file included in this example, the pip install
command will
invoke CMake and build the pybind11 module as specified in CMakeLists.txt
.
The documentation here is still boilerplate.