diff --git a/labs/debugging-ebpf/debugging-ebpf.tex b/labs/debugging-ebpf/debugging-ebpf.tex index 0898fb8e30..ed8ca4cf76 100644 --- a/labs/debugging-ebpf/debugging-ebpf.tex +++ b/labs/debugging-ebpf/debugging-ebpf.tex @@ -81,7 +81,7 @@ \section{libbpf} \end{itemize} \item You will first need to generate the vmlinux header used in the eBPF program. You can use bpftool to do so: \begin{bashinput} -$ bpftool btf dump file /home//debugging-labs/buildroot/output/linux-6.6.21/vmlinux format c > vmlinux.h +$ bpftool btf dump file /home//debugging-labs/buildroot/output/linux-6.6/vmlinux format c > vmlinux.h \end{bashinput} \item Next you need to build your eBPF program into a loadable object: \begin{bashinput} @@ -124,7 +124,7 @@ \section{Improving our program} Now that we have a working base for our custom tracing tool, we will improve it to make it more useful. -In the labs directory, go to \path{ebpf/libbpf_advanced}. Copy the \path{trace_programs.c} and \path{trace_programs.bpf.c} from the previous part in this directory, as you will iterate on it. The directory provides a makefile which automates all build steps performed manually earlier. To use this makefile, make sure to have your \code{CROSS_COMPILE} variable properly set, as well as a \code{KDIR} variable pointing to \path{/home//debugging-labs/buildroot/output/build/linux-6.6.21} (needed to generate the \path{vmlinux.h} header) +In the labs directory, go to \path{ebpf/libbpf_advanced}. Copy the \path{trace_programs.c} and \path{trace_programs.bpf.c} from the previous part in this directory, as you will iterate on it. The directory provides a makefile which automates all build steps performed manually earlier. To use this makefile, make sure to have your \code{CROSS_COMPILE} variable properly set, as well as a \code{KDIR} variable pointing to \path{/home//debugging-labs/buildroot/output/build/linux-6.6} (needed to generate the \path{vmlinux.h} header) Having to open ftrace to display the logs is cumbersome, we would like to get the trace directly in the console in which we have started the tool. We will use the opportunity to switch our program output from a log line in ftrace to events pushed in a \href{https://docs.kernel.org/6.6/bpf/ringbuf.html}{perf ring buffer}. A perf ring buffer is a kind of map which can be used in eBPF programs to stream data to userspace in a very efficient way. To use a perf ring buffer, perform the following steps: \begin{itemize}