Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] [PATCH 1/2] Base-address tracing for dlopen and dlclose
Date: Wed, 13 Nov 2013 13:51:30 +0000 (UTC)	[thread overview]
Message-ID: <2094822839.66252.1384350690210.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <528382D0.3030202@mentor.com>



----- Original Message -----
> From: "Paul Woegerer" <Paul_Woegerer@mentor.com>
> To: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
> Cc: lttng-dev at lists.lttng.org
> Sent: Wednesday, November 13, 2013 8:46:56 AM
> Subject: Re: [PATCH 1/2] Base-address tracing for dlopen and dlclose
> 
> Hi Mathieu,
> 
> Thanks for the review.
> Comments see below:
> 
> On 11/13/2013 02:25 PM, Mathieu Desnoyers wrote:
> > ----- Original Message -----
> >> Provide an LD_PRELOAD library to allow tracing of calls to dlopen and
> >> dlclose.  Tracing the lttng-ust internal use of dlopen and dlclose is
> >> prevented.
> > Why do we need to prevent tracing lttng-ust internal use of dlopen/dlclose
> > ?
> 
> I assumed this would be beneficial to have (less noise in  the trace
> data). But if you don't like that we can also leave it out. You will see
> lots of
> 
> ust_baddr:push: { cpu_id = X }, { baddr = 0xXXXXXXXX, sopath =
> "/.../liblttng-ust-tracepoint.so.0.0.0", size = A, mtime = B }
> 
> events in the trace though (I attached a sample to demonstrate this).

I try not to hide anything from the users. If the viewer cares about this, they can always filter out when they read the traces.

Moreover, I'd really like not to modify tracepoint.h if possible for instrumentation ABI compatibility reasons.

> 
> >> +void *dlopen(const char *filename, int flag)
> >> +{
> >> +	void *handle = _lttng_ust_dl_libc_dlopen(filename, flag);
> >> +	if (handle) {
> >> +		struct link_map *p = NULL;
> >> +		if (dlinfo(handle, RTLD_DI_LINKMAP, &p) != -1 && p != NULL
> >> +			&& p->l_addr != 0)
> > Maybe add one extra tab above for readability.
> 
> No problem. I can do that.
> 
> Do you want me to resend the patch without lttng_ust_dlopen/close handling ?

Yes, please,

Thanks!

Mathieu

> 
> --
> Paul
> 
> > Same here.
> >
> > Thanks,
> >
> > Mathieu
> >
> >> +			lttng_ust_baddr_pop((void *) p->l_addr);
> >> +	}
> >> +	return _lttng_ust_dl_libc_dlclose(handle);
> >> +}
> >> +
> >> +static void __attribute__((destructor))
> >> +lttng_ust_baddr_handle_fini(void);
> >> +static void
> >> +lttng_ust_baddr_handle_fini(void)
> >> +{
> >> +	if (__lttng_ust_baddr_handle) {
> >> +		int ret = _lttng_ust_dl_libc_dlclose(__lttng_ust_baddr_handle);
> >> +		if (ret)
> >> +			fprintf(stderr, "%s\n", dlerror());
> >> +	}
> >> +}
> >> --
> >> 1.8.4.2
> >>
> >>
> 
> 
> --
> Paul Woegerer, SW Development Engineer
> Sourcery Analyzer <http://go.mentor.com/sourceryanalyzer>
> Mentor Graphics, Embedded Software Division
> 
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



  reply	other threads:[~2013-11-13 13:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 15:28 [lttng-dev] [PATCH lttng-ust 0/2] Shared object base address tracing Paul Woegerer
2013-11-11 15:28 ` [lttng-dev] [PATCH 1/2] Base-address tracing for dlopen and dlclose Paul Woegerer
2013-11-12 20:10   ` Matthew Khouzam
2013-11-13 13:25   ` Mathieu Desnoyers
2013-11-13 13:46     ` Woegerer, Paul
2013-11-13 13:51       ` Mathieu Desnoyers [this message]
2013-11-11 15:28 ` [lttng-dev] [PATCH 2/2] Implement base-address-state tracing Paul Woegerer
2013-11-13 13:48   ` Mathieu Desnoyers
2013-11-12 19:59 ` [lttng-dev] [PATCH lttng-ust 0/2] Shared object base address tracing Alexandre Montplaisir
2013-11-13 10:00   ` Woegerer, Paul
2013-11-13 13:19     ` Mathieu Desnoyers
2013-11-13 18:09     ` Alexandre Montplaisir

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=2094822839.66252.1384350690210.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    /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