[bootlin/training-materials updates] master: slides: debugging: add ratelimited variants and kptr_restrict explanations (38ee6911)
Clément Léger
clement.leger at bootlin.com
Fri Feb 3 10:28:09 CET 2023
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/38ee691184e32de30b6b3137785ab129dabc34b4
>---------------------------------------------------------------
commit 38ee691184e32de30b6b3137785ab129dabc34b4
Author: Clément Léger <clement.leger at bootlin.com>
Date: Fri Feb 3 10:26:34 2023 +0100
slides: debugging: add ratelimited variants and kptr_restrict explanations
Signed-off-by: Clément Léger <clement.leger at bootlin.com>
>---------------------------------------------------------------
38ee691184e32de30b6b3137785ab129dabc34b4
common/printk.tex | 51 ++++++++++++++++++++++++++++-----------------------
1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/common/printk.tex b/common/printk.tex
index 24263ff1..4259cf75 100644
--- a/common/printk.tex
+++ b/common/printk.tex
@@ -29,29 +29,6 @@ pr_info("Booting CPU %d\n", cpu);
\begin{frame}[fragile]
\frametitle{Debugging using messages (2/3)}
\begin{itemize}
- \item The kernel defines much more format specifiers than the standard
- \code{printf()} existing ones.
- \begin{itemize}
- % \path of package url directly supports percent characters, unless it is
- % used inside arguments of other macros which is the case of the \code macro
- \item {\codecolor \path{%p}}: Display the hashed value of pointer by default.
- \item {\codecolor \path{%px}}: Always display the address of a pointer (use
- carefully on non-sensitive addresses).
- \item {\codecolor \path{%pK}}: Display hashed pointer value, zeros or the
- pointer address depending on \code{kptr_restrict} sysctl value.
- \item {\codecolor \path{%pOF}}: Device-tree node format specifier.
- \item {\codecolor \path{%pr}}: Resource structure format specifier.
- \item {\codecolor \path{%pa}}: Physical address display (work on all architectures 32/64
- bits)
- \end{itemize}
- \item See \kdochtml{core-api/printk-formats} for an exhaustive list of supported format
- specifiers
- \end{itemize}
-\end{frame}
-
-\begin{frame}[fragile]
- \frametitle{Debugging using messages (3/3)}
- \begin{itemize}
\item The \code{dev_*()} family of functions: \kfunc{dev_emerg},
\kfunc{dev_alert}, \kfunc{dev_crit}, \kfunc{dev_err},
\kfunc{dev_warn}, \kfunc{dev_notice}, \kfunc{dev_info} \\
@@ -72,6 +49,34 @@ dev_info(&pdev->dev, "in probe\n");
[ 25.884873] serial 481a8000.serial: in probe
\end{verbatim}
\end{itemize}
+ \item \code{*_ratelimited()} version exists which limits the amount of print
+ if called too much based on \code{/proc/sys/kernel/printk_ratelimit{_burst}}
+ values
+ \end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{Debugging using messages (3/3)}
+ \begin{itemize}
+ \item The kernel defines much more format specifiers than the standard
+ \code{printf()} existing ones.
+ \begin{itemize}
+ % \path of package url directly supports percent characters, unless it is
+ % used inside arguments of other macros which is the case of the \code macro
+ \item {\codecolor \path{%p}}: Display the hashed value of pointer by default.
+ \item {\codecolor \path{%px}}: Always display the address of a pointer (use
+ carefully on non-sensitive addresses).
+ \item {\codecolor \path{%pK}}: Display hashed pointer value, zeros or the
+ pointer address depending on \code{kptr_restrict} sysctl value.
+ \item {\codecolor \path{%pOF}}: Device-tree node format specifier.
+ \item {\codecolor \path{%pr}}: Resource structure format specifier.
+ \item {\codecolor \path{%pa}}: Physical address display (work on all architectures 32/64
+ bits)
+ \end{itemize}
+ \item \code{/proc/sys/kernel/kptr_restrict} should be set to \code{1} in order
+ to display pointers which uses {\codecolor \path{%pK}}
+ \item See \kdochtml{core-api/printk-formats} for an exhaustive list of supported format
+ specifiers
\end{itemize}
\end{frame}
More information about the training-materials-updates
mailing list