tracing-session: add diagrams
[lttng-docs.git] / contents / getting-started / viewing-and-analyzing.md
index 7fd3802fd743386f2943391de9be18cff6e48cc8..a00a81412c812e87889c1c57842ddbff33b01388 100644 (file)
@@ -5,33 +5,22 @@ id: viewing-and-analyzing-your-traces
 This section describes how to visualize the data gathered after tracing
 the Linux kernel or a user space application.
 
 This section describes how to visualize the data gathered after tracing
 the Linux kernel or a user space application.
 
-Many ways exist to read your LTTng traces:
+Many ways exist to read LTTng traces:
 
   * **`babeltrace`** is a command line utility which converts trace formats;
     it supports the format used by LTTng,
     <abbr title="Common Trace Format">CTF</abbr>, as well as a basic
     text output which may be `grep`ed. The `babeltrace` command is
     part of the
 
   * **`babeltrace`** is a command line utility which converts trace formats;
     it supports the format used by LTTng,
     <abbr title="Common Trace Format">CTF</abbr>, as well as a basic
     text output which may be `grep`ed. The `babeltrace` command is
     part of the
-    <a href="http://www.efficios.com/babeltrace" class="ext">Babeltrace</a> project.
-  * Babeltrace also includes a **Python binding** so that you may
+    <a href="http://diamon.org/babeltrace" class="ext">Babeltrace</a> project.
+  * Babeltrace also includes **Python bindings** so that you may
     easily open and read an LTTng trace with your own script, benefiting
     from the power of Python.
     easily open and read an LTTng trace with your own script, benefiting
     from the power of Python.
-  * The **<a href="https://eclipse.org/downloads/packages/eclipse-ide-cc-developers/lunar" class="ext">
-    Eclise IDE for C/C++ Developers</a>**
-    includes the Tracing and Monitoring Framework (TMF) plugin which
-    supports LTTng traces, amongst others.
-  * <a href="http://projects.eclipse.org/projects/tools.tracecompass">Trace Compass</a>
-    is an Eclipse plugin, the TMF plugin mentioned above moved to its own
-    project, used to visualize and analyze various types of traces,
-    including LTTng. It also comes as a standalone application and can be
-    downloaded from
-    <a href="http://secretaire.dorsal.polymtl.ca/~gbastien/TracingRCP/TraceCompass/">here</a>
-    for a daily build of the latest source code. A version containing some
-    experimental features like Virtual Machine analysis and Critical Path
-    analysis is also available
-    <a href="http://secretaire.dorsal.polymtl.ca/~gbastien/TracingRCP/DorsalExperimental/">here</a>.
-
-LTTng trace files are usually recorded in the `~/lttng-traces` directory.
+  * **<a href="http://tracecompass.org/" class="ext">Trace Compass</a>**
+    is an Eclipse plugin used to visualize and analyze various types of
+    traces, including LTTng's. It also comes as a standalone application.
+
+LTTng trace files are recorded in the `~/lttng-traces` directory by default.
 Let's now view the trace and perform a basic analysis using
 `babeltrace`.
 
 Let's now view the trace and perform a basic analysis using
 `babeltrace`.
 
@@ -42,8 +31,8 @@ path to `babeltrace` with no options:
 babeltrace ~/lttng-traces/my-session
 </pre>
 
 babeltrace ~/lttng-traces/my-session
 </pre>
 
-`babeltrace` will find all traces within the given path recursively and
-output all their events, merging them intelligently.
+`babeltrace` finds all traces recursively within the given path and
+prints all their events, merging them in order of time.
 
 Listing all the system calls of a Linux kernel trace with their arguments is
 easy with `babeltrace` and `grep`:
 
 Listing all the system calls of a Linux kernel trace with their arguments is
 easy with `babeltrace` and `grep`:
@@ -55,7 +44,7 @@ babeltrace ~/lttng-traces/my-kernel-session | grep sys_
 Counting events is also straightforward:
 
 <pre class="term">
 Counting events is also straightforward:
 
 <pre class="term">
-babeltrace ~/lttng-traces/my-kernel-session | grep sys_read | wc -l
+babeltrace ~/lttng-traces/my-kernel-session | grep sys_read | wc --lines
 </pre>
 
 The text output of `babeltrace` is useful for isolating events by simple
 </pre>
 
 The text output of `babeltrace` is useful for isolating events by simple
@@ -65,13 +54,13 @@ are not trivial to write using a shell. Moreover, reductions and even the
 most basic computations involving multiple events are virtually impossible
 to implement.
 
 most basic computations involving multiple events are virtually impossible
 to implement.
 
-Fortunately, Babeltrace ships with a Python 3 binding which makes it
+Fortunately, Babeltrace ships with Python 3 bindings which makes it
 really easy to read the events of an LTTng trace sequentially and compute
 the desired information.
 
 really easy to read the events of an LTTng trace sequentially and compute
 the desired information.
 
-Here's a simple example using the Babeltrace Python binding. The following
+Here's a simple example using the Babeltrace Python bindings. The following
 script accepts an LTTng Linux kernel trace path as its first argument and
 script accepts an LTTng Linux kernel trace path as its first argument and
-outputs the short names of the top 5 running processes on CPU 0 during the
+prints the short names of the top 5 running processes on CPU 0 during the
 whole trace:
 
 ~~~ python
 whole trace:
 
 ~~~ python
@@ -135,7 +124,7 @@ def top5proc():
         last_ts = cur_ts
 
     # display top 10
         last_ts = cur_ts
 
     # display top 10
-    for name, ns in exec_times.most_common()[:5]:
+    for name, ns in exec_times.most_common(5):
         s = ns / 1000000000
         print('{:20}{} s'.format(name, s))
 
         s = ns / 1000000000
         print('{:20}{} s'.format(name, s))
 
@@ -152,8 +141,8 @@ python3 top5proc.py ~/lttng-sessions/my-session-.../kernel
 </pre>
 
 Make sure the path you provide is the directory containing actual trace
 </pre>
 
 Make sure the path you provide is the directory containing actual trace
-files (`channel0_0`, `metadata`, etc.): the `babeltrace` utility recurses
-directories, but the Python binding does not.
+files (`channel0_0`, `metadata`, and the rest): the `babeltrace` utility
+recurses directories, but the Python bindings do not.
 
 Here's an example of output:
 
 
 Here's an example of output:
 
This page took 0.025638 seconds and 4 git commands to generate.