Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: lars@grandepotatis.se (Lars)
Subject: [lttng-dev] LTTng-UST alternative to LD_PRELOAD
Date: Sun, 17 Jun 2012 17:08:23 +0200	[thread overview]
Message-ID: <1339945703.2599.21.camel@DellE5500> (raw)


Hello,

I have recently started to use LTTng-UST and am using LD_PRELOAD
to make it possilbe to execute instrumented code on systems without
LTTng-UST installed.

To define LD_PRELOAD however affects too much. For instance all
forked processes also get the library loaded. This can be fixed by
removing the library from the LD_PRELOAD variable early in the main
function. This looks odd and required some explaining in comments.

Also, in my case, the instrumented program is started with a "wrapper"
program which I can not alter. This wrapper also gets the library
loaded.

As an alternative to using LD_PRELOAD I would like to use an explicit
function, like;

  int traceload(char const* library_path);

that is called early in main (instead of the LD_PRELOAD environment
manipulation) and loads the library with dlopen if it exists.

I have already tried this (of course) and it almost works already.
The tracepoints becomes visible but I get no trace data written.
So I think a really small modification is needed.

Is anything like this planned?

Or can anybody give me a hint on what is missing?

I checked the mailing list a couple of months back but did not
find anything.

Best Regards,
Lars Ekman





                 reply	other threads:[~2012-06-17 15:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339945703.2599.21.camel@DellE5500 \
    --to=lars@grandepotatis.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox