在 iPhone (iOS) 上通过代码启动/停止 Instruments
我没有看到任何方法可以从代码中开始/停止在 Instruments 中进行分析,这在很多情况下都会扼杀它对我的用处。我是否遗漏了一些东西?有谁知道有什么方法可以做到这一点?
后备方法是自己获取性能数据,无需使用仪器。以前有人尝试过这样做吗?我所说的“性能数据”是指缓存未命中、填充、错过分支等事件的计数。
谢谢!
更新:
我研究了直接从代码操作性能监视器硬件,但是,毫不奇怪,这似乎是不行的。 USEREN,“用户启用寄存器”控制对性能监视器寄存器的访问,但未启用。可能可以使用越狱的手机运行特权或启用用户访问,但这对于一些基本的分析来说是大量的工作......呃。
I don't see any way to start/stop profiling in Instruments from code, which kinda kills its usefulness for me in a large number of situations.. Am I missing something? Does anyone know of a way to do this?
The fallback approach is to grab performance data on my own, without Instruments. Has anyone tried to do this before? By "performance data" I mean counts of events like cache misses, fills, missed branches, etc.
Thanks!
Update:
I looked into operating the performance monitor hw directly from code, but, unsurprisingly, it appears to be a no-go. USEREN, the "user enable register" controls access to perfmon registers but is not enabled. It might be possible to run privileged or enable user access with a jailbroken phone, but that's a lot of work for some basic profiling.. ugh.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论