Can gprof be used to profile a multi-threaded program that uses pthreads? That is, will its output include the time used in all the threads?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, it is possible with the help of a workaround described here.
回答2:
Have you considered pstack? It works fine with multiple threads, and it is good for finding performance problems by the stackshot method. gprof is what it is, but chances are you can do better.