[bootlin/training-materials updates] master: debugging: slides: mention older addr2line lack of symbol+offset notation (61ef9566)

Luca Ceresoli luca.ceresoli at bootlin.com
Mon Mar 27 10:22:15 CEST 2023


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

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

commit 61ef956625164181688f9c93fd13a9a68a8f3cc9
Author: Luca Ceresoli <luca.ceresoli at bootlin.com>
Date:   Mon Mar 27 10:18:59 2023 +0200

    debugging: slides: mention older addr2line lack of symbol+offset notation
    
    This notation is a recent binutils addition (2.39, August 2022) and Ubuntu
    22.04 does not have it (has 2.38). Clearly document the versions supporting
    it and mention the faddr2line script to obtain the same effect with older
    binutils.
    
    Also split the "Kernel oops debugging" in 2 slides (addr2line and
    decode_stacktraces.sh) to fit the new content.
    
    Reported-by: Clément Léger <clement.leger at bootlin.com>
    Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>


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

61ef956625164181688f9c93fd13a9a68a8f3cc9
 .../debugging-common-tools.tex                     |  7 +++---
 .../debugging-kernel-debugging.tex                 | 26 +++++++++++++++++-----
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/slides/debugging-common-tools/debugging-common-tools.tex b/slides/debugging-common-tools/debugging-common-tools.tex
index 5b917fec..53e5f7ff 100644
--- a/slides/debugging-common-tools/debugging-common-tools.tex
+++ b/slides/debugging-common-tools/debugging-common-tools.tex
@@ -123,10 +123,11 @@ c02c7040 T ksys_read
 $ addr2line -s -f -e vmlinux ffffffff8145a8b0
 queue_wc_show
 blk-sysfs.c:516
-
-$ addr2line -e vmlinux printk+0x10
-/home/training/debugging-labs/buildroot/output/build/linux-5.13/kernel/printk/printk.c:2211
       \end{minted}
+% The following is supported only by recent versions of addr2line, not yet on Ubuntu 22.04
+% TODO add it back later, when switching to Ubuntu 24.04?
+%$ addr2line -e vmlinux printk+0x10
+%/home/training/debugging-labs/buildroot/output/build/linux-5.13/kernel/printk/printk.c:2211
     \end{block}
   \end{itemize}
 \end{frame}
diff --git a/slides/debugging-kernel-debugging/debugging-kernel-debugging.tex b/slides/debugging-kernel-debugging/debugging-kernel-debugging.tex
index 5258fc0f..99ecc604 100644
--- a/slides/debugging-kernel-debugging/debugging-kernel-debugging.tex
+++ b/slides/debugging-kernel-debugging/debugging-kernel-debugging.tex
@@ -112,20 +112,36 @@
 \end{frame}
 
 \begin{frame}
-  \frametitle{Kernel oops debugging}
+  \frametitle{Kernel oops debugging: \code{addr2line}}
   \begin{itemize}
     \item In order to convert addresses/symbol name from this display to source
       code lines, one can use addr2line
+    \begin{itemize}
+      \item \code{addr2line -e vmlinux <address>}
+    \end{itemize}
+    \item GNU binutils >= 2.39 takes the symbol+offset notation too:
     \begin{itemize}
       \item \code{addr2line -e vmlinux <symbol_name>+<off>}
     \end{itemize}
-    \item This decoding can be automated using \code{decode_stacktraces.sh}
-      script which is provided in the kernel sources.
-    \item This script will translate all symbol names/addresses to the matching
-      file/lines and will display the assembly code where the crash did trigger.
+    \item The symbol+offset notation can be used with older binutils
+      versions via the \code{faddr2line} script in the kernel sources:
+    \begin{itemize}
+      \item \code{scripts/faddr2line vmlinux <symbol_name>+<off>}
+    \end{itemize}
     \item The kernel must have been compiled with
       \kconfigval{CONFIG_DEBUG_INFO}{y} to embed the debugging information into
       the vmlinux file.
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Kernel oops debugging: \code{decode_stacktraces.sh}}
+  \begin{itemize}
+    \item \code{addr2line} decoding of oopses can be automated using
+      \code{decode_stacktraces.sh} script which is provided in the kernel
+      sources.
+    \item This script will translate all symbol names/addresses to the matching
+      file/lines and will display the assembly code where the crash did trigger.
     \item \code{./scripts/decode_stacktrace.sh vmlinux linux_source_path/ < oops_report.txt > decoded_oops.txt}
 
     \item NOTE: \code{CROSS_COMPILE} and \code{ARCH} env var should be set to




More information about the training-materials-updates mailing list