Report shows “no time accumulated” for gprof using Eclipse CDT

霸气de小男生 提交于 2019-12-23 05:34:09

问题


After compiling with flags: -O0 -p -pg -Wall -c on GCC and -p -pg on the MinGW linker, the eclipse plugin gprof for shows no results. After that I did a cmd call using gprof my.exe gmon.out > prof.txt, which resulted in a report witth only the number of calls to functions.

Flat profile: 
Each sample counts as 0.01 seconds.
no time accumulated

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  Ts/call  Ts/call  name    
  0.00      0.00     0.00    16000     0.00     0.00  vector_norm
  0.00      0.00     0.00       16     0.00     0.00  rbf_kernel
  0.00      0.00     0.00        8     0.00     0.00  lubksb

I've came across this topic: gprof reports no time accumulated. But my program is terminating in a clear maner. Also, gprof view show no data on MingW/Windows, but I am using 32 bits GCC. I have previously tried to use Cygwin, same result.

I am using eclipse Kepler with CDT version 8.3.0.201402142303 and MinGW with GCC 5.4.0.

Any help is appreciated, thank you in advance.


回答1:


Sorry for the question, seems that the code is faster than gprof can measure.

As my application involves a neural network train with several iterations and further testing of kernels, I didn't suspected that a fast code could be causing the problem. I inserted a long loop in the main body and the gprof time was printed.



来源:https://stackoverflow.com/questions/38481261/report-shows-no-time-accumulated-for-gprof-using-eclipse-cdt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!