`gprof` time spent in particular lines of code

后端 未结 3 1759
鱼传尺愫
鱼传尺愫 2021-02-08 23:38

I\'ve been using the gprof profiler in conjunction with g++.

I have a function in my code which encapsulates several sections of behaviour whic

3条回答
  •  萌比男神i
    2021-02-08 23:58

    If you are using linux, then you can use linux perf instead of gprof, as described here:

    http://code.google.com/p/jrfonseca/wiki/Gprof2Dot#linux_perf

    Typing perf report and selecting a function will allow you to get line-by-line information about where the CPU time is spent inside the function.

提交回复
热议问题