I am trying to profile some C ++ code compiled with g ++, including the -pg option, with gprof. However, despite the fact that the program takes 10-15 minutes to work on my computer (with a maximum maximum of CPU), the% time, cumulative seconds and own seconds columns of the table created by gprof are only 0.00 s! The call column contains the correct data, for example, more than 150,000 calls to the base function. Here is an example of the data collected:
% cumulative self self total time seconds seconds calls Ts/call Ts/call name 0.00 0.00 0.00 156012 0.00 0.00 perm::operator[](int) const 0.00 0.00 0.00 153476 0.00 0.00 perm::perm(void)
The program does not use strings, and the only #include is iostream (used only to output the final answer), so it cannot be slow due to string finds and comparisons or other similar slow external functions, as suggested in this question: could not be accumulated time using gprof - gnu profiler
The program itself crashes, and I have no reason to believe that the profile data is not written correctly (as suggested here: gprof reports that time does not accumulate )
As all of this is done in Windows 7, trying to use Shark or Valgrind is not an option.
Is there a reason why each function records 0.00s?
source share