Intel® VTune™ Amplifier XE and Intel® VTune™ Amplifier for Systems Help

Viewing Source

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:

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.

Note

Accessing Source View

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:

Identifying the Hottest Code Lines

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:

Editing Source

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:

  1. In the Source pane, select the line you want to edit.

  2. Right-click the line and select Edit Source from the context menu, or click the Open Source File EditorOpen 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.

Note

The Source/Assembly analysis is not supported for the source code using the #line directive.

See Also