Skip to contentSkip to conversation

New tracef() feature in LTTng-UST

DISCUSSION Mathieu Desnoyers 1 participant 1 message Mar 14, 2014 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi everyone,

I pushed a new features in LTTng-UST that I'm sure everyone will like.

USAGE WITH TRACEF

The simplest way to add instrumentation to your code is by far the tracef() API. To you 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 the UST event "lttng_ust_tracef:event" when tracing with the following sequence of commands from lttng-tools:

lttng create; lttng enable-event -u "lttng_ust_tracef:event"; lttng start [... run your program ...]
lttng stop; lttng view

That's it!

If you want to have more flexibility and control on the event names, payload typing, etc, you can continue reading on and use the trace‐ points below. "tracef()" is there for quick and dirty ad hoc instrumen‐ tation, whereas tracepoint.h is meant for thorough instrumentation of a code base to be integrated with an upstream project.

Feedback is welcome!

Thanks,

Mathieu

Signature · 8 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev