iOS 上的 GCC 调用图分析(-pg、gprof)可能吗?

发布于 2024-11-30 03:08:31 字数 378 浏览 4 评论 0原文

有没有办法在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文