[lttng-dev] New tracef() feature in LTTng-UST

Hollis Blanchard hollis_blanchard at mentor.com
Mon Mar 17 13:28:55 EDT 2014


On 03/14/2014 01:50 PM, Mathieu Desnoyers wrote:
> 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!

I haven't seen vocal support for this yet, so let me just say this is a 
*very* welcome addition. Today, one of the first questions we get from 
our customers is "how do I create new tracepoints in my code?", and 
unfortunately that's almost always a very painful discussion. Having 
this API available would be a big help.

Hollis Blanchard
Product Owner, Sourcery CodeBench <http://go.mentor.com/codebench> and 
Sourcery Analyzer <http://go.mentor.com/sourceryanalyzer>
Mentor Graphics Embedded Software Division

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140317/a30eeeb1/attachment.html>


More information about the lttng-dev mailing list