Intel® VTune™ Amplifier XE and Intel® VTune™ Amplifier for Systems Help
For better understanding of a performance problem, it is important to associate a hotspot with the source code and exact machine instruction(s) that caused this hotspot. To do this, open the source/assembly code directly from the Intel® VTune™ Amplifier viewpoints.
The Source/Assembly window opens in a separate tab providing the following panes:
Source pane shows your code written on a high-level programming language, for example, C, C++, or Fortran. The Source pane opens if the symbol information for the selected function is available.
Assembly pane provides disassembled code. This code shows the exact order of the assembly instructions executed by the processor. Instructions on the Assembly pane are grouped into basic blocks.
To manage your source view and toggle the Source/Assembly panes, use the Source and Assembly buttons on the Source window toolbar.
The Source/Assembly window displays accurate information provided that your code is compiled with the debug information and debug information is written correctly in the binary file.
If there is no correct debug information, the assembly data may be incorrect. In this case, the VTune Amplifier uses heuristics to define function boundaries in the binary module.
The content displayed on the panes is correlated. When you select an element on one pane, another pane scrolls to the corresponding elements and highlights them.
One source code line may have one or more related assembly instructions while one instruction has only one related code line.
Synchronization is possible only if the debug line information is available for the selected function.
To open the source/assembly code of a specific item, either double-click the selected item in the grid view/Call Stack/Timeline pane, or select the View Source option from the context menu:
If you access the source view by clicking a function in the grid, the Intel® VTune™ Amplifier opens the source at the hottest (with the highest Data of Interest metric value) line of this function in the Source/Assembly pane.
When you click a call stack, the VTune Amplifier opens the source highlighting the call site (location where a function call is made) at the top of the call stack. The call site is marked with the yellow arrow .
If you click a wait in the Timeline pane, the VTune Amplifier opens a wait function highlighting the waiting call site. If you double-click a transition (for Lock and Waits data), it highlights the signaling call site.
To simplify scanning the code in the Source/Assembly window and freely navigate between code lines that have the highest metric value (hotspots), use the following options:
Hotspot navigation buttons: Use these buttons on the Source/Assembly toolbar to quickly identify and switch between the hotspot code lines of the selected function.
Use This |
To Do This |
---|---|
Go to the code line that has the maximal metric value. |
|
Go to the previous (by metric value) hotspot line. |
|
Go to the next (by metric value) hotspot line. |
|
Go to the code line that has the minimal metric value. |
Hotspot navigation is only available for the metric column set up as Data of Interest. For example, the default Data of Interest column for the Basic Hotspots analysis results is CPU Time. To change the Data of Interest metric, right-click a metric column and select Set As Data of Interest from the context menu. The Data of Interest metric column is marked with a star icon and highlighted in yellow.
Heat map markers: Use the blue markers to the right of the vertical scroll bar to quickly identify the hotspot lines (based on the Data of Interest metric). To view a hotspot, move the scroll bar slider to the marker. The bright blue marker () indicates a hot line for the function you drilled down into. Light blue markers () indicate hot lines for other functions. The background color reflects the current selection.
Assembly grouping menu: For better navigation in the Assembly pane, you may select one of the available granularities in the Assembly grouping drop-down menu: Address, Basic Block/Address, Function Range/Basic Block/Address. VTune Amplifier updates the Assembly view grouping the instructions into collapsible nodes according to the selected hierarchy.
You may cancel the selected grouping by clicking the red cross in the Loading data message at the bottom of the window:
When tuning your target, you may need to modify the source code. VTune Amplifier enables you to open the source files for editing directly from the Source/Assembly window.
To launch the source editor:
In the Source pane, select the line you want to edit.
Right-click the line and select Edit Source from the context menu, or click the Open Source File Editor button on the Source/Assembly toolbar.
Your source code opens in the code editor defined in the EDITOR environment variable (for example, vi) or VISUAL environment variables (for example, gedit, emacs). Depending on the editor application, the code may open exactly on the selected line.
After editing your code, rebuild your target and re-run the VTune Amplifier analysis on the modified version to compare the performance results before and after optimization.
The Source/Assembly analysis is not supported for the source code using the #line directive.