RousselTMLEARNING

TP · Observability with eBPF: from discovery to expertise

Lab: Troubleshoot a Linux server with bpftrace

What you will learn in this TP
  • Run bpftrace
  • Write one-liners
  • Use the bcc tools
Mode :

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. 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. 2. Run bpftrace

    Why? The container avoids installing packages on a production server.

    Run bpftrace in a privileged container and list the tracepoints related to openat.
  3. 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 example sshd or nginx).
  4. 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 of vfs_read.
  5. 5. The bcc tools

    Why? These tools answer the most common questions in a single command.

    Install bpfcc-tools, run execsnoop in one terminal and execute for i in $(seq 5); do date; done in another. Then run biolatency during 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

  • ⏱ Estimated time : ≈ 40 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

eBPF explained: programs in the Linux kernel to observe without instrumenting

What eBPF is, how a program is verified and then run in the kernel, hook points (kprobes, uprobes...

Diagnosing with bpftrace and the bcc tools

Everyday eBPF diagnostic tools: bpftrace one-liners (system calls, files, latencies), bcc tools (...

Processes, memory and performance: monitoring and troubleshooting a Linux server

Understand and control Linux processes (ps, top, signals, nice, jobs), interpret load, memory and...

Backup, monitoring and troubleshooting of a Linux server

Operate a Linux server day to day: 3-2-1 backup strategy with rsync, tar, LVM snapshots and resti...

Linux server security and hardening

Harden a Linux server: least privilege, updates, secure SSH, firewall, fail2ban, SELinux and AppA...

Linux vs Unix: the complete guide to commands and distributions

Understand the differences between Linux and Unix, explore distributions (server, desktop, lightw...

Linux administration best practices

Checklist for administering Linux servers: accounts and sudo, SSH, updates, systemd services, sto...

Linux system architecture: kernel, boot and directory tree

Understand how a Linux server works: kernel and user space, the UEFI, GRUB, initramfs and systemd...

Networking on Linux: configuration, diagnosis, firewall and SSH

Configure and troubleshoot Linux networking: ip, ss, netplan and NetworkManager, DNS, layered dia...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!