Menu

eBPF Tutorial by Example 3: Monitoring unlink System Calls with fentry
📰

eBPF Tutorial by Example 3: Monitoring unlink System Calls with fentry

DEV Community: tutorial·云微·about 13 hours ago
#2HOsjQGF
#devtotutorial#devto#dev#include#kernel
Reading 0:00
15s threshold

eBPF (Extended Berkeley Packet Filter) is a powerful network and performance analysis tool on the Linux kernel. It allows developers to dynamically load, update, and execute user-defined code at runtime in the kernel.

This article is the third part of the eBPF Tutorial by Example, focusing on capturing unlink system calls using fentry in eBPF.

What is fentry and Why Use It?

fentry (function entry) and fexit (function exit) are the modern way to trace kernel functions in eBPF. They were introduced in kernel 5.5 for x86 processors and 6.0 for ARM processors. Think of them as the faster, more efficient successors to kprobes.

The big advantage of fentry/fexit over kprobes is performance and convenience. With fentry, you can directly access function parameters just like in regular C code - no need for special helpers like BPF_CORE_READ . This makes your code simpler and faster.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.