Getting Around Instruments

Getting Around Instruments

Instruments has several key windows and dialogs.

Profiling Template Selection Dialog

当仪器的推出,你提出一个清单的分析包含预配置的仪器设置模板文件选择。此列表包含一组标准模板以及您可能创建的任何自定义模板。(参见图5-1。)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-1仿形模板选择The profiling template selection dialogimage: ../Art/instruments_profilingtemplate_dialog_2x.png

剖析模板选择对话框由以下主要元素组成: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

你可以显示仿形模板选择对话框,在任何时间,选择文件>新建(或按了N命令)。You can display the profiling template selection dialog at any time by choosing File > New (or pressing Command-N).

Trace Document

跟踪文件(图5-2)是用于组织和配置工具的分析,进行数据采集,并查看分析结果。你创建一个新的跟踪文件,启动仪器选择仿形模板或启动分析从Xcode,码头,或命令行。您还可以保存和重新打开跟踪文档,在这些文档中您已经配置了工具和收集的数据。跟踪文档可以包含许多非常详细的信息,并且这些信息通过许多窗格和区域呈现给您。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 documentimage: ../Art/instruments_trace_document_2x.png

Toolbar

工具栏(图5-3)可以让你开始,暂停,停止数据剖析,添加工具,隐藏和显示面板,和更多。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 toolbarimage: ../Art/instruments_trace_document_toolbar_2x.png

它包括以下主要内容: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:显示一个列表的CPU内核,随着他们收集的数据,在时间线面板。只有在跟踪文档包含记录CPU数据的工具时才可用。CPU (image: ../Art/instruments_icon_cpu_strategy_2x.png): 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 (image: ../Art/instruments_icon_instruments_strategy_2x.png): Displays a list of instruments and their corresponding data in the timeline pane. 

    • 线程:在时间轴面板显示线程列表和相应的数据。只有在跟踪文档包含记录线程数据的工具时才可用。Threads (image: ../Art/instruments_icon_threads_strategy_2x.png): 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 (image: ../Art/inline_instruments_view_buttons_2x.png): Hide or show the detail pane and inspector.

时间轴面板Timeline Pane

“时间线”窗格显示为给定跟踪记录的数据的图形摘要。在这个窗格中,每个工具、CPU核心或线程都有自己的“跟踪”,它提供了所收集数据的图形图表。单击工具栏中的策略按钮来显示工具、CPU核心或线程数据。单击工具栏中的策略按钮来显示工具、CPU核心或线程数据。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

这是包含你的痕迹文件列表中的所有个体的工具,随着他们收集到的数据(参见图5-4)。可以从库调色板中将新工具拖到列表中(参阅将文档添加到跟踪文档)。如果您在列表中选择了一个工具,您可以删除它,或者在“检查”窗格中配置它。在创建跟踪文档时,默认情况下可以看到仪器列表。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-4在跟踪文件方框图活动时间表Instrument activity in the trace document timeline paneimage: ../Art/instruments_trace_document_timeline_pane_instruments_2x.png

CPU的战略观CPU strategy view

如果你跟踪文件包含的仪器,记录CPU的相关数据,列出的CPU内核和使用时间显示在这里(图5-5)。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-5活性跟踪文件的时间窗CPU activity in the trace document timeline paneimage: ../Art/instruments_trace_document_timeline_pane_cpu_2x.png

线程的战略观Threads strategy view

如果跟踪文档包含记录与线程相关的数据的工具,则将显示线程列表及其使用情况(图5-6)。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-6在跟踪文件方框图活动时间表Thread activity in the trace document timeline paneimage: ../Art/instruments_trace_document_timeline_pane_threads_2x.png

详细资料窗格Detail Pane

此窗格显示了跟踪文档中的工具收集的数据的详细信息(参见图5-7)。在时间线窗格中选择一个单独的工具来查看它在分析时收集的数据。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-7跟踪文件的细节The trace document detail paneimage: ../Art/instruments_detail_pane_2x.png

Navigation bar

细节窗格顶部的导航栏(图5-8)可以帮助您浏览所收集的数据。您可以使用它在不同类型的数据之间进行切换,并通过不同级别的数据进行导航。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-8跟踪文档详细信息窗格中的导航栏The navigation bar in the trace document detail paneimage: ../Art/instruments_detail_pane_navigation_bar_2x.png

  • 仪表:时间轴窗格中当前选定的仪表图标。单击此可查看工具的控制台。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

收集到的数据区(图5-9)显示你所有所选仪器的数据,通常以表格格式。这里显示的内容与乐器有很大差别。例如,活动监视器仪表显示进程、CPU和线程信息,以及更多。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-9跟踪文档详细信息窗格中收集的数据区域The collected data area in the trace document detail paneimage: ../Art/instruments_detail_pane_collected_data_table_2x.png

通常,个人符号和数据点此区域内包含导航按钮,出现当你把指针放在他们。您可以单击这些按钮以深入到数据中。正如您所做的,导航栏中的细节树更新以反映层次结构中的位置,如图5-10所示。Often, individual symbols and data points within this area contain navigation buttons (image: ../Art/icon_detail_pane_gotoarrow_2x.png), 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-10跟踪文档详细信息窗格的层次结构导航The trace document detail pane’s hierarchy navigationimage: ../Art/instruments_detail_pane_navigation_bar_deeper_2x.png

督察窗格Inspector Pane

该窗格包含特定仪器的设置(图5-11),你可以调整以控制记录行为和信息可视化的时间表和细节窗格。这个窗格有时还显示了在详细信息窗格中浏览数据时可能有用的附加信息。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-11跟踪文档检查器窗格的区域The areas of the trace document inspector paneimage: ../Art/instruments_inspector_pane_navigation_bar_2x.png

Record settings area

此区域可用的设置不同,取决于活动仪表。通常,仪器提供的设置,允许你调整某些属性是如何记录数据,如采样率或统计类型的捕捉,如图5-12看到。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-12跟踪文档检查器窗格的记录设置区域The record settings area of the trace document inspector paneimage: ../Art/instruments_inspector_pane_record_settings_2x.png

显示设置区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-13跟踪文档检查器窗格的显示设置区域The display settings area of the trace document inspector paneimage: ../Art/instruments_inspector_pane_display_settings_2x.png

扩展的详细地区Extended detail area

此区域不包含任何设置。相反,它是用来显示其他仪器的具体信息在详细信息窗格中选择的数据,如一个完整的堆栈跟踪,如图5-14所示。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-14跟踪文档检查器窗格的扩展详细区域The extended detail area of the trace document inspector paneimage: ../Art/instruments_inspector_pane_extended_detail_2x.png

库面板Library Palette

图书馆的调色板(图5-15)提供了一个完整的可用工具列表,允许您添加到您的跟踪文件。在这里,您可以浏览仪器描述和特定工具的筛选器。显示库面板,选择窗口>图书馆、出版社command-l,或单击“添加工具按钮(+)在跟踪文件工具栏。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 paletteimage: ../Art/instruments_library_palette_2x.png

For more information, please see the following sections:

旗托盘Flags Palette

旗托盘(图5 16)显示a list of any旗也许applied in the时间表的窗格of the主动跟踪文件。in this托盘,你可以选择旗to快速航行to it in the时间表。你也可以通过滤波器具有广泛的list of旗for a specific one,显示和隐藏你的旗,and view时间戳信息关于你的旗。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 paletteimage: ../Art/instruments_flags_window_2x.png

选项窗口Preferences Window

预置窗口(图5-17)是用来控制仪器的行为相关的各种设置。在这里,您可以调整与启动、保存和更多有关的一般设置。还可以调整记录设置、CPU设置和符号首选项。查看可通过此窗口修改的设置和选项的完整列表的首选项。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 windowimage: ../Art/instruments_prefs_general_2x.png

iOS Android Appcan WeChat
原文地址:https://www.cnblogs.com/zyingn/p/Getting_Around_Instruments.html