What you will learn in this TP
- Run bpftrace
- Write one-liners
- Use the bcc tools
All steps and instructions are shown. Recommended for this lab: guided
Introduction #
Context. A server “crawls” from time to time and the usual metrics do not explain why. You use eBPF to observe in detail what is going on.
Prerequisites: Linux host (VM or physical machine, kernel 5.8+), root access · Estimated time: 40 min
Your first eBPF diagnostics.Hands-on #
Guided steps, with their solutions.
1. Check the kernel
Why? eBPF depends on kernel features: check them first before looking for a problem elsewhere.
Display the kernel version and check that BTF is available.2. Run bpftrace
Why? The container avoids installing packages on a production server.
Run bpftrace in a privileged container and list the tracepoints related toopenat.3. Who opens which files?
Why? Seeing which files are opened often reveals a configuration file re-read in a loop or a missing file.
Display opened files live, then keep only those of a single process (for examplesshdornginx).4. Count and measure
Why? In-kernel aggregations give a statistical view without flooding the terminal.
Count system calls per process for 10 s, then plot the latency histogram ofvfs_read.5. The bcc tools
Why? These tools answer the most common questions in a single command.
Installbpfcc-tools, runexecsnoopin one terminal and executefor i in $(seq 5); do date; donein another. Then runbiolatencyduring a file copy.
Validate your work
Check that each goal above is reached and that you get the result described in the introduction.
Difficulty level : ●●○○○ (2/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
eBPF best practices for observability
Checklist for adopting eBPF in observability: choosing tools, gradual rollout, agent security, co...
Storage on Linux: disks, partitions, file systems and LVM
Administer Linux storage: lsblk and blkid, GPT partitioning, ext4 and XFS, mounting and /etc/fsta...
Installing Fleet Server and enrolling Elastic Agents
Set up Fleet Server, create a policy, enroll Linux, Windows and Docker agents, understand tokens ...
Installing Bindplane: server, BDOT Collector and OpAMP connection
Install the Bindplane server (Docker Compose, Linux, Kubernetes), connect BDOT collectors via OpA...
Zero-code instrumentation with Grafana Beyla (OpenTelemetry eBPF Instrumentation)
Get RED metrics and HTTP/gRPC traces from any application without changing it: Grafana Beyla and ...
Observing the Kubernetes network with Cilium Hubble
Make a Kubernetes cluster's network flows visible with Cilium Hubble: architecture, the hubble ob...
eBPF in production: security, prerequisites and limits
What to know before deploying eBPF agents: privileges and capabilities, kernel versions, managed ...
The Bash shell and files: navigation, redirections, pipes and text processing
Master the Linux command line: paths, file handling, wildcards, redirections, pipes, searching wi...
Installing Zabbix and monitoring your first host
Install Zabbix with Docker Compose (server, PostgreSQL, web interface), install agent 2 on a Linu...