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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of programs

programs

Photo of pure python

pure python

Photo of eBPF

eBPF

Related news:

News photo

Light Sleep: Waking VMs in 200ms with eBPF and snapshots

News photo

Left to Right Programming

News photo

Show HN: Synchrotron, a real-time DSP engine in pure Python