[bootlin/training-materials updates] master: Share Valgrind slides between embedded Linux and boot time (fe779e50)

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Oct 29 10:46:42 CEST 2021


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

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

commit fe779e50d4b01ebaaa07b537db4885be55e210dd
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date:   Wed Oct 27 10:25:52 2021 +0200

    Share Valgrind slides between embedded Linux and boot time
    
    + Add Kcachegrind screenshot from the boot-time labs
    
    Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>


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

fe779e50d4b01ebaaa07b537db4885be55e210dd
 common/kcachegrind.png                             | Bin 0 -> 288734 bytes
 common/valgrind.tex                                |  51 +++++++++++++++++++++
 .../boot-time-application.tex                      |   1 +
 .../sysdev-application-development.tex             |  48 +------------------
 4 files changed, 54 insertions(+), 46 deletions(-)

diff --git a/common/kcachegrind.png b/common/kcachegrind.png
new file mode 100644
index 00000000..11a50ba1
Binary files /dev/null and b/common/kcachegrind.png differ
diff --git a/common/valgrind.tex b/common/valgrind.tex
new file mode 100644
index 00000000..3e6fd81d
--- /dev/null
+++ b/common/valgrind.tex
@@ -0,0 +1,51 @@
+\begin{frame}
+  \frametitle{Valgrind (1)}
+  \begin{columns}[T]
+    \column{0.8\textwidth}
+    \url{https://valgrind.org/}
+    \begin{itemize}
+    \item GNU GPL Software suite for debugging and profiling programs.
+    \item Supported platforms: Linux on x86, x86\_64, arm (armv7 only),
+      arm64, mips32, s390, ppc32 and ppc64. Also supported on other
+      operating systems (Android, Darwin, Illumos, Solaris...)
+    \item Can detect many memory management and threading bugs.
+    \item Profiler: provides information helpful to speed up your
+      program and reduce its memory usage.
+    \item The most popular tool for this usage. Even used by projects
+      with hundreds of programmers.
+    \end{itemize}
+    \column{0.2\textwidth}
+    \includegraphics[width=\textwidth]{slides/sysdev-application-development/valgrind1.png}
+  \end{columns}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Valgrind (2)}
+  \begin{columns}[T]
+    \column{0.8\textwidth}
+    \begin{itemize}
+    \item Can be used to run any program, without the need to
+      recompile it.
+    \item Examples\\
+      \small
+      \code{valgrind --leak-check=yes <program>} (leak check mode)\\
+      \code{valgrind --tool=callgrind --dump-instr=yes --simulate-cache=yes --collect-jumps=yes <program>} (profiling mode)
+      \normalsize
+    \item Works by adding its own instrumentation to your code and
+      then running in on its own virtual cpu core. Significantly slows
+      down execution, but still fine for debugging and profiling!
+    \item More details on \url{https://valgrind.org/info/} and
+      \url{https://valgrind.org/docs/manual/manual.html}
+    \item The Valgrind tool suite is easy to add to your root filesystem
+          with Buildroot.
+    \end{itemize}
+    \column{0.2\textwidth}
+    \includegraphics[width=\textwidth]{slides/sysdev-application-development/valgrind2.png}
+  \end{columns}
+\end{frame}
+
+\begin{frame}
+  \frametitle{Kcachegrind - Visualizing Valgrind profiling data}
+    \includegraphics[width=\textwidth]{common/kcachegrind.png}
+    \small Directly run it on Callgrind's output file.
+\end{frame}
diff --git a/slides/boot-time-application/boot-time-application.tex b/slides/boot-time-application/boot-time-application.tex
index a580d78f..7d4ad691 100644
--- a/slides/boot-time-application/boot-time-application.tex
+++ b/slides/boot-time-application/boot-time-application.tex
@@ -25,6 +25,7 @@
 
 \input{../common/strace.tex}
 \input{../common/ltrace.tex}
+\input{../common/valgrind.tex}
 
 \begin{frame}[fragile]
 \frametitle{perf}
diff --git a/slides/sysdev-application-development/sysdev-application-development.tex b/slides/sysdev-application-development/sysdev-application-development.tex
index d2c34bff..83b2050f 100644
--- a/slides/sysdev-application-development/sysdev-application-development.tex
+++ b/slides/sysdev-application-development/sysdev-application-development.tex
@@ -446,55 +446,11 @@
   \end{itemize}
 \end{frame}
 
-\subsection{Memory checkers}
-
-\begin{frame}
-  \frametitle{Valgrind (1)}
-  \begin{columns}[T]
-    \column{0.8\textwidth}
-    \url{https://valgrind.org/}
-    \begin{itemize}
-    \item GNU GPL Software suite for debugging and profiling programs.
-    \item Supported platforms: Linux on x86, x86\_64, arm (armv7 only),
-      arm64, mips32, s390, ppc32 and ppc64. Also supported on other
-      operating systems (Android, Darwin, Illumos, Solaris...)
-    \item Can detect many memory management and threading bugs.
-    \item Profiler: provides information helpful to speed up your
-      program and reduce its memory usage.
-    \item The most popular tool for this usage. Even used by projects
-      with hundreds of programmers.
-    \end{itemize}
-    \column{0.2\textwidth}
-    \includegraphics[width=\textwidth]{slides/sysdev-application-development/valgrind1.png}
-  \end{columns}
-\end{frame}
-
-\begin{frame}
-  \frametitle{Valgrind (2)}
-  \begin{columns}[T]
-    \column{0.8\textwidth}
-    \begin{itemize}
-    \item Can be used to run any program, without the need to
-      recompile it.
-    \item Example usage\\
-      \code{valgrind --leak-check=yes ls -la}
-    \item Works by adding its own instrumentation to your code and
-      then running in on its own virtual cpu core.\\
-      Significantly slows down execution, but still fine for testing!
-    \item More details on \url{https://valgrind.org/info/} and
-      \url{https://valgrind.org/docs/manual/coregrind_core.html}
-    \item The Valgrind tool suite is easy to add to your root filesystem
-          with Buildroot.
-    \end{itemize}
-    \column{0.2\textwidth}
-    \includegraphics[width=\textwidth]{slides/sysdev-application-development/valgrind2.png}
-  \end{columns}
-\end{frame}
-
-\subsection{System analysis}
+\subsection{Profiling}
 
 \input{../common/strace.tex}
 \input{../common/ltrace.tex}
+\input{../common/valgrind.tex}
 
 \setuplabframe
 {App. development and debugging}




More information about the training-materials-updates mailing list