[bootlin/training-materials updates] master: debugging: labs: add perf report command to specify vmlinux and symfs (e6f341b9)

Clément Léger clement.leger at bootlin.com
Wed Nov 23 16:14:15 CET 2022


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

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

commit e6f341b9973a05279009c94c97c8f699166ed84b
Author: Clément Léger <clement.leger at bootlin.com>
Date:   Wed Nov 23 16:14:15 2022 +0100

    debugging: labs: add perf report command to specify vmlinux and symfs
    
    Signed-off-by: Clément Léger <clement.leger at bootlin.com>


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

e6f341b9973a05279009c94c97c8f699166ed84b
 .../debugging-application-profiling.tex               | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/labs/debugging-application-profiling/debugging-application-profiling.tex b/labs/debugging-application-profiling/debugging-application-profiling.tex
index e87f2b5b..89f729b8 100644
--- a/labs/debugging-application-profiling/debugging-application-profiling.tex
+++ b/labs/debugging-application-profiling/debugging-application-profiling.tex
@@ -52,7 +52,7 @@ tools.
 
 In order to profile the application using the \code{callgrind} tool. Our program
 takes two parameters, an input png and an output one. We provided a
-\code{tux.png} which can be used as an input file. First let's compile it using
+\code{tux_small.png} which can be used as an input file. First let's compile it using
 the following commands:
 
 \begin{bashinput}
@@ -63,7 +63,7 @@ $ make
 We are going to profile cache usage using Cachegrind with the following command:
 
 \begin{bashinput}
-$ valgrind --tool=cachegrind ./png_convert tux.png out.png
+$ valgrind --tool=cachegrind ./png_convert tux_small.png out.png
 \end{bashinput}
 
 The execution will take some times and a \code{cachegrind.out.<pid>} will be
@@ -76,7 +76,7 @@ the cachegrind analysis to check that the modifications were actually effective.
 We also profile the execution time using callgrind with 
 
 \begin{bashinput}
-$ valgrind --tool=callgrind ./png_convert tux.png out.png
+$ valgrind --tool=callgrind ./png_convert tux_small.png out.png
 \end{bashinput}
 
 Again, analyze the results using \code{Kcachegrind}. This time, the view is
@@ -96,7 +96,7 @@ system, we will use \code{perf}. First of all, we will record our program
 execution using the \code{perf record} command.
 
 \begin{bashinput}
-$ perf record ./png_convert tux.png out.png
+$ perf record ./png_convert tux_small.png out.png
 \end{bashinput}
 
 Once recorded, a \code{perf.data} file will be generated. This file will
@@ -108,9 +108,16 @@ execution time. In order to compare this output to the valgrind one, we can
 run perf and also record the callgraph using the \code{--call-graph} option.
 
 \begin{bashinput}
-$ perf record --call-graph dwarf ./png_convert tux.png out.png
+$ perf record --call-graph dwarf ./png_convert tux_small.png out.png
 \end{bashinput}
 
 We specify that we want to record the call graph using the DWARF information
 that are contained in ELF file (compiled with \code{-g}). Once recorded, display
-the results with \code{perf report} and compare them with callgrind ones.
\ No newline at end of file
+the results with \code{perf report} and compare them with callgrind ones:
+
+
+\begin{bashinput}
+$ perf report --symfs=/home/<user>/debugging-labs/buildroot/output/staging/
+   -k /home/<user>/debugging-labs/nfsroot/root/vmlinux ./png_convert
+   tux_small.png out.png
+\end{bashinput}
\ No newline at end of file




More information about the training-materials-updates mailing list