Linux Format

Using eBPF to monitor filesystems

When we talk about using eBPF for tracing filesystems, we are not dealing with file I/O W (see LXF296) operations but with files as whole entities and filesystem operations. Additionally, for the first time in this series, we are going to develop our own tools using BCC Python and Go. But first, we are going to discuss the way eBPF works in more depth.

More about eBPF

You can consider eBPF a virtual machine located inside the Linux kernel that can execute eBPF commands, which is custom BPF code. It makes the Linux kernel programmable to help you solve real-world problems. Bear in mind that eBPF, like all languages, doesn’t solve problems on its own, it just gives you the tools to solve them. These eBPF programs are executed by the Linux kernel eBPF runtime.

EBPF software can be programmed in BCC, Bpftrace or using LLVM. The LLVM compiler can compile BPF programs into BPF bytecode using a supported programming language, such as C or the LLVM Intermediate Representation. As both ways are difficult to program because of the use of pretty low level code, BCC or Bpftrace make things simpler.

When working with eBPF, begin by thinking like a system administrator, not as a programmer. Put simply, start by

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format5 min read
Install Ubuntu 24.04
Hopefully, by now you’ve managed to create and boot H an Ubuntu installation medium. If not, turn back and follow the instructions in the box forthwith. The first thing you see is a brutalist menu from which you should select the first option (Try Or
Linux Format1 min read
Ultimate Desktop Upgrade!
LXF316 will be on sale Tuesday 28th May 2024 Word processors that can help craft that novel you’ve always been talking about and organise large projects. Revive the old roleplaying system for a digital age as we recreate our own play-by-mail gaming
Linux Format12 min read
Let’s Code Some Demos Like It’s 1990!
Ferenc Deák never throws anything away, which is why he still has all his demoscene files. Sadly, it also means his fridge is a no-go zone. It all started when this author’s beloved retro PC, used to host nostalgic gaming sessions, I suddenly suffer

Related