Get the latest tech news
PythonBPF β Writing eBPF Programs in Pure Python
I brag about my newest obsession.
Python-BPF is a published Python library with plans for further development towards production-ready use.You can pip install pythonbpf but itβs certainly not at all production ready and the code is hacky at best with more bugs than I could count. For production environments, eBPF programs are typically written in pure C, compiled by clang into a bpf target object file, and loaded into the kernel with tools like libbpf. Python-BPF uses ctypes to preserve compatibility, employs decorators to separate the BPF program from other Python code, allows intuitive creation of global variables, and defines sections and tracepoints similar to its C counterpart.
Or read this on Hacker News