----- Original Message ----- > From: "Simon Marchi" <[email protected]> > To: "Mathieu Desnoyers" <[email protected]> > Cc: "Olivier Delbeke" <[email protected]>, [email protected] > Sent: Friday, January 16, 2015 3:32:56 PM > Subject: Re: [lttng-dev] Addition of the return address to > liblttng-ust-libc-wrapper > > On 16 January 2015 at 15:13, Mathieu Desnoyers > <[email protected]> wrote: > > > > ________________________________ > > > > From: "Olivier Delbeke" <[email protected]> > > To: [email protected] > > 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). >
Good point! In that case, adding the caller address as tracepoint parameter could make sense indeed. Another approach would be to implement a full stack dump as a context. Thanks, Mathieu > Simon > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
