What is the best way to sample/profile a PyObjC application?

只愿长相守 提交于 2019-12-07 05:04:29

问题


Sampling with Activity Monitor/Instruments/Shark will show stack traces full of C functions for the Python interpreter. I would be helpful to see the corresponding Python symbol names. Is there some DTrace magic that can do that? Python's cProfile module can be useful for profiling individual subtrees of Python calls, but not so much for getting a picture of what's going on with the whole application in response to user events.


回答1:


The answer is "dtrace", but it won't work on sufficiently old macs.

http://tech.marshallfamily.com.au/archives/python-dtrace-on-os-x-leopard-part-1/

http://tech.marshallfamily.com.au/archives/python-dtrace-on-os-x-leopard-part-2/



来源:https://stackoverflow.com/questions/157662/what-is-the-best-way-to-sample-profile-a-pyobjc-application

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