All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "lttng-dev@lists.lttng.org" <lttng-dev@lists.lttng.org>
Subject: Re: Addition of the return address to liblttng-ust-libc-wrapper
Date: Fri, 16 Jan 2015 15:32:56 -0500	[thread overview]
Message-ID: <CAFXXi0nzOHHPx+h5vUs-pCe1-zT0T=6jNq6L+EJN6z0Nh-_NMA__25049.468180123$1421440444$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <1127206322.43789.1421439222351.JavaMail.zimbra@efficios.com>

On 16 January 2015 at 15:13, Mathieu Desnoyers
<mathieu.desnoyers@efficios.com> wrote:
>
> ________________________________
>
> From: "Olivier Delbeke" <Olivier.Delbeke@awtce.be>
> To: lttng-dev@lists.lttng.org
> Sent: Tuesday, January 13, 2015 10:50:38 AM
> Subject: [lttng-dev] Addition of the return address to        liblttng-ust-libc-wrapper
>
> Hi guys,
>
>
> I am using liblttng-ust-libc-wrapper to detect memory leaks in my applications.
> In order to identify not only the thread where the unfreed allocations are done, but also the calling function, I extended the liblttng-ust-libc-wrapper to log the "return address" (__builtin_return_address(0)) in addition to the parameters of malloc(). It solves my problem and does not affect Trace Compass.
> Was this the right thing to do ?
>
>
> You should be able to achieve the same thing with the "ip" context, e.g.:
>
> lttng create
> lttng enable-event -u -a
> lttng add-context -u -t ip
> lttng start
> ....
>
> All this dynamically without changing the instrumentation.
>
> Thanks,
>
> Mathieu

I might be wrong, but from what I understand, Olivier's patch recorded
the address of the caller of malloc. Adding the ip context will record
the ip of the location of the tracepoint macro call, which will always
be the same (an address in liblttng-ust-malloc's malloc).

Simon

  parent reply	other threads:[~2015-01-16 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OF7097A1B1.090ABAC2-ONC1257DCC.0053FE7C-C1257DCC.00570880@LocalDomain>
2015-01-16 20:13 ` Addition of the return address to liblttng-ust-libc-wrapper Mathieu Desnoyers
     [not found] ` <1127206322.43789.1421439222351.JavaMail.zimbra@efficios.com>
2015-01-16 20:32   ` Simon Marchi [this message]
     [not found]   ` <CAFXXi0nzOHHPx+h5vUs-pCe1-zT0T=6jNq6L+EJN6z0Nh-_NMA@mail.gmail.com>
2015-01-16 20:37     ` Mathieu Desnoyers
2015-01-16 20:41 ` Mathieu Desnoyers
     [not found] ` <54250547.44000.1421440866572.JavaMail.zimbra@efficios.com>
2015-01-16 20:57   ` Olivier Delbeke
     [not found]   ` <OF208CF361.F3A478C1-ONC1257DD2.00266C5D-C1257DD2.0026BC70@LocalDomain>
2015-01-19 16:48     ` Addition of the return address toliblttng-ust-libc-wrapper Mathieu Desnoyers
     [not found]     ` <1097959140.8621.1421686124960.JavaMail.zimbra@efficios.com>
2015-01-19 17:19       ` Olivier Delbeke
     [not found]       ` <CAO6pHzgetc1HSYvmOzh5u7oMt5LANv1Ttb=qxTdqchspXaGhdg@mail.gmail.com>
2015-01-19 19:15         ` Mathieu Desnoyers
     [not found]         ` <1680663293.9819.1421694937650.JavaMail.zimbra@efficios.com>
2015-01-19 19:28           ` Olivier Delbeke
2015-01-13 15:50 Addition of the return address to liblttng-ust-libc-wrapper Olivier Delbeke

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='CAFXXi0nzOHHPx+h5vUs-pCe1-zT0T=6jNq6L+EJN6z0Nh-_NMA__25049.468180123$1421440444$gmane$org@mail.gmail.com' \
    --to=simon.marchi@polymtl.ca \
    --cc=lttng-dev@lists.lttng.org \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.