Profiling with Instruments 编辑

Instruments can be used for memory profiling and for statistical profiling.

Official Apple documentation

Basic Usage

  • Select "Time Profiler" from the "Choose a profiling template for:" dialog.
  • In the top left, next to the record and pause button, there will be a "[machine name] > All Processes". Click "All Processes" and select "firefox" from the "Running Applications" section.
  • Click the record button (red circle in top left)
  • Wait for the amount of time that you want to profile
  • Click the stop button

Command line tools

There is instruments and iprofiler.

How do we monitor performance counters (cache miss etc.)? Instruments has a "Counters" instrument that can do this.

Memory profiling

Instruments will record a call stack at each allocation point. The call tree view can be quite helpful here. Switch from "Statistics". This malloc profiling is done using the malloc_logger infrastructure (similar to MallocStackLogging). Currently this means you need to build with jemalloc disabled (ac_add_options --disable-jemalloc). You also need the fix to Bug 719427

The DTPerformanceSession api can be used to control profiling from applications like the old CHUD API we use in Shark builds. Bug 667036

System Trace might be useful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:90 次

字数:3135

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文