PythonBPF is a project that enables developers to write eBPF programs in pure Python, essentially allowing you to write code that runs inside your kernel in Python.
We allow a reduced Python grammar to be used for the eBPF-specific parts of code. This allows users to:
- Write both eBPF logic and user-space code in Python (and can be in the same file), so the Python dev-tools apply to the whole file instead of just the non-BPF parts.
- Process eBPF data and visualize it using Python's ecosystem, and interactively develop and debug eBPF programs using Python notebooks.
- Allows quick prototyping of BPF programs, and has a familiar and easy-to-learn syntax.
Feel free to go through the project's README to get an overview of how this is done.
Our goal with this session is to explain how some parts of PythonBPF work, as well as gain insight into what new features that people who might use PythonBPF need.
We’ll briefly discuss what PythonBPF is (for the uninitiated), how it overcomes the shortcomings of other ways of writing eBPF code, and what’s new in PythonBPF since it was last demoed at FOSDEM - loops, custom functions, a better type deduction system and support for more helpers