[lttng-dev] Tracepoints firing without being enabled in LTTng

Trent Piepho tpiepho at impinj.com
Wed Feb 20 14:08:22 EST 2019

On Wed, 2019-02-20 at 13:53 -0500, Jonathan Rajotte-Julien wrote:
> On Wed, Feb 20, 2019 at 01:43:00PM -0500, Mosleh Uddin wrote:
> > Hello,
> > 
> > I see, I was loading the liblttng-ust-fd but not fork. Once loading
> > both of
> > these with LD_PRELOAD everything seems to be working great. Thank
> > you for
> > all your assistance.
> > 
> > I was also wondering, it may be impractical to always load these
> > shared
> > objects because the systems starts the app service on boot. Is
> > there an
> How is it not practical? I fail to see the problem with launching the
> application with LD_PRELOAD set inside the service.

One should be able to add LD_PRELOAD to an Environment line in a
systemd unit file.  But beware, from ld.so docs:

In secure-execution mode, preload pathnames containing slashes are
ignored.  Furthermore, shared objects are preloaded only from the
standard search directories and only if they have set-user-ID mode bit
enabled (which is not typical).

Another way that setting ld_preload can be hard is when the program
that needs it is started by another process that does not need it. 
Like say "mount" will fork and exec "losetup".  How do you set
LD_PRELOAD for just losetup without getting mount too?  Modify the code
of mount to inject an environment variable?  Make a wrapper script
named losetup that sets LD_PRELOAD and runs the real losetup binary?

More information about the lttng-dev mailing list