Using gprof with pthreads

强颜欢笑 提交于 2019-11-30 13:29:58

问题


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.



来源:https://stackoverflow.com/questions/922475/using-gprof-with-pthreads

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