11–13 Dec 2025
Asia/Tokyo timezone

Python-BPF: Writing eBPF programs in pure Python

Not scheduled
20m
eBPF Track eBPF Track

Speakers

Pragyansh ChaturvediMr Varun Mallya (Indian Institute of Technology, Roorkee)

Description

This talk aims to introduce the audience to Python-BPF, a project that enables developers to write eBPF programs in pure Python. We allow a reduced Python grammar to be used for the eBPF-specific parts of code.

This improves the following things in the eBPF ecosystem

  • Both eBPF logic and userspace code is written 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 (an improvement over BCC).
  • This enables users to process eBPF data and visualize it using
    Python's ecosystem.
  • Allows quick prototyping of BPF programs, and has a familiar and
    easy-to-learn syntax.

.

This project is in its early stages, and work is being actively done to integrate most features required for observability use cases into Python-BPF right now.

PythonBPF currently supports a subset of map types and eBPF helpers; however, this list is expanding every week. Most examples given in the BCC tutorial have been ported to Python-BPF, and in some cases, have been modified slightly (such as using matplotlib and seaborn to create better visualizations than ASCII histograms). Python-BPF can also run on Jupyter notebooks.

Primary authors

Pragyansh Chaturvedi Mr Varun Mallya (Indian Institute of Technology, Roorkee)

Presentation materials

There are no materials yet.