Getting Around Instruments

Getting Around Instruments

Instruments has several key windows and dialogs.

Profiling Template Selection Dialog

When Instruments launches, you’re presented with a list of profiling templates—files containing sets of preconfigured instruments—from which to choose. This list includes a set of standard templates as well as any custom templates you may have created. (See Figure 5-1.)

Figure 5-1The profiling template selection dialog

The profiling template selection dialog consists of the following primary elements:

  • Target device list: Click this to select the device on which you wish to profile.
  • Target process list: Click this to select the process or processes to profile.
  • Filter buttons: Click these to filter down the list of templates to display just the standard templates, custom templates, or recently used templates.
  • Search field: Enter some text to quickly find the template you need. This searches template titles and descriptions.
  • Template list: The list of profiling templates, which may be filtered if you clicked a filter button or entered search criteria.
  • Template description: A short description of the currently selected profiling template, which can be helpful for determining whether the selected template meets your needs.
  • Choose button: Click this to create a new profile document, based on the currently selected template.

    This button changes to Profile when you press the Option key. Click the Profile button to create a new document based on the currently selected template and immediately begin profiling the target process.

  • Open button: Click this to open a previously saved profile document, rather than starting with a fresh template.
  • Cancel button: Click this to close the template selection dialog.

TIP

You can display the profiling template selection dialog at any time by choosing File > New (or pressing Command-N).

Trace Document

A trace document (Figure 5-2) is used to organize and configure instruments for profiling, initiate data collection, and view and analyze the results. You create a new trace document by launching Instruments and choosing a profiling template or by initiating profiling from Xcode, the Dock, or the command line. You can also save and reopen trace documents in which you’ve configured instruments and collected data. A trace document can contain a lot of extremely detailed information, and this information is presented to you through a number of panes and areas.

Figure 5-2The trace document

Toolbar

The toolbar (Figure 5-3) allows you to start, pause, and stop data profiling, add instruments, hide and show panes, and more.

Figure 5-3The trace document toolbar

It includes the following main elements:

  • Profiling controls: Allow you to record, pause, and stop data collection.
  • Target device list: Allows you to select the device on which you wish to profile.
  • Target process list: Allows you to select the process or processes to profile.
  • Activity viewer: Shows the elapsed time of the current trace or the position of the inspection head in the timeline pane. If your trace document has multiple data runs associated with it, that’s shown here too.
  • Add Instrument button (+): Shows or hides the instruments Library palette, which contains a complete list of available instruments. From here, you can select individual instruments and add them to your trace document.
  • Strategy buttons: Control the type of information displayed in the timeline pane.
    • CPU (): Displays a list of CPU cores, along with their collected data, in the timeline pane. Only available when a trace document contains instruments that record CPU data.
    • Instruments (): Displays a list of instruments and their corresponding data in the timeline pane.
    • Threads (): Displays a list of threads and their corresponding data in the timeline pane. Only available when a trace document contains instruments that record thread data.
  • View buttons (): Hide or show the detail pane and inspector.

Timeline Pane

The timeline pane displays a graphical summary of the data recorded for a given trace. In this pane, each instrument, CPU core, or thread has its own “track,” which provides a graphical chart of the data collected. Click the strategy buttons in the toolbar to display instrument, CPU core, or thread data.

Although this pane’s information is read-only, you can scroll through data, select specific areas for closer examination, and insert flags to highlight points of interest. You can change how graphical information is displayed here by adjusting the zoom level or by changing the record settings of individual instruments in the inspector.

Instruments strategy view

This is a list of all the individual instruments contained within your trace document, along with their collected data (see Figure 5-4). You can drag new instruments to the list from the Library palette (see Add an Instrument to a Trace Document). If you select an instrument in the list, you can delete it or configure it in the inspector pane. The instruments list is visible by default when you create a trace document.

Figure 5-4Instrument activity in the trace document timeline pane

CPU strategy view

If your trace document contains instruments that record CPU-related data, a list of CPU cores and their usage over time is displayed here (Figure 5-5).

Figure 5-5CPU activity in the trace document timeline pane

Threads strategy view

If your trace document contains instruments that record thread-related data, a list of threads and their utilization is displayed here (Figure 5-6).

Figure 5-6Thread activity in the trace document timeline pane

Detail Pane

This pane shows detailed information about the data collected by the instruments in your trace document (see Figure 5-7). Select an individual instrument in the timeline pane to see the data it collected while profiling.

Figure 5-7The trace document detail pane

Navigation bar

The navigation bar at the top of the detail pane (Figure 5-8) helps you browse through collected data. You can use it to switch between types of data and to navigate through different levels of data.

