[bootlin/training-materials updates] master: common: printk: add example of print configuration (4b0f1d40)
Clément Léger
clement.leger at bootlin.com
Fri Nov 25 11:09:58 CET 2022
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/4b0f1d4047da3d6bdf5a9e8e41a5aa2fe70cef44
>---------------------------------------------------------------
commit 4b0f1d4047da3d6bdf5a9e8e41a5aa2fe70cef44
Author: Clément Léger <clement.leger at bootlin.com>
Date: Fri Nov 25 11:09:58 2022 +0100
common: printk: add example of print configuration
Signed-off-by: Clément Léger <clement.leger at bootlin.com>
>---------------------------------------------------------------
4b0f1d4047da3d6bdf5a9e8e41a5aa2fe70cef44
common/printk.tex | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/common/printk.tex b/common/printk.tex
index c79a6faa..93ecf969 100644
--- a/common/printk.tex
+++ b/common/printk.tex
@@ -96,9 +96,30 @@ dev_info(&pdev->dev, "in probe\n");
\end{itemize}
\end{frame}
-
\ifthenelse{\equal{\training}{debugging}}{
- }{}
+\begin{frame}
+ \frametitle{pr\_debug() and dev\_dbg() usage}
+ \begin{itemize}
+ \item Debug prints can be enabled using the
+ \code{/sys/kernel/debug/dynamic_debug/control} file.
+ \begin{itemize}
+ \item \code{cat /sys/kernel/debug/dynamic_debug/control} will display all
+ lines that can be enabled in the kernel
+ \item Example: \code{init/main.c:1427 [main]run_init_process =p " \%s\012"}
+ \end{itemize}
+ \item A syntax allows to enable individual print using lines, files or modules
+ \begin{itemize}
+ \item \code{echo "file drivers/pinctrl/core.c +p" > /sys/kernel/debug/dynamic_debug/control}
+ will enable all debug prints in \code{drivers/pinctrl/core.c}
+ \item \code{echo "module pciehp +p" > /sys/kernel/debug/dynamic_debug/control}
+ will enable the debug print located in the \code{pciehp} module
+ \item \code{echo "line init/main.c:1427 +p" > /sys/kernel/debug/dynamic_debug/control}
+ will enable the debug print located at line 1247 of file \code{init/main.c}
+ \item Replace \code{+p} with \code{-p} to disable the debug print
+ \end{itemize}
+ \end{itemize}
+\end{frame}
+}{}
\ifthenelse{\equal{\training}{linux-kernel}}{
\begin{frame}
More information about the training-materials-updates
mailing list