How eBPF Works
Understanding Hooks, Maps, and the eBPF Architecture.
Imagine your computer’s Operating System is a high-security office building. Inside this building is the Kernel—the staff that manages the locks, the electricity, and the filing cabinets.
For decades, if you wanted to change how the building worked (like adding a new security camera), you had to convince the owners to do a massive renovation, which took years.
eBPF changes that. It is a technology that allows you to run “mini-apps” inside that high-security office safely and instantly, without changing the building’s structure.
eBPF (Extended Berkeley Packet Filter) allows you to execute custom code inside the Linux Kernel. It is often called the “JavaScript for Hardware” because, just as JavaScript allows you to change how a website behaves without redesigning the browser, eBPF lets you change how the system behaves without restarting it.
To understand how eBPF works, you only need to know three things:
| Pillar | Analogy | Technical Role |
|---|---|---|
| Hooks | The “Sensors” | Triggers that wake up your program when an event happens (e.g., a file opens). |
| Maps | The “Notebook” | A shared storage space where the Kernel and your apps can exchange data. |
| Helpers | The “Vending Machine” | A set of safe functions the Kernel provides so you don’t have to do things manually. |
What do people actually use eBPF for?
Understanding Hooks, Maps, and the eBPF Architecture.
What is Kprobes?
What is Uprobes?
What is tracePoints?
What is XDP?