[lttng-dev] Using LLTNG within shared library (not dlopen-ed).
qyron.private at gmail.com
Mon Aug 10 16:18:44 EDT 2015
Thank you for quick answer! I studied that thread but I see that it refers
to well-known "dlclose" problem: trace provider as part of dlclose-ed .so
is unloaded before lttng-ust is unloaded which leads to segfault.
But in my case both .so containing tracepoints (and trace provider) and
lttng-ust are linked to application at link-time. So both are supposed load
before application starts and unload after it ends.
Also, it would be very inconvenient for me to put trace provider into
separate ".so" for some reasons.
On Mon, Aug 10, 2015 at 10:52 PM, Philippe Proulx <eeppeliteloop at gmail.com>
> On Mon, Aug 10, 2015 at 1:27 PM, Sergei Dyshel <qyron.private at gmail.com>
> > Hi all,
> > I have some code using traces compiled as shared object (together with
> > provider).
> > This ".so" is linked to main code during compile-time.
> > When I run main application and try to read traces after that I get
> > about corrupted trace file.
> > I've read docs about dynamical linking of trace provider which recommends
> > compiling trace provider into separate .so and using LD_PRELOAD to
> > it. But that is only needed for shared objects loaded with "dlopen". In
> > case "dlclose" isn't called and shared object is unloaded on the exit
> > after all traces produced).
> > So this shouldn't be a problem... Am I right?
> Hello there,
> See if this thread helps:
> I'm not the author of LTTng-UST and I do not have a comprehensive
> of its inner mechanics, but I believe that it's good practice to always use
> LD_PRELOAD with a tracepoint provider that is not statically linked with
> > --
> > Regards,
> > Sergei Dyshel
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev at lists.lttng.org
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lttng-dev