[lttng-dev] Need Help In trace generation for malloc(), free() calls etc

Abhinav Ranjan abhi.abhinav240 at gmail.com
Wed May 13 00:59:22 EDT 2020


  Hello Sir,
I am Abhinav from India.
*Kindly Ignore the previous email.*
Actually I am very new to the Embedded System Engineering profession. In
fact I have been asked to do an independent project to instrumenting a c
application using  LLTng concept to find/trace calls to malloc(), free()
calls. In fact i tried capturing the same as below steps but didn't
understand why after using LD_PRELOAD also malloc() and free() calls were
not traced. I am not sure whether my app was correct!!

 I followed the steps provided to create executable using -lltng-ust -ldl
2.I executed it as: LD_PRELOAD=liblttng-ust-libc-wrapper.so ./executable
(initially as ./exe arg))
3. Then I followed commands to create , capture the events. and destroyed
it.
4. I used TraceCompass to analyze the trace but it did't show any call
trace to malloc or free.


Corresponding to above steps I am inserting images as below:
[image: 1malloc_app.PNG]
Above is malloc.c (App)
[image: 2malloc_tp.PNG]
[image: 2malloc_tp.PNG]
[image: 4.exectable.PNG]
[image: 5.trace_creation.PNG]

But trace was not showing the malloc call and free call event then
alternatively i did the following:

[image: 6.alternativeto5.PNG]
in different tab the following steps: after trace start i pressed enter in
other tab to execute the app. then used lttng destroy.
[image: 7.creation_trace.PNG].
[image: 8.tracecompass.PNG]

On Wed, 13 May 2020 at 10:10, Abhinav Ranjan <abhi.abhinav240 at gmail.com>
wrote:

> Hello Sir,
> I am Abhinav from India.
> Actually I am very new to the Embedded System Engineering profession. In
> fact I have been asked to do an independent project to instrumenting a c
> application using  LLTng concept to find/trace calls to malloc(), free()
> calls.
>
> 1. I followed the steps provided to create executable using
> -lltng-ust -ldl
> 2.I executed it as: LD_PRELOAD=liblttng-ust-libc-wrapper.so ./executable
> 3. Then I followed commands create , capture the events. and destroyed it.
> 4. I used TraceCompass to analyze the trace but it won't show any calls to
> malloc or free.
>
> Please help i want to trace the malloc(),free() calls in the application.
> Corresponding to above steps I am inserting images as below:
> [image: 1malloc_app.PNG]
> [image: 2malloc_tp.PNG]
> [image: 3malloc-tp_header.PNG]
> [image: 4.exectable.PNG]
> [image: 5.trace_creation.PNG]
>
> But trace was not showing the malloc call and free call event then
> alternatively i did the following:
>
> [image: 6.alternativeto5.PNG]
> [image: 7.creation_trace.PNG]
> [image: 8.tracecompass.PNG]
>
> Thanking You!
>
> Regards,
> Abhinav
> 9482866639
>
>

-- 
Thanking You!

Regards,
Abhinav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1malloc_app.PNG
Type: image/png
Size: 141143 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2malloc_tp.PNG
Type: image/png
Size: 186135 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3malloc-tp_header.PNG
Type: image/png
Size: 188192 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4.exectable.PNG
Type: image/png
Size: 54304 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5.trace_creation.PNG
Type: image/png
Size: 449439 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6.alternativeto5.PNG
Type: image/png
Size: 78162 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7.creation_trace.PNG
Type: image/png
Size: 263011 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0015.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8.tracecompass.PNG
Type: image/png
Size: 263819 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2malloc_tp.PNG
Type: image/png
Size: 28031 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20200513/2cf7eeb1/attachment-0017.png>


More information about the lttng-dev mailing list