evilsong / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Why pprof print unresolved symbols,one SO but not another #484

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have written a simple program called "runmain",it "ldopen" a Shared Object 
and exec the SO's function called "main", by this I want to profile the SO's 
"main" with gperftools.

1.env LD_PRELOAD="/data/ravenzhang/perf/libprofiler.so.0.3.0" 
CPUPROFILE="/data/ravenzhang/temp/cpu.prof" CPUPROFILE_FREQUENCY="100000" 
./runmain ./main.so 1
(runmain's 1st para means SO name,2st para means exec times )
pprof --text ./runmain ../temp/cpu.prof  > 1.txt
In 1.txt,I can see it is all right.
903 100.0% 100.0%      903 100.0% longa
0   0.0% 100.0%      903 100.0% __libc_start_main
0   0.0% 100.0%      903 100.0% _start
0   0.0% 100.0%      821  90.9% foo11
0   0.0% 100.0%       82   9.1% foo2
2.but when I changed the SO to another:
env LD_PRELOAD="/data/ravenzhang/perf/libprofiler.so.0.3.0" 
CPUPROFILE="/data/ravenzhang/temp/cpu.prof" CPUPROFILE_FREQUENCY="100000" 
./runmain ./main2.so 1000
pprof --text ./runmain ../temp/cpu.prof  > 1.txt
In 1.txt,I can see many unresolved symbols like this:
0   0.0% 100.0%      208  92.4% 0xf716089b
0   0.0% 100.0%       65  28.9% 0xf71609fc

Is there some good guy can tell me why?

My os: X86_64, runmain and the two SO are all 32-bits.
ps:  I didnot call the "dlclose" in "runmain"'s source code.

Original issue reported on code.google.com by risewin...@gmail.com on 15 Nov 2012 at 1:30

GoogleCodeExporter commented 9 years ago
I got it!
The SO did not have the suffix ".so", and pprof ignore it!!

Original comment by risewin...@gmail.com on 21 Nov 2012 at 10:04

GoogleCodeExporter commented 9 years ago
Great. Glad you figured it out. I'll close this off.

Original comment by chapp...@gmail.com on 11 Mar 2013 at 12:52