对PyObjC应用程序进行采样/配置的最好方法是什么? [英] What is the best way to sample/profile a PyObjC application?

查看:178
本文介绍了对PyObjC应用程序进行采样/配置的最好方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Activity Monitor / Instruments / Shark进行抽样将显示包含Python解释器的C函数的堆栈跟踪。我将有助于看到相应的Python符号名称。有没有一些DTrace魔法可以做到这一点? Python的cProfile模块对于剖析Python调用的每个子树都很有用,但对于获取整个应用程序响应用户事件的情况并不是那么有用。

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.

推荐答案

答案是dtrace,但它不会在足够旧的mac上工作。

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 /

这篇关于对PyObjC应用程序进行采样/配置的最好方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