Repolode
eunomia-bpf

eunomia-bpf/bpf-developer-tutorial

A step-by-step eBPF tutorial with short, runnable examples in C, Go and Rust, built mainly on libbpf and CO-RE.

Stars
4,333
Forks
607
Open issues
25
Last commit
2 days ago

What is it?

This project is a hands-on eBPF development tutorial that moves from basic concepts to advanced topics. Each directory is an independent eBPF tool example, many only about twenty lines of code, so developers can see how a specific program is written and loaded.

The examples use CO-RE (Compile Once, Run Everywhere) and are built mainly on libbpf, with some lessons using eunomia-bpf, Cilium's eBPF library, libbpf-rs and other frameworks, in C, Go and Rust. Topics cover observability (kprobes, uprobes, tracepoints, scheduling latency, memory leaks), networking (XDP, tc, TCX, sockops, load balancing), security (LSM hooks, syscall argument changes) and GPU or scheduler work.

The repository also provides starter templates for C/libbpf, Go, Rust and eunomia-bpf projects, including Makefiles, Dockerfiles and GitHub Actions setup.

Key features

  • 01Lessons progress from simple kprobe and tracepoint programs to XDP, LSM and GPU tracing.
  • 02Examples are written in C with libbpf and CO-RE, with Go and Rust variants in some lessons.
  • 03Each lesson is a self-contained directory with its own build instructions.
  • 04Starter templates provide Makefile, Dockerfile and CI setup for new eBPF projects.
  • 05Includes a compatibility matrix for checking kernel and toolchain support.

Use cases

  • Learning eBPF development step by step from a first hello-world program.
  • Finding a working example of a specific hook such as uprobe, XDP or LSM to adapt.
  • Bootstrapping a new libbpf, Go or Rust eBPF project from a template.
  • Studying how to trace user-space programs like Nginx, MySQL or Go routines with eBPF.

Quick start

  1. 1

    Clone the repository

    git clone https://github.com/eunomia-bpf/bpf-developer-tutorial.git
  2. 2

    Enter the project directory and sync submodules

    cd bpf-developer-tutorial && git submodule update --init --recursive
  3. 3

    Follow the build instructions in a lesson directory such as src/11-bootstrap or src/1-helloworld

Things to know

  • Each lesson is a separate example with its own build steps, so there is no single command to build everything.
  • eBPF programs require a Linux kernel with BPF support and typically root or privileged access to run.

In collections

Topics

FAQ

What is bpf-developer-tutorial?
A step-by-step eBPF tutorial with short, runnable examples in C, Go and Rust, built mainly on libbpf and CO-RE. This project is a hands-on eBPF development tutorial that moves from basic concepts to advanced topics. Each directory is an independent eBPF tool example, many only about twenty lines of code, so developers can see how a specific program is written and loaded.
Is bpf-developer-tutorial free to use? What license does it have?
bpf-developer-tutorial is open source under the MIT license. Check the license terms before using it in commercial products.
Is bpf-developer-tutorial still maintained?
Actively maintained. The last commit to bpf-developer-tutorial was on Nov 4, 2026.
What can I use bpf-developer-tutorial for?
Learning eBPF development step by step from a first hello-world program. Finding a working example of a specific hook such as uprobe, XDP or LSM to adapt. Bootstrapping a new libbpf, Go or Rust eBPF project from a template. Studying how to trace user-space programs like Nginx, MySQL or Go routines with eBPF.
How do I install bpf-developer-tutorial?
Clone the repository: git clone https://github.com/eunomia-bpf/bpf-developer-tutorial.git Enter the project directory and sync submodules: cd bpf-developer-tutorial && git submodule update --init --recursive Follow the build instructions in a lesson directory such as src/11-bootstrap or src/1-helloworld
Where can I get bpf-developer-tutorial?
The source code and installation instructions are on GitHub: https://github.com/eunomia-bpf/bpf-developer-tutorial

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects