Update the LTTng User Guide
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.help / Linux_Tools_Project / LTTng / User_Guide / Getting-Started.html
1 <?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5 <title>LTTng Plug-in User Guide - Getting Started</title>
6 <link type="text/css" rel="stylesheet" href="../../../book.css"/>
7 </head>
8 <body>
9 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
10 <tr>
11 <th style="width: 100%" align="center" colspan="3">Getting Started</th>
12 </tr>
13 <tr>
14 <td style="width: 20%" align="left">
15 <a href="User-Guide.html" title="LTTng Plug-in User Guide">
16 <img alt="Previous" border="0" src="../../../images/prev.gif"/>
17 </a>
18 </td>
19 <td style="width: 60%" align="center"></td>
20 <td style="width: 20%" align="right">
21 <a href="LTTng-Perspective.html" title="LTTng Perspective">
22 <img alt="Next" border="0" src="../../../images/next.gif"/>
23 </a>
24 </td>
25 </tr>
26 <tr>
27 <td style="width: 20%" align="left" valign="top">LTTng Plug-in User Guide</td>
28 <td style="width: 60%" align="center"></td>
29 <td style="width: 20%" align="right" valign="top">LTTng Perspective</td>
30 </tr>
31 </table><hr/>
32 <h1 id="Getting_Started">Getting Started</h1>
33 <p>The LTTng plug-in for Eclipse is used to visualize and analyze kernel traces produced by the LTTng tracer. Controlling the recording and fetching of an LTTng trace from Eclipse is currently a work in progress therefore,
34 <i>currently the plug-in can only be used to visualize existing LTTng traces</i>. To record your own trace, you will need to install the LTTng kernel patches and the LTTv application (refer to the LTTng
35 <a href="http://lttng.org">site</a> for more information on how to record and fetch traces).
36 </p>
37 <p>If not already installed, you can download and install the LTTng plug-ins from the Eclipse update site (search for LTTng under Linux Tools). </p>
38 <p>The rest of this section provides instructions on how to complete the LTTng for Eclipse installation and verify that it is correct.</p>
39 <ul>
40 <li>
41 <a href="Getting-Started.html#Installing_the_LTTng_parsing_library">Installing the LTTng parsing library</a>
42 </li>
43 <li>
44 <a href="Getting-Started.html#Downloading_Sample_Traces">Downloading Sample Traces</a>
45 </li>
46 <li>
47 <a href="Getting-Started.html#Installation_of_the_LTTng_Agent">Installation of the LTTng Agent</a>
48 </li>
49 <li>
50 <a href="Getting-Started.html#Installation_Verification">Installation Verification</a>
51 </li>
52 </ul>
53 <h2 id="Installing_the_LTTng_parsing_library">Installing the LTTng parsing library</h2>
54 <p>If you are using Ubuntu, you might want to use the LTTng PPA and avoid the detailed library installation. See the instalaltion video at
55 <a href="http://lttng.org/eclipse">http://lttng.org/eclipse</a> for more information.
56 </p>
57 <p>The LTTng plug-in for Eclipse requires the installation of a third-party library,
58 <i>liblttngtrace</i>, that is used to parse the binary LTTng traces. For the first Eclipse release, it was decided not to re-implemented that library in Java but to simply integrate it using JNI. As a consequence,
59 <i>you need to download, compile and install the parsing library</i>.
60 </p>
61 <p>This trace parsing library is not delivered as part of Eclipse (licensing stuff) and has to be downloaded from the LTTng site, compiled and then installed on your Linux system.</p>
62 <p>Currently, the Eclipse plug-in supports the following version of the LTTng trace format: 2.3, 2.5 and 2.6. Depending on which trace version(s) you wish to analyze, you will need to download the appropriate snapshot from the corresponding git repository (pick the "snapshot" link next to the latest commit):</p>
63 <p>
64 <a href="http://git.dorsal.polymtl.ca/?p=liblttngtrace.git;a=shortlog;h=refs/heads/traceformat-2.3">LTTng trace format 2.3 parser</a>
65 <br/>
66
67 <a href="http://git.dorsal.polymtl.ca/?p=liblttngtrace.git;a=shortlog;h=refs/heads/traceformat-2.5">LTTng trace format 2.5 parser</a>
68 <br/>
69
70 <a href="http://git.dorsal.polymtl.ca/?p=liblttngtrace.git;a=shortlog;h=refs/heads/traceformat-2.6">LTTng trace format 2.6 parser</a>
71 <br/>
72 </p>
73 <p>If you wish to stream LTTng traces (format 2.6 only), you will need to install the following library instead:</p>
74 <p>
75 <a href="http://git.dorsal.polymtl.ca/~ybrosseau?p=lttv.git;a=shortlog;h=refs/heads/livetraceread-patch4">LTTng trace format 2.6 parser with live trace read</a>
76 <br/>
77 </p>
78 <p>Build and install the snapshot(s) you downloaded. If you wish to install more than one version of the library, you will have to build them in
79 <i>format version sequence</i> (e.g. build 2.6
80 <i>last</i>). For a plain library installation (in /usr/local/lib), you can execute the following commands for each version you wish to install:
81 </p>
82 <pre>
83 $ cd liblttngtrace-2.n
84 $ ./autogen.sh --with-jni-interface --without-lttv &amp;&amp; make
85 # make install
86 </pre>
87 <p>You will end up with something like this (the
88 <i>loader</i> acts as a factory to pre-analyze the trace and load the correct parser library):
89 </p>
90 <pre>
91 $ ls -l1 /usr/local/lib
92 total 1048
93 -rwxr-xr-x. 1 root root 210300 2010-06-07 11:24 liblttvtraceread-2.5.so
94 -rwxr-xr-x. 1 root root 211052 2010-06-07 11:25 liblttvtraceread-2.6.so
95 -rw-r--r--. 1 root root 316040 2010-06-07 11:25 liblttvtraceread.a
96 -rwxr-xr-x. 1 root root 1175 2010-06-07 11:25 liblttvtraceread.la
97 -rwxr-xr-x. 1 root root 93963 2010-06-07 11:24 liblttvtraceread_loader-2.5.so
98 -rwxr-xr-x. 1 root root 93963 2010-06-07 11:25 liblttvtraceread_loader-2.6.so
99 -rw-r--r--. 1 root root 125442 2010-06-07 11:25 liblttvtraceread_loader.a
100 -rwxr-xr-x. 1 root root 1224 2010-06-07 11:25 liblttvtraceread_loader.la
101 lrwxrwxrwx. 1 root root 30 2010-06-07 11:25 liblttvtraceread_loader.so -&gt; liblttvtraceread_loader-2.6.so
102 lrwxrwxrwx. 1 root root 23 2010-06-07 11:25 liblttvtraceread.so -&gt; liblttvtraceread-2.6.so
103 </pre>
104 <p>A number of configuration options are available to fine tune the library builds:</p>
105 <pre>
106 $ ./configure -- help
107 Usage: ./configure [OPTION]... [VAR=VALUE]...
108
109 To assign environment variables (e.g., CC, CFLAGS...), specify them as
110 VAR=VALUE. See below for descriptions of some of the useful variables.
111
112 Defaults for the options are specified in brackets.
113
114 Configuration:
115 -h, --help display this help and exit
116 --help=short display options specific to this package
117 --help=recursive display the short help of all the included packages
118 -V, --version display version information and exit
119 -q, --quiet, --silent do not print `checking ...' messages
120 ...
121 &lt;more options&gt;
122 </pre>
123 <p>Once the parsing libraries are installed, it is necessary to let Eclipse know where they sit otherwise the LTTng plugin won't be able to parse the traces. You basically have 3 options at this point:</p>
124 <p>a) Eclipse.ini</p>
125 <p>In the eclipse.ini (in the Eclipse folder), add the following line to the VM arguments:</p>
126 <pre>
127 -Djava.library.path=/usr/local/lib
128 </pre>
129 <p>b) LD_LIBRARY_PATH</p>
130 <p>Alternatively, you can specify the libraries location using LD_LIBRARY_PATH on the command line/script when you start your Eclipse.</p>
131 <pre>
132 &gt; LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" ./eclipse
133 </pre>
134 <p>c) Project trace library path</p>
135 <p>If you are customizing your own LTTng parsing libraries, you might have a number of variants sitting on your system and you might want to have the freedom to dynamically associate a parser to a project. The LTTng plugin allows you to do so (see
136 <a href="http://wiki.eclipse.org/index.php/Linux_Tools_Project/LTTng/User_Guide#Project_View">Project View</a>).
137 </p>
138 <p>However, in this case, the RUNPATH of the library loader (liblttvtraceread_loader-X.Y.so) needs to be doctored a little so it can find the actual parsing libraries. This is done using the
139 <i>patchelf</i> utility (available from
140 <a href="http://nixos.org/patchelf.html">here</a>). Note that the library loader has to reside in the same directory as the parsing library (
141 <i>make install</i> takes care of that).
142 </p>
143 <pre>
144 &gt; cd &lt;wherever&gt;
145 &gt; patchelf --set-rpath '.:$ORIGIN' liblttvtraceread_loader-X.Y.so
146 </pre>
147 <p>Alternatively, you can tweak the library's makefile and set the RUNPATH directly.</p>
148 <h2 id="Downloading_Sample_Traces">Downloading Sample Traces</h2>
149 <p>To verify that your installation is functional, you can download sample traces from GitHub. Each trace as its own characteristics and complexity. The size given refers to the size of the trace once "untarred", the actual tar size should be ~10 times smaller. To download a trace: click on the selected trace and then click on the "Downloads" button.</p>
150 <p>The following LTTng traces are provided as samples:</p>
151 <p>
152 <a href="https://github.com/fchouinard/LTTng/blob/master/samples/trace-2.5-15316.tar.gz">trace-2.5-15316 (360K)</a> Very small trace (format 2.5 - 15316 events) made from a single LTTng marker. Recorded with a VirtualBox system with 1 processor.
153 </p>
154 <p>
155 <a href="https://github.com/fchouinard/LTTng/blob/master/samples/trace-2.5-15471.tar.gz">trace-2.5-15471 (365K)</a> Very small trace (format 2.5 - 15471 events) made from a single LTTng marker. Recorded with a VirtualBox system with 1 processor.
156 </p>
157 <p>
158 <a href="https://github.com/fchouinard/LTTng/blob/master/samples/trace-2.6-22K.tar.gz">trace-2.6-22K (1.1M)</a> Small trace (format 2.6 - 22K events).
159 </p>
160 <p>(More sample traces to come)</p>
161 <h2 id="Installation_of_the_LTTng_Agent">Installation of the LTTng Agent</h2>
162 <p>To be able to connect remotely to a host for controlling LTTng traces, an LTTng agent has to be running on the remote system. </p>
163 <p>To download the source code from the relevant git repository, use
164 <b>git clone git://git.dorsal.polymtl.ca/git/lttng-agent.git</b> from a Linux command shell. Then go to directory
165 <b>lttng-agent/manual</b> in the cloned git repository and type
166 <b>make</b>. This will generate the
167 <b>LTTng Agent Manual</b> in HTML format. Please follow the instructions in this manual for the manual installation of the agent.
168 </p>
169 <p>To install an agent on Ubuntu using a PPA package follow the instruction of the web site
170 <a href="https://launchpad.net/~lttng/+archive/ppa">LTTng PPA</a>. However, this version won't always include the latest bugfixes. To get the latest version, the user should download the source code, compile and install the agent manually.
171 </p>
172 <h2 id="Installation_Verification">Installation Verification</h2>
173 <p>Here are the quick steps to verify that your installation is functional. If needed, refer to the
174 <a href="#User_Interface">User Interface</a> section for clarifications.
175 </p>
176 <ul>
177 <li>Start Eclipse</li>
178 <li>Open the LTTng perspective</li>
179 <li>Create an LTTng project
180 <ul>
181 <li>Right-click in the Project view and select "New Project"</li>
182 <li>Enter the name of your project (e.g. "MyLTTngProject")</li>
183 <li>The project will be created. It will contain 2 empty folders: "Traces" and "Experiments"</li>
184 </ul>
185 </li>
186 <li>Import a sample trace
187 <ul>
188 <li>Right-click on the newly created project and select "Import Trace"</li>
189 <li>Navigate to the sample LTTng trace that you want to visualize</li>
190 <li>Note: you have to drill down into the trace directory to import the trace correctly (yes, we know that the Import function needs to be re-written...)</li>
191 <li>The newly imported trace should appear under the Traces folder</li>
192 </ul>
193 </li>
194 <li>Visualize the trace
195 <ul>
196 <li>Expand the Traces folder</li>
197 <li>Double-click on the trace</li>
198 <li>The trace should load and the views be populated</li>
199 </ul>
200 </li>
201 </ul>
202 <p>Refer to
203 <a href="#User_Interface">User Interface</a> for detailed description of the views and their usage.
204 </p><hr/>
205 <table class="navigation" style="width: 100%;" border="0" summary="navigation">
206 <tr>
207 <td style="width: 20%" align="left">
208 <a href="User-Guide.html" title="LTTng Plug-in User Guide">
209 <img alt="Previous" border="0" src="../../../images/prev.gif"/>
210 </a>
211 </td>
212 <td style="width: 60%" align="center">
213 <a href="User-Guide.html" title="LTTng Plug-in User Guide">
214 <img alt="LTTng Plug-in User Guide" border="0" src="../../../images/home.gif"/>
215 </a>
216 </td>
217 <td style="width: 20%" align="right">
218 <a href="LTTng-Perspective.html" title="LTTng Perspective">
219 <img alt="Next" border="0" src="../../../images/next.gif"/>
220 </a>
221 </td>
222 </tr>
223 <tr>
224 <td style="width: 20%" align="left" valign="top">LTTng Plug-in User Guide</td>
225 <td style="width: 60%" align="center"></td>
226 <td style="width: 20%" align="right" valign="top">LTTng Perspective</td>
227 </tr>
228 </table>
229 </body>
230 </html>
This page took 0.037151 seconds and 6 git commands to generate.