From 469f038e44efd1a16a88f52356f5cac3294970fa Mon Sep 17 00:00:00 2001
From: Jan Altenberg <jan@linutronix.de>
Date: Tue, 21 Jun 2016 16:25:52 +0200
Subject: How to use perf-ctf and Tracecompass

---
 .../kernel-tracing/pres_kernel-tracing_en.tex      | 69 ++++++++++++++++++++++
 1 file changed, 69 insertions(+)

(limited to 'kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex')

diff --git a/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex b/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex
index 9f19959..859d8c5 100644
--- a/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex
+++ b/kernel-devel/kernel-tracing/pres_kernel-tracing_en.tex
@@ -513,6 +513,75 @@ $ kernelshark -i mytrace.dat
 \end{figure}
 \end{frame}
 
+\section{Tracecompass}
+\begin{frame}[fragile]
+\frametitle{Tracecompass}
+\begin{itemize}
+\item Uses the C ommon T race F ormat
+\item perf can convert traces to CTF
+\item perf uses libbabeltrace for the convertion
+\item A recent version of libbabeltrace is needed
+\end{itemize}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Build perf for your Target}
+\begin{verbatim}
+cd kernel_source/tools/perf
+make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
+# Now copy the perf executable to the target
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Setup the tools on your host: libbabeltrace}
+\begin{verbatim}
+git clone https://github.com/efficios/babeltrace.git
+cd babeltrace
+# This is a known working commit.
+# Recent commits seem to be broken for perf-ctf
+git checkout 9aac8f729c091ddddb688038f5d417a7b1ce4259
+./bootstrap
+./configure
+make
+sudo make install
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Setup the tools on your host: perf}
+\begin{verbatim}
+cd kernel_source/tools/perf
+make LIBBABELTRACE=1 LIBBABELTRACE_DIR=/usr/local
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Record a trace on the target}
+\begin{verbatim}
+./perf record -e 'sched:*' -a
+# (stop with Ctrl-C)
+# Copy perf.data to the host
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{On the host: Convert perf.data to the proper format}
+\begin{verbatim}
+LD_LIBRARY_PATH=/usr/local/lib ./perf data convert --to-ctf ./ctf-data
+# Now the trace data should be available in ctf-data/
+# You can import this directory with Eclipse / Tracecompass
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{Tracecompass}
+\begin{figure}[h]
+\centering
+\includegraphics[width=10cm]{images/tracecompass.png}
+\end{figure}
+\end{frame}
+
 \section{Useful things}
 
 \begin{frame}[fragile]
-- 
cgit v1.2.3

