[bootlin/training-materials updates] master: debugging: labs: fix system wide profiling Makefile (0561b03f)

Alexis Lothoré alexis.lothore at bootlin.com
Thu Aug 3 14:39:03 CEST 2023


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

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

commit 0561b03f270452c7b094981d3427e68fe7528cd8
Author: Alexis Lothoré <alexis.lothore at bootlin.com>
Date:   Thu Aug 3 14:30:48 2023 +0200

    debugging: labs: fix system wide profiling Makefile
    
    Current makefile sample leads to mistakes when used:
    - default target is not the main binary but the LTTNG UST tracepoint
      provider
    - trainees tend to replace the whole Makefile with provided sample, which
      discards the CC export, and then lead to binary being rebuilt for x86
    
    Fix those issues by:
    - setting the main binary goal as first goal
    - re-export CC in provided sample
    
    Signed-off-by: Alexis Lothoré <alexis.lothore at bootlin.com>


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

0561b03f270452c7b094981d3427e68fe7528cd8
 .../debugging-system-wide-profiling.tex                           | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex b/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
index 16ea83cd..b2760f7e 100644
--- a/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
+++ b/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
@@ -117,11 +117,13 @@ new rule and modifying the existing one to generate the tracepoints files using
 \code{lttng-gen-tp}:
 
 \begin{bashinput}
-  crc_random-tp.o: crc_random-tp.tp
-      CC=${CC} lttng-gen-tp $<
+  CC=${CROSS_COMPILE}gcc
 
   crc_random: crc_random.c crc_random-tp.o
-    ${CC} $^ -g3 -I. -llttng-ust -o $@
+      ${CC} $^ -g3 -I. -llttng-ust -o $@
+
+  crc_random-tp.o: crc_random-tp.tp
+      ${CC} lttng-gen-t<
 \end{bashinput}
 
 You can then use the new tracepoints in your program to trace specific points




More information about the training-materials-updates mailing list