iOS 上的 GCC 调用图分析(-pg、gprof)可能吗?
有没有办法在 iOS 上使用 GCC 调用图分析?在 Xcode4 中设置 GENERATE_PROFILING_CODE 在为 iOS 设备构建时似乎没有效果(我也没有看到 -pg 被传递给编译器或链接器),即使它有效果,我将如何访问写入到的 gmon.out 文件iPhone/iPad?
Instrument 的 Time Profiler 仅定期对所有线程进行采样,因此很容易错过快速调用;即使使用尽可能最小的采样间隔。
更新:
我并不是试图这样做来找到性能热点,我需要一个准确的统计数据,即程序运行时哪个函数被调用了多少次;采样需要准确(因此缺少函数调用是不行的)并且它需要对 CPU 友好(与运行没有该分析的代码相比,它不能浪费太多的 CPU 时间)。
Is there a way to use GCC call graph profiling on iOS? Setting GENERATE_PROFILING_CODE in Xcode4 seems to have no effect when building for iOS devices (I also don't see -pg being passed to compiler or linker) and even if it had an effect, how would I access the gmon.out file written to the iPhone/iPad?
The Time Profiler of Instrument only samples all threads at regular intervals and thus can easily miss quick calls; even when using the smallest sampling interval possible.
Update:
And I'm not trying to do that to find a performance hotspot, I need an exact statistic which function has been called how many times while the program ran; the sampling needs to be exact (thus missing functions calls is a no go) and it needs to be CPU friendly (it must not waste too much CPU time compared to running the code without that profiling).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论