LTTng Toolchain 2.5.0 RC1 Now Available
A new release candidate of the LTTng toolchain is now available.
This release adds multiple fixes and new features detailed below.
LTTng-tools
Save and Load sessions
This introduce two new commands along with API's functions allowing the user to save/load a session to/from an XML file.
lttng save [OPTIONS] [SESSION]
(lttng_save_session_*()
in lttng/save.h
).
lttng load [OPTIONS] [SESSION]
(lttng_load_session*()
in lttng/load.h
).
The XML format of the session file is described in the tarball in
src/common/config/session.xsd
. Note that this adds a new dependency
to libxml2.
User space Perf counter support
With the lttng add-context
command you can now use perf context
perf:thread:*
along with the -u
/--userspace
option.
See --help
for a full list.
Daemon configuration files
A configuration file can be used for each daemon to control their options. Three configuration files are available:
lttng-sessiond.conf
lttng-relayd.conf
lttng-consumerd.conf
These are simple INI format and can be placed in the system-wide
directory /etc/lttng
, ~/$HOME/.lttng/
or user-defined with:
-f --config Load daemon configuration file
User-defined list of kernel probe modules
Thanks to Jan Glauber, it's now possible to load a user-defined list of LTTng probe modules with the new option of the session daemon or by using an environment variable. For instance:
lttng-sessiond --kmod-probes ext4,btrfs,kvm
or
LTTNG_KMOD_PROBES=ext4,btrfs,kvm lttng-sessiond
These are the major features added for this release. A couple of things also have changed that are worth mentioning.
The lttng.h
header file has been split into several components like
event.h
, session.h
, and so on. If you are using lttng.h
directly
in your application, this should not affect you at all because including
lttng.h
also includes every other components.
The deprecated lttng_enable_consumer()
, lttng_disable_consumer()
,
and lttng_health_check()
API functions have been removed for good.
The list
command now prints the log level of JUL events.
Debug logs now have a timestamp (YAMAN!).
LTTng-UST
New tracef()
instrumentation facility
Excerpt from the lttng-ust(3) man page:
USAGE WITH TRACEF
The simplest way to add instrumentation to your code is by far the
tracef() API. To do it, in a nutshell:
1) #include <lttng/tracef.h>
2) /* in your code, use like a printf */
tracef("my message, this integer %d", 1234);
3) Link your program against liblttng-ust.so.
4) Enable UST events when tracing with the following sequence of commands
from lttng-tools:
lttng create
lttng enable-event -u -a
lttng start
[... run your program ...]
lttng stop
lttng view
If you want to have more flexibility and control on the event names,
payload typing, etc, you can continue reading on and use the
tracepoints below. tracef()
is there for quick and dirty ad hoc
instrumentation, whereas tracepoint.h
is meant for thorough
instrumentation of a code base to be integrated with an upstream
project.
LTTng-modules
New and noteworthy:
- State dump of block devices
- State dump of file descriptor flags and modes
- 3.15 Linux kernel support
- v4lv2 instrumentation support
- MIPS32 system call tracing
- New /proc/lttng-logger ABI
Here's how to use the new /proc/lttng-logger
ABI:
From the command line (for instance), start lttng-sessiond
as root
:
sudo lttng-sessiond
Start tracing from root
or from a user belonging to the
tracing
group:
lttng create lttng enable-event --kernel lttng-logger
Write event payload data to /proc/lttng-logger
(from any user,
does not need to be in any group):
echo -n "Some message" > /proc/lttng-logger
Stop tracing, view the trace:
lttng stop lttng view
You should see:
[10:44:24.810273367] (+?.?????????) thinkos lttng_logger: { cpu_id = 3 }, { _msg_length = 12, msg = "Some message" }
It is a quick and easy way to trace some events from user space through
the kernel tracer. It is much more basic than UST: lttng-logger
is
slower (involves system call round-trip to the kernel) and only supports
logging strings. But it's very quick and easy to use, especially from
scripts.
- 2014-05-28 lttng-tools 2.5.0-rc1 (changelog)
- 2014-05-28 lttng-ust 2.5.0-rc1 (changelog)
- 2014-05-28 lttng-modules 2.5.0-rc1 (changelog)
Available in the Download section.