[bootlin/training-materials updates] master: debugging: labs: lttng: add more information about trace-compass usage (7327799e)

Clément Léger clement.leger at bootlin.com
Fri Nov 25 11:23:32 CET 2022

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


commit 7327799e98b6f5bce85800ce671cf799afaf9115
Author: Clément Léger <clement.leger at bootlin.com>
Date:   Fri Nov 25 11:23:32 2022 +0100

    debugging: labs: lttng: add more information about trace-compass usage
    Signed-off-by: Clément Léger <clement.leger at bootlin.com>


 .../debugging-system-wide-profiling.tex            | 40 ++++++++++++++++++----
 1 file changed, 34 insertions(+), 6 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 c122092a..0aa283e5 100644
--- a/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
+++ b/labs/debugging-system-wide-profiling/debugging-system-wide-profiling.tex
@@ -118,11 +118,19 @@ $ $(CROSS_COMPILE)-gcc -I. crc_random-tp.c crc_random.c  -llttng-ust -o crc_rand
 Finally, on the target, enable the program tracepoints, run it and collect
+tracepoints. We are going to do that remotely using the \code{lttng-relayd} tool
+on the remote computer:
+$ sudo apt install lttng-tools
+$ lttng-relayd --output=$PWD/traces
+Then on the target, start the trace acquisition using:
 $ lttng-sessiond --daemonize
-$ lttng create crc_session
+$ lttng create crc_session --set-url=net://
 $ lttng enable-event --userspace crc_random:compute_crc_entry
 $ lttng enable-event --userspace crc_random:compute_crc_exit
 $ lttng enable-event --kernel sched_switch
@@ -131,11 +139,17 @@ $ ./crc_random
 $ lttng destroy
-Using \code{babeltrace2}, analyze the traces and see the time that is spent
-between the tracepoints.
+Once finished, the traces will be visible in \code{$PWD/traces/<hostname>/<session>}
+on the remtoe computer. In our case, the hostname is buildroot so traces will be
+located in \code{$PWD/traces/buildroot/<session>}
-In order to analyze our traces, we are going to use tracecompass. Download
-\code{tracecompass} latest version and extract it using:
+Using \code{babeltrace2}, you can display the raw traces that were acquired:
+$ babeltrace2 $PWD/traces/buildroot/<session>/
+In order to analyze our traces more visually, we are going to use tracecompass.
+Download \code{tracecompass} latest version and extract it using:
 $ wget https://ftp.fau.de/eclipse/tracecompass/releases/8.1.0/rcp/trace-compass-8.1.0-20220919-0815-linux.gtk.x86_64.tar.gz
@@ -148,6 +162,20 @@ $ cd trace-compass*
 $ ./tracecompass
+We are going to merge the kernel and the user traces in tracecompass./ To do so,
+open the traces using the \code{File -> Open Trace...} menu and open the traces
+by loading both the \code{kernel} (\code{kernel/channel0_0}) and the \code{ust}
+(\code{ust/uid/0/32-bit/channel0_0}) folders.
+Once opened, in the left pane, expand the \code{Tracing} item and right click
+on \code{Experiments[0]}. Select \code{New}, name the new experiment
+\code{debugging_lab}. Then expand the \code{Experiments[1]} item and right click on
+the \code{debugging_lab} one and click on \code{Select traces...}, In the new
+window, check the 32-bit box and the kernel one, then click on \code{Finish}.
+Finally, double click on the \code{debugging_lab[2]} item to display the merged
+trace. Explore the interface, and try to follow the task execution on both the
+Resources view and in the Control flow one.
 \section{System profiling with {\em perf}}
 In order to profile the whole system, we are going to use perf and try to find

More information about the training-materials-updates mailing list