[bootlin/training-materials updates] master: labs: debugging: add usage of decode_stacktraces.sh (6dd23c62)

Clément Léger clement.leger at bootlin.com
Fri Feb 3 14:00:23 CET 2023


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

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

commit 6dd23c621d2ecd6615197f52ceded0b167787260
Author: Clément Léger <clement.leger at bootlin.com>
Date:   Fri Feb 3 13:59:42 2023 +0100

    labs: debugging: add usage of decode_stacktraces.sh
    
    Signed-off-by: Clément Léger <clement.leger at bootlin.com>


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

6dd23c621d2ecd6615197f52ceded0b167787260
 .../debugging-kernel-debugging.tex                        | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex b/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex
index cd472eef..eae8528c 100644
--- a/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex
+++ b/labs/debugging-kernel-debugging/debugging-kernel-debugging.tex
@@ -4,7 +4,7 @@
   \begin{itemize}
     \item Debugging a deadlock problem using {\em PROVE\_LOCKING} options.
     \item Find a module memory leak using {\em kmemleak}.
-    \item Analyzing an {\em oops} with {\em addr2line}.
+    \item Analyzing an {\em oops}.
     \item Debugging with {\em KGDB}.
     \item Setting up {\em Kexec \& kdump}.
   \end{itemize}
@@ -130,6 +130,15 @@ $ gdb-multiarch /home/$USER/debugging-labs/buildroot/output/build/linux-5.13/vml
 (gdb) disassemble <function>
 \end{bashinput}
 
+This can also be done automatically using \code{decode_stacktraces.sh}. First,
+copy/paste the OOPS message into the \code{~/debugging-labs/oops.txt} file.
+Then, using the script provided by the kernel, execute the following command:
+
+\begin{bashinput}
+$ cd /home/$USER/debugging-labs/buildroot/output/build/linux-5.13/
+$ ./scripts/decode_stacktraces vmlinux < ~/debugging-labs/oops.txt
+\end{bashinput}
+
 \section{KGDB debugging}
 In order to debug this OOPS, we'll use KGDB which is an in-kernel debugger.
 The provided image already contains the necessary KGDB support and the watchdog
@@ -265,8 +274,8 @@ loading vmlinux
 # loading @0xbf000000: /home/<user>/debugging-labs/nfsroot/root/kgdb_test/kgdb_test.ko
 \end{bashinput}
 
-Finally, add a breakpoint right after the \code{pr_debug()} call continue the
-execution to trigger it.
+Finally, add a breakpoint right after the \code{pr_debug()} call and continue
+the execution to trigger it.
 
 Note: Due to a GDB bug, the execution after the breakpoint will crash. You can
 use a temporary breakpoint using \code{tbreak} command to workaround this




More information about the training-materials-updates mailing list