Figure 5-8The navigation bar in the trace document detail pane

  • Instrument: Icon of the currently selected instrument in the timeline pane. Click this to view the console for the instrument.
  • Detail type list: Allows you to navigate between different types of data. The options displayed here vary, depending on the actively selected instrument. For many instruments, the list includes things like a summary of data, a call tree, and a console.
  • Detail tree: Keep track of where you are in the hierarchy as you navigate through the data in the detail pane. Click a branch of the tree to move back up the hierarchy to the corresponding data.
  • Filter field: Allows you to filter collected data for a specific term. Click the filter field’s menu for some additional filtering options. You can also filter collected data more extensively by adjusting display settings in the inspector pane.

Collected data area

The collected data area (Figure 5-9) shows you all of the data for the selected instrument, typically in tabular format. The content displayed here varies significantly from instrument to instrument. For example, the Activity Monitor instrument displays process, CPU, and thread information, and much more.

Figure 5-9The collected data area in the trace document detail pane

Often, individual symbols and data points within this area contain navigation buttons (), which appear when you move your pointer over them. You can click these buttons to move deeper into the data. As you do, the detail tree in the navigation bar updates to reflect where you are in the hierarchy, as shown in Figure 5-10.

Figure 5-10The trace document detail pane’s hierarchy navigation

Inspector Pane

This pane contains instrument-specific settings (Figure 5-11), which you can adjust in order to control recording behavior and the visible information in the timeline and detail panes. This pane also sometimes shows additional information that may be useful when browsing through data in the detail pane.

Figure 5-11The areas of the trace document inspector pane

Record settings area

The settings available in this area vary, depending on the active instrument. Often, instruments provide settings that allow you to adjust certain attributes pertaining to how data is recorded, such as the sample rate or the types of statistics to capture, as seen in Figure 5-12.

Figure 5-12The record settings area of the trace document inspector pane

Display settings area

The settings in this area also vary, depending on the instrument. These settings can help you:

  • Control the data that appears in the detail pane. For example, an instrument may allow you to hide system libraries when navigating a call tree.
  • Navigate recorded data more efficiently through filtering and data mining.
  • Adjust how recorded information is represented in the timeline view. An instrument may, for example, allow you to change the style of graph used to represent its collected data.

Figure 5-13 shows an example of display settings for a selected instrument.

Figure 5-13The display settings area of the trace document inspector pane

Extended detail area

This area doesn’t contain any settings. Rather, it is used to display additional instrument-specific information about selected data in the detail pane, such as a complete stack trace, as shown in Figure 5-14.

Figure 5-14The extended detail area of the trace document inspector pane

Library Palette

The Library palette (Figure 5-15) provides a complete list of available instruments and allows you to add them to your trace documents. Here, you can browse instrument descriptions and filter for a specific instrument. To display the Library palette, choose Window > Library, press Command-L, or click the Add Instrument button (+) in the trace document toolbar.

Figure 5-15The Library palette

For more information, please see the following sections:

Flags Palette

The Flags palette (Figure 5-16) displays a list of any flags you may have applied in the timeline pane of the active trace document. In this palette, you can select a flag to quickly navigate to it in the timeline. You can also filter through a large list of flags for a specific one, show and hide your flags, and view timestamp information about your flags.

Figure 5-16The Flags palette

Preferences Window

The preferences window (Figure 5-17) is used to control various settings related to the behavior of Instruments. Here, you can adjust general settings that pertain to startup, saving, and more. You can also adjust recording settings, CPU settings, and symbol preferences. See Preferences for a complete list of settings and options that may be modified through this window.

Figure 5-17The General preferences window

时间: 2024-08-28 21:07:40

Getting Around Instruments的相关文章

iOS instruments之ui automation的简单使用(高手绕道)

最近使用了几次instruments中的automation工具,现记录下automation的简单使用方法,希望对没接触过自动化测试又有需求的人有所帮助.  UI 自动测试是iOS 中重要的附加功能,它由名为"Automation"的新的工具对象支持.Automation工具的脚本是用JavaScript语言编写,主要用于分析应用的性能和用户行为,模仿/击发被请求的事件,利用它可以完成对被测应用的简单的UI测试及相关功能测试. 一. 简单的录制脚本 打开xcode,这里用我为我家亲爱

最新版 使用Xcode6.4 和Instruments、Leaks调试解决iOS内存泄露

分析内存泄露 最近用到内存泄露,查看以前的博客,方法不错,但操作时,步骤好多都找不到啦,不知道怎么操作.所以下面做了一个简单的例子 实验的开发环境:XCode 6.4 一.Analyze (shift+command+b) app不crash了,那看看有没有内存泄露.用XCode的Analyze就能分析到哪里有内存泄露 分析之后可以看到: 这里提示alertView没被释放,有内存泄露,那我们释放 [alertView release]; 再分析,这个问题解决了. 二.使用Instruments

