[bootlin/training-materials updates] master: debugging: add information on module compilation (cadeab0b)

Clément Léger clement.leger at bootlin.com
Thu Nov 24 15:33:37 CET 2022


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/cadeab0b0f17b27b5fa861f24fa320fb53343818

>---------------------------------------------------------------

commit cadeab0b0f17b27b5fa861f24fa320fb53343818
Author: Clément Léger <clement.leger at bootlin.com>
Date:   Thu Nov 24 15:33:37 2022 +0100

    debugging: add information on module compilation
    
    Signed-off-by: Clément Léger <clement.leger at bootlin.com>


>---------------------------------------------------------------

cadeab0b0f17b27b5fa861f24fa320fb53343818
 .../debugging-kernel-debugging.tex                    | 19 ++++++++++++++++++-
 .../debugging-system-wide-profiling.tex               |  1 -
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex b/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex
index 9993052f..5c297e74 100644
--- a/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex
+++ b/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex
@@ -13,6 +13,16 @@
 \section{Locking problems}
 
 \kconfig{CONFIG_PROVE_LOCKING} has been enabled in the provided kernel image.
+First, compile the module using the following command line:
+
+\begin{bashinput}
+$ cd /home/<user>/debugging-labs/nfsroot/root/locking
+$ export CROSS_COMPILE=/home/<user>/debugging-labs/buildroot/output/host/bin/arm-linux-
+$ export ARCH=arm
+$ export KDIR=/home/<user>/debugging-labs/buildroot/output/build/linux-5.13/
+$ make
+\end{bashinput}
+
 Load the \code{locking.ko} module and look at the output in dmesg. Once
 analyzed, unload the module. Try to understand and fix all the problems that
 have been reported by the \code{lockdep} system.
@@ -30,8 +40,15 @@ STM32MP> <existing bootargs> kmemleak=on
 STM32MP> boot
 \end{bashinput}
 
+Then compile the kmemleak test module:
+
+\begin{bashinput}
+$ cd /home/<user>/debugging-labs/nfsroot/root/kmemleak
+$ make
+\end{bashinput}
+
 Once done, use the \code{boot} command to actually boot the kernel. Once booted,
-load the \code{leaky_module.ko} and trigger an immediate kmemleak scan using:
+load the \code{kmemleak_test.ko} and trigger an immediate kmemleak scan using:
 
 \begin{bashinput}
 # echo scan > /sys/kernel/module/kmemleak
diff --git a/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex b/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
index 61b84fff..c122092a 100644
--- a/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
+++ b/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
@@ -176,7 +176,6 @@ $ perf report --symfs=/home/<user>/debugging-labs/buildroot/output/staging/
   -k /home/<user>/debugging-labs/nfsroot/root/vmlinux
 \end{bashinput}
 
-
 Another useful tool for performance analysis is flamegraphs. Latest perf
 version includes a builtin support for flamegraphs but the template is not
 available on debian so we will use another support provided by Brendan Gregg




More information about the training-materials-updates mailing list