add private file from gtk : fnmatch.c
[lttv.git] / ltt / branches / poly / doc / user / user_guide / docbook / user_guide.docbook
CommitLineData
b1053af5 1<?xml version="1.0" encoding="UTF-8" ?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "/usr/share/sgml/docbook/dtd/4.3/xdocbook.dtd">
4<!--<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" >-->
5
6<book>
7
8<bookinfo>
9<title>Linux Trace Toolkit Viewer User Guide</title>
10<authorgroup>
11<author>
12<firstname>Mathieu</firstname>
13<surname>Desnoyers</surname>
14</author>
15</authorgroup>
16
17<date>29/11/2004</date>
18<releaseinfo>1.00.01</releaseinfo>
19
20<abstract>
21<para>
22This document describes how to install <application>Linux Trace
23Toolkit Viewer</application> and how to use it.
24
25</para>
26</abstract>
27
28<keywordset>
29<keyword>Linux Trace Toolkit Viewer</keyword>
30<keyword>Linux Trace Toolkit</keyword>
31<keyword>tracing</keyword>
32<keyword>Linux</keyword>
33<keyword>visualization</keyword>
34<keyword>operating system</keyword>
35</keywordset>
36
37</bookinfo>
38
39<chapter>
40<title>Introduction</title>
41<para>
42Linux Trace Toolkit (LTT) is a tracing tool that permits to get all the possible
43execution information from the Linux Kernel. It is based on kernel
44instrumentation and a high-speed relay file system to copy the information from
45the kernel space to the user space.
46</para>
47
48<para>
49Linux Trace Toolkit Viewer (LTTV) is the second generation of visualization
50tool. It is
51based on a trace format (the files where the data is recorded on disk) slightly
52different from LTT. As for now, November 29, 2004, the implementation of the new
53trace format in LTT is still not done, we must use a conversion tool to
54transform the original LTT traces to the new format.
55</para>
56
57<para>
58This document explains all the steps that are necessary in order to record a
59trace with LTT and view it with LTTV.
60</para>
61</chapter>
62
63<chapter>
64<title>Getting started</title>
65
66<sect1 id="install">
67<title>Installing LTTV</title>
68<para>
69First, you must download the latests version of LTTV. You should get it from
70this site : <ulink url="http://ltt.polymtl.ca">ltt.polymtl.ca</ulink>.
71I suggest that you get it from the "Packages" section.
72</para>
73
74<para>
75You need a recent gcc compiler to compile the project. You might want to use gcc
763.2 or newer.
77You will also need some libraries in order to compile it. They are described in
78the README of the LTTV package. These are GTK 2.0, GLIB 2.0, "popt" and Pango 1.0.
79Install them if they are not on your system. Remember that if you use a package
80manager from you favourite Linux distribution, you will need to specifically
81install the librairies'development packages.
82</para>
83
84
85<para>
86Then, you are ready to compile LTTV. Extract and untar the file you previously
87downloaded :
88</para>
89
90<screen>
91<prompt>$</prompt> <userinput>tar -xvzof LinuxTraceToolkitViewer-x.x-dddddddd.tar.bz2</userinput>
92</screen>
93
94<para>
95Then, go to the directory newly created, and type :
96</para>
97
98<screen>
99<prompt>$</prompt> <userinput>./configure</userinput>
100<prompt>$</prompt> <userinput>make</userinput>
101<prompt>#</prompt> <userinput>make install</userinput> (as root)
102</screen>
103
104<para>
105At this point, LTTV is installed in the default directory. You may find the
106lttv executable in /usr/local/bin and the librairies in /usr/local/lib. You will
107also notice the presence of the convert executable in /usr/local/bin. This tool
108will be used later to convert from the Linux Trace Toolkit trace format to the
109LTTV format.
110</para>
111
112<para>
113You are now ready to go to the next step : installing the LTT kernel tracer.
114</para>
115
116
117</sect1>
118
119
120
121<sect1 id="install-tracer">
122<title>Installing LTT kernel tracer</title>
123<para>
124The goal of this guide is not to describe the Linux Trace Toolkit project in
125details, as it is a
126seperate project for now. It just gives pointers to the basic steps you must
127take in order to generate a trace suitable for conversion.
128</para>
129
130<para>
131First, go to the <ulink url="http://ltt.polymtl.ca">ltt.polymtl.ca</ulink>
132website, in the "Patches for the Official LTT" section. Use the latest version
133of patches available. The file name convention used goes like this :
134aaaaaa-x.x--bbbbb-y.y.patch. That means a patch made for aaaaa, release x.x,
135that adds bbbbb, release y.y to it. Notice the presence of the -- sign that
136separates the "from" field from the name of the patch applied. This way, it's
137impossible to be mixed up on the specific sequence of patch application. I
138suggest that you use the "relayfs", "ltt" and then "md" patches. The "md" patch
139adds events useful to LTTV that are not in the official LTT.
140</para>
141
142<para>
143Once you have the patches you need, get the matching Linux kernel version, apply
144the patches on it, configure it, install it, reboot with the new kernel. You then
145have an instrumented kernel ready for tracing. If you have problems during this phase,
146please refer to <ulink
147url="http://www.opersys.com/ltt">www.opersys.com/ltt</ulink>. If you need
148instructions about how to recompile a kernel, see
149<ulink url="http://www.tldp.org/HOWTO/Kernel-HOWTO/">Kernel-HOWTO</ulink>.
150</para>
151
152</sect1>
153
154<sect1 id="install-daemon">
155<title>Installing LTT trace recording daemon</title>
156<para>
157In order to install the LTT trace recording daemon, you should get the latest
158TraceToolkit (or ltt) package from the LTT ftp site.
159Use the link "Official Linux Trace Toolkit Packages" on the
160<ulink url="http://ltt.polymtl.ca">ltt.polymtl.ca</ulink> webpage to access it.
161As of November 30, 2004, the most recent version is 0.9.6-pre3.
162</para>
163<para>
164Then, you should apply the TraceToolkit patches from the LTTV website related
165to the package version. Get them from the "Patches for the Official LTT"
166section.
167</para>
168<para>
169You are now ready to install the daemon in your system. Please refer to the
170documentation in the package for details.
171</para>
172<para>
173You may now use the following command to record a sample 30 seconds trace in
174your current directory. Command line switches are described on the official
175LTT website.
176</para>
177<screen>
178<prompt>#</prompt><userinput>tracedaemon -ts30 sample.out sample.proc (as root) userinput></userinput>
179</screen>
180</sect1>
181
182
183
184<sect1 id="convert">
185<title>Conversion from LTT to LTTV trace format</title>
186<para>
187If you used the default directory for installation, you should find the
188conversion tool in /usr/local/bin/convert. Before using it, some other files are
189necessary. You will find them in
190/usr/local/share/LinuxTraceToolkitViewer/convert/. Those are sysInfo and
191core.xml.
192</para>
193<para>
194sysInfo is a script that get informations about the traced computer. It should
195be invoked like this :
196</para>
197<screen>
198<prompt>$</prompt> <userinput>sh /usr/local/LinuxTraceToolkitViewer/convert/sysInfo</userinput>
199</screen>
200<para>
201It creates a file named sysInfo.out. This file has to be present in the current
202directory where the convert tool will be executed. I suggest that you choose a
203destination directory where will be written converted traces right now, put sysInfo.out in it, at
204use it as current directory for running the convert tool.
205</para>
206<para>
207Once the sysInfo.out file is ready and you have a trace ready for conversion,
208you should invoke convert like the following example. This is for a uniprocessor
209computer. If you whish to get detailed explanation on the parameters, simply
210execute the convert tool without any option. You may also wish to see the
211/usr/local/LinuxTraceToolkitViewer/convert/README file.
212</para>
213<screen>
214<prompt>$</prompt> <userinput>/usr/local/bin/convert sample.proc 1 sample.trace sample.converted</userinput>
215</screen>
216<para>
217You must then copy the core event definition file to the converted trace directory :
218</para>
219<screen>
220<prompt>$</prompt> <userinput>cp /usr/local/share/LinuxTraceToolkitViewer/convert/core.xml sample.converted/</userinput>
221</screen>
222<para>
223You now have a converted trace ready for visualization in LTTV. Congratulations!
224</para>
225
226</sect1>
227
228<sect1 id="running">
229<title>Running the executable with basic libraries</title>
230<para>
231Starting the graphical mode with the basic viewer activated is as simple as :
232</para>
233<screen>
234<prompt>$</prompt> <userinput>lttv -L /usr/local/lib/lttv/plugins -m lttvwindow\
235-m guievents -m guicontrolflow -m guistatistics -t sample.converted/</userinput>
236</screen>
237<para>
238Using the text mode is very simple too. Look in /usr/local/lib/lttv/plugins for
239the list of modules. You may use the --help switch to get basic help on the
240command line parameters of every loaded modules. To simply output the events of
241a trace in a text file, try the textDump module. The batchAnalysis module
242permits to do batch mode analysis (state and statistics calculation ) on a
243trace.
244</para>
245<screen>
246<prompt>$</prompt> <userinput>lttv -L /usr/local/lib/lttv/plugins -m textDump --help</userinput>
247</screen>
248</sect1>
249</chapter>
250
251<chapter>
252<title>Using LTTV graphical interface</title>
253
254<sect1 id="mainwindow">
255<title>LTTV main window</title>
256<para>
257This section describes the main functionnalities that are provided by the LTTV
258GUI and how to use them.
259</para>
260<para>
261By default, when the lttv GUI starts with all the graphical modules loaded,
262it loads the statistics viewer, the control flow viewer, and the detailed event
263list inside a tab. Other viewers can be added later to this tab by interacting
264with the main window. Let's describe the operations available on the window :
265</para>
266<screenshot>
267<mediaobject>
268<imageobject>
269<imagedata srccredit="Mathieu Desnoyers, 2004" fileref="lttv-numbered-5.png"
270format="PNG" align="center"/>
271</imageobject>
272<imageobject>
273<imagedata srccredit="Mathieu Desnoyers, 2004"
274fileref="lttv-numbered-5.eps"
275format="EPS" align="center"/>
276</imageobject>
277<!--<imagedata srccredit="Mathieu Desnoyers, 2004" fileref="lttv-numbered-6.svg"
278format="SVG" align="center" scalefit="1"/>
279</imageobject>-->
280<caption><para>Linux Trace Toolkit Viewer GUI</para></caption>
281</mediaobject>
282</screenshot>
283<orderedlist>
284<listitem>
285<para>
286This toolbar allows you to navigate through the basic functionnalities of LTTV.
287The first button opens a new window and the second one, a new tab. You can leave
288your mouse over the buttons to read the information provided by the tooltips.
289</para>
290</listitem>
291<listitem>
292<para>
293This notebook, containing different tabs, lets you select the "Trace Set" you
294want to interact with. A trace set is an aggregation of traces, synchronised in
295time. You may also want to use one tab per viewer by simply cloning the traceset
296to a new tab. This way, you can have vertically stacked viewers in one tab, as
297well as different viewers, independant from the time interval. Note that once
298the Trace Set cloning is done, each trace set becomes completely independant.
299For Traceset cloning, see the File Menu.
300</para>
301</listitem>
302<listitem>
303<para>
304These buttons let you control the computation in progress on a trace. As
305sometimes the computation may last for a while, you may want to stop it, restart
306it from the beginning or simply to continue from where you stopped. This is
307exactly what those three buttons offer you.
308</para>
309</listitem>
310<listitem>
311<para>
312Buttons on the right side of the last spacer are semantically different from the
313others. While the other buttons at the left side of the bar are built in the
314lttv program and let you operate the basic functionnalities, the buttons at the
315right side let you add a viewer to the active Tab. They belong to the
316viewers themselves. The number of buttons that appears there should directly
317depend on the number of viewer's modules loaded.
318</para>
319</listitem>
320<listitem>
321<para>
322This is a tree representing the multiple statistics available for the current
323traceset. This is shown by the guistatistics viewer.
324</para>
325</listitem>
326<listitem>
327<para>
328This is the Y axis of the guicontrolflow viewer. It shows the process list of
329the traced system. You may notice that it grows : it dynamically adds
330process when they appear in the trace.
331</para>
332</listitem>
333<listitem>
334<para>
335This is a (missing) time bar for the X axis. Maybe will it be used for viewer
336specific buttons eventually. Work in progress.
337</para>
338</listitem>
339<listitem>
340<para>
341The is the current time selected. The concept of current event and current time
342selected is synchronised in a Tab for all the viewers. The control flow viewer
343shows it a vertical white dotted line. You move this marker by clicking on the
344background of the process state graph. This graph shows evolution of each
345process's state through time. The meaning of the colors will be explained later.
346</para>
347</listitem>
348<listitem>
349<para>
350This is the details event list. It shown the detailed information about each
351event of the trace. It is synchronised with the current time and current event,
352so selecting an event changes other viewer's current time and reciprocally.
353</para>
354</listitem>
355<listitem>
356<para>
357You can enter the values of start time and end time you wish to see on the
358screen here. It also supports pasting time as text input, simply by clicking of
359the "Time Frame", "start" or "end:" fields. A valid entry consists of any
360digital input separated by any quantity of non digital characters. For example :
361"I start at 356247.124626 and stop at 724524.453455" would be a valid input
362for the "Time Frame" field.
363</para>
364</listitem>
365<listitem>
366<para>
367This horizontal scrollbar modifies the window of time shown by all the viewers
368in the tab. It is linked with the fields below it (described at number 10 and
36912). Another way to modify the time shown is to use the zoom buttons of the
370toolbar (yes, the ones that looks like magnifying glasses).
371</para>
372</listitem>
373<listitem>
374<para>
375This field works just like the "Time Frame" field. It modifies the current time
376selected by the viewers. For example, changing its value will change the current
377event selected by the detailed events list and the current time selected by the
378control flow viewer.
379</para>
380</listitem>
381</orderedlist>
382</sect1>
383
384<sect1 id="ControlFlowColors">
385<title>Control Flow View Colors</title>
386<screenshot>
387<mediaobject>
388<imageobject>
389<imagedata srccredit="Mathieu Desnoyers, 2004" fileref="lttv-color-list.png"
390format="PNG" align="center"/>
391</imageobject>
392<imageobject>
393<imagedata srccredit="Mathieu Desnoyers, 2004"
394fileref="lttv-color-list.eps"
395format="EPS" align="center"/>
396</imageobject>
397<!--<imagedata srccredit="Mathieu Desnoyers, 2004" fileref="lttv-numbered-6.svg"
398format="SVG" align="center" scalefit="1"/>
399</imageobject>-->
400<caption><para>Control Flow View Color Legend</para></caption>
401</mediaobject>
402</screenshot>
403
404<para>
405Here is a description of the colors used in the control flow view. Each color
406represents a state of the process at a given time.
407</para>
408
409<itemizedlist>
410<listitem>
411<para>
412White : this color is used for process from which state is not known. It may
413happen when you seek quickly at a far time in the trace just after it has been
414launched. At that moment, the precomputed state information is incomplete. The
415"unknown" state is used to identify this. Note that the viewer gets refreshed
416once the precomputation ends.
417</para>
418</listitem>
419<listitem>
420<para>
421Green : This color is only used for process when they are running in user mode.
422That includes execution of all the source code of an executable as well as the
423libraries it uses.
424</para>
425</listitem>
426<listitem>
427<para>
428Pale blue : A process is doing a system call to the kernel, and the mode is
429switched from process limited rights to super user mode. Only code from the
430kernel (including modules) should be run in that state.
431</para>
432</listitem>
433<listitem>
434<para>
435Yellow : The kernel is running a trap that services a fault. The most frequent
436trap is the memory page fault trap : it is called every time a page is missing
437from physical memory.
438</para>
439</listitem>
440<listitem>
441<para>
442Orange : IRQ servicing routine is running. It interrupts the currently running
443process. As the IRQ does not change the currently running process (on some
444architectures it uses the same stack as the process), the IRQ state is shown in
445the state of the process. IRQ can be nested : a higher priority interrupt can
446interrupt a lower priority interrupt.
447</para>
448</listitem>
449<listitem>
450<para>
451Dark red : A process in that state is waiting for an input/output operation to
452complete before it can continue its execution.
453</para>
454</listitem>
455<listitem>
456<para>
457Dark yellow : A process is ready to run, but waiting to get the CPU (a schedule
458in event).
459</para>
460</listitem>
461<listitem>
462<para>
463Dark purple : A process in zombie state. This state happens when a process
464exits and then waits for the parent to wait for it (wait() or waitpid()).
465</para>
466</listitem>
467<listitem>
468<para>
469Dark green : A process has just been created by its parent and is waiting for
470first scheduling.
471</para>
472</listitem>
473<listitem>
474<para>
475Magenta : The process has exited, but still has the control of the CPU. It may
476happend if it has some tasks to do in the exit system call.
477</para>
478</listitem>
479</itemizedlist>
480</sect1>
481</chapter>
482
483<chapter>
484<title>Using LTTV text modules</title>
485<sect1 id="batchAnalysis">
486<title>The batch analysis module</title>
487<para>
488This batch analysis module can be invoked like this :
489</para>
490<screen>
491<prompt>$</prompt> <userinput>lttv -L path/to/lib/plugins -m batchAnalysis\
492-t trace1 -t trace2 ...</userinput>
493</screen>
494<para>
495It permits to call any registered action to perform in batch mode on all the
496trace set, which consists of the traces loaded on the command line. Actions that
497are built in the batchAnalysis module are statistics computation. They can be
498triggered by using the -s (--stats) switch.
499</para>
500<para>
501However, the batchAnalysis module is mostly a backend for every other text
502module that does batch computation over a complete trace set.
503</para>
504</sect1>
505<sect1 id="textDump">
506<title>The text dump module</title>
507<para>
508 The goal of this module is to convert the binary data of the traces into
509a formatted text file.
510</para>
511<para>
512The text dump module is a good example of a usage of the batch analysis module
513backend. In fact, the text dump module depends on it. You don't need to
514explicitly load the batchAnalysis module though, as lttv offers a rich module
515backend that deals with the dependencies, loading the module automatically if
516needed.
517</para>
518<para>
519The text dump module is invoked just like the batchAnalysis module. It adds more
520options that can be specified in argument. You may specify the -o switch for the
521output file name of the text dump. You can enable the output of the field names
522(the identifier of the fields) with the -l switch. The -s switch, for process
523states, is very useful to indicate the state in which the process is when the
524event happens.
525</para>
526<para>
527If you use the --help option on the textDump module, you will see all the detail
528about the switches that can be used to show per cpu statistics and per process
529statistics. You will notice that you can use both the switches for the
530batchAnalysis module and those for textDump. You will also notice that the
531options --process_state (from textDump) and --stats (from batchAnalysis) has the
532same short name "-s". If you choose to invoke this option using the short name,
533it will use the option of the last module loaded just before the -s switch.
534</para>
535<para>
536For exemple, if you load the textDump module with -m textDump, it will first
537load the batchAnalysis module, and then load itself. As it is the last module
538loaded, the -s switch used after it will signify --process_stats. On the other
539hand, if you choose to specify explicitly the loading of both modules like this
540:
541</para>
542<screen>
543<prompt>$</prompt> <userinput>lttv -L path/to/lib/plugins -m batchAnalysis -s\
544-m textDump -s -t trace</userinput>
545</screen>
546<para>
547The first "-s" will invoke batchAnalysis --stats and the second "-s" will invoke
548textDump --process_state. The list of options generated by --help follows the
549order of registration of the options by the modules, therefore the invocation
550order of the modules.
551</para>
552</sect1>
553
554</chapter>
555
556
557</book>
This page took 0.042489 seconds and 4 git commands to generate.