[lttng-dev] LTTng-UST new tracelog() feature
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Tue Jun 9 10:42:40 EDT 2015
Hi,
I just pushed a new instrumentation feature into lttng-ust
targeting applications that want to move their existing logging
facilities to LTTng-UST. From the updated lttng-ust(3) manpage:
USAGE WITH TRACELOG
If you want to migrate existing logging (info, errors, ...) to LTTng
UST, you can use the tracelog() interface. To do it, in a nutshell:
1) #include <lttng/tracelog.h>
2) /* in your code, use like a printf, with extra loglevel info. */
tracelog(TRACE_INFO, "Message with integer %d", 1234);
3) Link your program against liblttng-ust.so.
4) Enable UST events when tracing with the following sequence of com‐
mands
from lttng-tools:
lttng create
lttng enable-event -u "lttng_ust_tracelog:*"
lttng start
[... run your program ...]
lttng stop
lttng view
That's it!
You can replace the enable-event line above with a selection of
loglevels, e.g.:
lttng enable-event -u -a --loglevel TRACE_INFO
Which will gather all events from TRACE_INFO and more important
loglevels.
Feedback is welcome!
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list