iOS性能优化:Instruments使用实战(转)

采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instruments使用技巧 关于Instruments官方有一个很有用的用户使用Guide,当然如果不习惯官方英文可以在这里找到中文本翻译版本PDF参阅.Instruments 确实是一个很强大的工具,用它来收集关于一个或多个系统进程的性能和行为的数据极为方便,并能及时跟踪随着时间产生的数据.还可以广泛收集不同类型的数据.关于Instrument工具基本使用不在赘述.如

使用Xcode Instruments Leak解决内存泄漏问题

iOS 5.0之后apple引入了Xcode编译器特性ARC(Automatic Reference Counting,自动引用计数)来帮助开发者管理内存,但为了追求app的高性能与减少安装包大小,工作中很多时候需要我们手动管理内存.再牛的开发者也不能保证自己写的code 100%没有内存泄露,出现内存泄露不可怕,可怕的是我们时间与精力花了大把,但内存泄露依旧没解决,即影响了工作效率也影响自己的心情. 下面就讲解xcode中的内存调试神器---Instruments Leak ,不管是ios开发

iOS性能优化:Instruments使用实战

iOS性能优化:Instruments使用实战 最近采用Instruments 来分析整个应用程序的性能.发现很多有意思的点,以及性能优化和一些分析性能消耗的技巧,小结如下. Instruments使用技巧 关于Instruments官方有一个很有用的用户使用Guide,当然如果不习惯官方英文可以在这里找到中文本翻译版本PDF参阅.Instruments 确实是一个很强大的工具,用它来收集关于一个或多个系统进程的性能和行为的数据极为方便,并能及时跟踪随着时间产生的数据.还可以广泛收集不同类型的数

ios系类教程之用instruments来检验你的app

ios系类教程之用instruments来检验你的app 为了节省大家的时间,提供一个演示的Demo给大家.代码传送门.下载后解压然后用xcode打开.编译运行APP后 然后在搜索框内输入任意词汇,点击结果你会看到下面的结果 正如你所见的,这个app很简单.程序其实调用的是Flickr的API,通过app顶部的搜索框执行搜索后在下面的tableview显示你搜索的搜索词,搜索词后面的括号内有搜索结果的个数,点击此行进入一个略所图的结果列表页面 如上图. 点击其中一行 进入图像的大图模式,在这个页

xcode里面使用Memory Leaks和Instruments检测内存泄漏

教程截图: Leaks和Instruments教程[检测内存泄露]" src="http://pic002.cnblogs.com/images/2011/283130/2011080816513182.jpg"> 作为一名无证程序员,无论你多么精通Objective-C的内存管理,随着时间的推移,你也不可避免的犯内存相关的错误.但通常因为代码量太大,以至于你不可能一行一行的去排除(等你解决完,你设计的动车早相撞了!) 幸运的是,苹果已经提供了一些好的方式来帮助你找到应

苹果Instruments/Shark性能调试工具概述

在Mac OS X上你可以使用Gprof这样的UNIX工具用于测试程序性能.当然,Apple也有自己的Profiling Tools,用得比较多的是Shark.10.5里还引入了一个基于DTrace的叫Instruments的程序. Instruments 自Xcode 3.0开始,苹果提供了一种非比寻常的方法来调试应用程序,这就是Instruments.就像它的名字一样(Instruments意为乐器),Instruments提供了一种像苹果的音乐创作软件GarageBand一样的带有时间线的

使用Instruments中的CoreAnimation分析动画

1. 打开Instruments中的CoreAnimation 2. 运行前的准备工作 要注意勾选以下选项,便于调试 3. 运行与调试 一些需要注意的细节: 1. 如果屏幕中,有超过50%的区域由半透明的layer叠加组成,如果执行滑动操作的话,很有可能导致卡顿. 2. 加载的图片尽量不要执行缩放操作,缩放会消耗额外的性能.比方说,你加载网络上的图片,就尽量加载图片大小尺寸的图片,而不要缩放较大的图片. 参考资料 http://oleb.net/blog/2011/11/ios5-tech-ta

National Instruments实习心得

时间过得真快,转眼间在National Instruments的三个月实习期就要结束了.今天我就对这三个月的实习做一个小结,并且将我得感受分享给大家. 今天要讲的分为两部分,第一部分主要是再给大家介绍下这三个月我主要做的工作,然后简单谈谈这三个月实习下来我的一些心得感受. 来ni后第一个任务就是花半周时间学习labview,接下来就是在旭东的安排下通过跑一些tps,通过这些tps熟悉myRIO和roboRIO相关的硬件环境. 属性了硬件环境,接下来我参考myRIO的一些tps创建了对应的robo