gprof reports no time accumulated

后端 未结 7 580
暗喜
暗喜 2020-12-03 13:51

I\'m trying to profile a C++ application with gprof on a machine running OSX 10.5.7. I compile with g++ in the usual way, but using -pg flags, run the application and try to

相关标签:
7条回答
  • 2020-12-03 14:20

    Btw, do you fork() in your code? If so, add this in the child process just after the fork():

    extern void _start (void), etext (void);
    monstartup ((u_long) &_start, (u_long) &etext);
    

    That did the trick for me.

    0 讨论(0)
提交回复
热议问题