[lttng-dev] lttng-ust under the hood

Gerlando Falauto gerlando.falauto at keymile.com
Fri May 23 12:09:29 EDT 2014

On 05/23/2014 05:11 PM, Thibault, Daniel wrote:
> ----------------------------------------------------------------------
> Date: Thu, 22 May 2014 18:21:29 +0200
> From: Gerlando Falauto <gerlando.falauto at keymile.com>
>> I'm still struggling to figure out why, depending on how I compile and link my application, I can get either custom tracepoint providers
>> OR tracef() to work, but not both at the same time.
>> Is there any documentation explaining how lttng-ust is roughly supposed to work?
>> (i.e. linking trickeries, libraries needed in LD_PRELOAD, _LGPL_SOURCE, tracepoints, probes and so on...)
>> Gerlando
>     It's all a matter of choice.  Tracepoint providers can be in the app (statically linked in) or dynamically linked to it.  In the latter case, the linking can be mandatory (so the app will fail to launch if it cannot find the tracepoint provider .so) or optional.  With optional linking, failure to find the .so means the app isn't traceable but otherwise runs normally.

Could you elaborate more on this optional linking? Perhaps it's the kind 
of problem I'm running into.

> LD_PRELOAD is generally used to provide the app with the tracepoint provider .so when tracing is desired.

>     Extensive documentation (in PDF) is currently undergoing editorial review, and the plan is to move said documentation to DocBook format so it can be included in the LTTng distribution.

Would it be possible to have a copy of this doc?

>    Since tracef() depends on liblttng-ust just like ordinary UST, I'm not sure which problem you're running into.  Could you give us a simplified makefile that showcases the issue?

#include <lttng/tracef.h>

int main() {
    tracef("Hello world");
    return 0;

gcc main.c -lttlng-ust -ldl -I.

There, I don't get my tracef().
This happens on top of an ELDK 5.4, on top of which I configured & 
compiled one of the latest releases of userspace-rc, lttng-ust, and 

I tried either with native compiling on the target, or with 
cross-compiling. Same result.

Notice how I used the same configure/compile/install script to compile 
on a pristine ch-rooted rootfs on the x86_64 host, and there everything 
works fine.

I suspect my ELDK (so my rootfs) has some spurious LTTNG files (or other 
.so), since it already contains an older version of LTTNG, which confuse 
the linker. I tried rm'ing the existing /usr/lib/{liblttng-*,liburcu*} 
prior to configuring, but still no luck.

Any clue?

Thank you,

More information about the lttng-dev mailing list