[bootlin/training-materials updates] master: debugging: labs: add missing chown (a4ac3059)

Clément Léger clement.leger at bootlin.com
Tue Jan 31 18:14:14 CET 2023


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

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

commit a4ac3059ac27588224da35841ea79ce6e406da13
Author: Clément Léger <clement.leger at bootlin.com>
Date:   Tue Jan 31 18:14:14 2023 +0100

    debugging: labs: add missing chown
    
    Signed-off-by: Clément Léger <clement.leger at bootlin.com>


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

a4ac3059ac27588224da35841ea79ce6e406da13
 .../debugging-application-crash.tex                        | 11 ++++++++---
 .../debugging-application-profiling.tex                    | 14 +++++++++++++-
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/labs/debugging-application-crash/debugging-application-crash.tex b/labs/debugging-application-crash/debugging-application-crash.tex
index 44e30af7..e99f27f1 100644
--- a/labs/debugging-application-crash/debugging-application-crash.tex
+++ b/labs/debugging-application-crash/debugging-application-crash.tex
@@ -96,11 +96,16 @@ $ ./linked_list
 Segmentation fault (core dumped)
 \end{bashinput}
 
-When crashing, a \code{core} file will be generated. Copy this file from the
-NFS directory on you desktop computer using \code{gdb-multiarch}:
+When crashing, a \code{core} file will be generated. On your desktop computer,
+fix the permissions using:
+\begin{bashinput}
+$ sudo chown <user>:<user> core
+\end{bashinput}
+
+Then, open this file using \code{gdb-multiarch}:
 
 \begin{bashinput}
-$ gdb-multiarch <program_binary> <coredump_file>
+$ gdb-multiarch ./linked_list ./core
 \end{bashinput}
 
 You can then inspect the program state (memory, registers, etc) at the time it
diff --git a/labs/debugging-application-profiling/debugging-application-profiling.tex b/labs/debugging-application-profiling/debugging-application-profiling.tex
index 9667591c..db817ab4 100644
--- a/labs/debugging-application-profiling/debugging-application-profiling.tex
+++ b/labs/debugging-application-profiling/debugging-application-profiling.tex
@@ -67,7 +67,14 @@ $ 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
-generated. Analyze the results with \code{Kcachegrind} in order to understand the
+generated. Once finished, on the host, fix the permissions on the
+\code{callgrind.out.*} file to be able to open it with \code{Kcachegrind}:
+
+\begin{bashinput}
+$ sudo chown <user>:<user> cachegrind.out.*
+\end{bashinput}
+
+Analyze the results with \code{Kcachegrind} in order to understand the
 function that generates most of the D cache miss time. 
 
 Based on that result, modify the program to be more cache efficient. Run again
@@ -79,6 +86,11 @@ We also profile the execution time using callgrind with
 $ valgrind --tool=callgrind ./png_convert tux_small.png out.png
 \end{bashinput}
 
+Again, on the host platform, fix the permissions of the file using:
+\begin{bashinput}
+$ sudo chown <user>:<user> callgrind.out.*
+\end{bashinput}
+
 Again, analyze the results using \code{Kcachegrind}. This time, the view is
 different and allow to display all the call graphs
 




More information about the training-materials-updates mailing list