Part 1 6 chapters

Tracing the kernel

Observe kernel and syscall activity with kprobes, fentry/fexit, and tracepoints โ€” from file deletes and opens to process lifecycle and signals.

Chapter 7

kprobe + unlink

Your first kprobe โ€” attach to the kernel function behind file deletion, read the calling process's identity, attempt to read the filename argument, and stream per-event records to user space via a ring buffer.

30 minutesRead โ†’
Chapter 8

fentry + unlink

Revisit the unlink target with fentry/fexit โ€” BTF-trampoline probes that are lower overhead than kprobes, give typed argument access, and let fexit read the function's return value, so we can report whether each unlink actually succeeded.

30 minutesRead โ†’
Chapter 9

opensnoop

Trace every file open with stable syscall tracepoints โ€” read tracepoint arguments by offset, learn the user-vs-kernel memory-read distinction, and pair entry and exit to report which process opened which file with what result.

30 minutesRead โ†’
Chapter 10

sigsnoop

A shorter sibling to opensnoop โ€” one tracepoint on the kill syscall to trace which process signals which, with signal-number-to-name mapping done in user space.

15 minutesRead โ†’
Chapter 11

execsnoop

Trace every program launch with its full command line โ€” the new skill is reading argv, an array of user-space string pointers, in a bounded verifier-friendly loop, written straight into the ring-buffer slot.

30 minutesRead โ†’
Chapter 12

exitsnoop

The bookend to execsnoop โ€” trace process termination and exit codes via the exit_group tracepoint, getting the status without touching task_struct, and learn how the exit-code encoding differs from the wait() status.

15 minutesRead โ†’