gprof reporting all 0.0 seconds

Yang Zhang yanghatespam@gmail.com
Sat Feb 9 19:47:00 GMT 2008


H.J. Lu wrote:
> On Sat, Feb 09, 2008 at 02:08:07PM -0500, Yang Zhang wrote:
>> michael wrote:
>>> Yang Zhang wrote:
>>>> Retrying.
>>>>
>>>> Yang Zhang wrote:
>>>>> The output of gprof for my C++ program has no entries that contain non-0 
>>>>> time:
>>>>>
>>>>>   %   cumulative   self              self     total
>>>>>  time   seconds   seconds    calls  Ts/call  Ts/call  name
>>>>>   0.00      0.00     0.00 20347515     0.00     0.00  __gnu_cxx::__nor..
>>>>>   0.00      0.00     0.00 18191192     0.00     0.00  __gnu_cxx::__nor..
>>>>>   0.00      0.00     0.00 15330884     0.00     0.00  std::strchr(char..
>>>>>   0.00      0.00     0.00 11405520     0.00     0.00  __gnu_cxx::__nor..
>>>>>   0.00      0.00     0.00 10668361     0.00     0.00  __gnu_cxx::__stl..
>>>>>   0.00      0.00     0.00 10173756     0.00     0.00  __gnu_cxx::__nor..
>>>>> ...
>>>>>
>>>>> What's going wrong? The source (it's a simple 1-file program) and 
>>>>> Makefile are available at:
>>>>>
>>>>> http://assorted.svn.sourceforge.net/viewvc/assorted/hash-join/trunk/src/
>>>>>
>>>>> In particular, the build command is:
>>>>>
>>>>> g++ -Wall -lprofiler -lpthread -o hashjoin-pg hashjoin.cc -g -pg
>>>>>
>>>>> Thanks in advance for any help.
>>> Compile it without any optimization and retry.
>>>
>>> Michael
>>>
>> I tried just now. That didn't change anything, sadly.
> 
> How can I reproduce it? I don't have -lprofiler. I got
> 
> bash-3.2$ g++ -Wall -lpthread -o hashjoin-pg hashjoin.cc -g -pg  
> bash-3.2$ ./hashjoin-pg
> hashjoin <ncpus> <movies> <actresses>
> bash-3.2$ 
> 
> H.J.

-lprofile is actually unnecessary for this purpose (it's just the 
google-perftools CPU profiler library). I have removed -lprofile from 
the Makefile.

I have created tiny (1M) data files that are suitable for downloading:

http://people.csail.mit.edu/yang/movie-data/tiny/

Slightly larger ones (100M) are available at:

http://people.csail.mit.edu/yang/movie-data/med/

Then you can run it with `./hashjoin 1 movies.dat actresses.dat`.

Thanks!

Yang



More information about the Binutils mailing list