Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Hamed__Gorjiara
Beginner
84 Views

Using Vtune for profiling malloc function

I'm using vtune amplifier 2018 for profiling '_int_malloc' in the 'malloc.c'. However, after getting the advanced hot-spots results, when I want to open the function and see the detailed hotspot info about '_int_malloc', vtune complains about not finding the malloc.c source file (see the image below).

 

I've taken the following approaches but, they weren't successful:

1) I downloaded the source code of glibc-2.23 and I specified the location of malloc.c in the result tab of vtune (see the picture above). After that, I could see the hotspot info on the malloc.c but they didn't match (i.e. the profile data showed it spent 4s on a blank line!! which doesn't make sense)

2) I also tried to add the path of glibc-dbg to the LD_LIBRARY_PATH (Since it has debugging symbols, so I suspect vtune can use it to show the hotspot info on the code) and make vtune use glibc-dbg instead of glibc However, this approach wasn't successful as well.

My question: Did I miss anything in the above approaches? Is there another way to get hotspot info for glibc?

My OS: Ubuntu 16.04

version of libc: ldd (Ubuntu GLIBC 2.23-0ubuntu9) 2.23

0 Kudos
1 Reply
Denis_M_Intel
Employee
84 Views

  According to the picture, VTune was able to read debugging information for your binary module so #2 is not needed. But it looks like the source code you downloaded doesn't match the glibc version used on your system. You can manually recheck it with addr2line Linux utility: addr2line -e <binary_file_path> and then type in any address from the VTune Assembly view ('Address' column) to make sure the source line number reported by addr2line is the same as the source line in VTune views ('Source Line' column). If addr2line and VTune source line numbers are the same, I would suggest double checking versions of glibc binary code and source files.

Reply