使用 Activity Monitor/Instruments/Shark 进行采样将显示 Python 解释器的完整 C 函数的堆栈跟踪。如果我能看到相应的 Python 符号名称会很有帮助。有一些 DTrace 魔法可以做到这一点吗? Python 的 cProfile 模块对于分析 Python 调用的各个子树非常有用,但对于了解整个应用程序响应用户事件的情况则不太有用。
答案是“dtrace”,但它无法在足够旧的 Mac 上运行。
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-1/
http://tech.marshallfamily.com.au/archives/python-dtrace-on-os-x-leopard-part-2/ http://tech.marshallfamily.com.au/archives/python-dtrace-on-os-x-leopard-part-2/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)