Getting started
This is a small guide to get started quickly with LTTng kernel and userspace tracing.
Kernel Tracing
First make sure you have lttng-modules (the kernel modules) and lttng-tools installed.
To list the available kernel events:
# lttng list -k
Before starting, we need to create a session:
# lttng create mysession
Enable some events for this session:
# lttng enable-event sched_switch,sys_open -k
or simply all available events:
# lttng enable-event -a -k
Start the tracing:
# lttng start
By default traces are saved in ~/lttng-traces/mysession-
When you're done:
# lttng stop
# lttng destroy
For a more exhaustive list of available options, see the lttng-tools wiki page.
User-space Tracing
To trace userspace applications, you need lttng-tools compiled with UST support (on by default), which requires the lttng-ust library.
A quick guide to instrument applications with UST is coming soon...
To trace an application instrumented with UST, see the Userspace Tracing section of the lttng-tools wiki page.
Reading a trace
For now, Babeltrace is the only tool that can read LTTng 2.0 traces (in the CTF format). With the default options, it simply reads the CTF trace passed as parameter and outputs the text dump to stdout. You can search in a trace using for example:
$ babeltrace /path/to/trace/dir | grep ...
Work is ongoing to bring CTF support to the graphical trace viewers!
