Source Code Analysis
Access Source View
- If you access the Source view by clicking a function in the grid, theVTuneopens the source at theProfilerhottest(with the highest value of the metric selected for hotspot navigation) line of this function in theSource/Assemblypane.
- When you click a call stack function, theVTuneopens the source highlighting theProfilercall 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 theTimelinepane, theVTuneopens a wait function highlighting the waiting call site. If you double-click a transition (for Threading data), it highlights the signaling call site.Profiler
Source/Assembly toggle buttons. By default, depending on the symbol information availability, the
VTuneopens one of the panes: Source or Assembly. But you can use the toggle
Assemblybuttons on the toolbar to manage the view and enable both of them if required/possible.
The content displayed on the
Assemblypanes is correlated. When you select an element on one pane, another pane scrolls to the corresponding elements and highlights them.
Hotspot navigation buttons. Typically, the
VTuneopens the source code highlighting the most performance critical code line based on the key metric set up for this analysis. To go further and freely navigate between code lines that have the highest metric value (
hotspots), use these buttons toolbar:
- 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.
Sourcepane shows your code written on a high-level programming language, for example, C, C++, or Fortran. The
Sourcepane opens if the symbol information for the selected function is available.
Hotspot navigation metriccolumn. By default, the source view navigation is based on the key analysis metric like the CPU Time for the Hotspots analysis. Such a metric column is highlighted. To change the hotspot navigation metric, right-click the required column and select
Use for Hotspot Navigationcommand from the context menu.
Assemblypane displays disassembled code. This code shows the exact order of the assembly instructions executed by the processor. Instructions on the
Assemblypane are grouped into basic blocks. To get help on a particular instruction, select it in the grid, right-click and choose
Instruction Referencefrom the context menu.
For better navigation in the Assembly pane, you may select one of the available granularity levels in the
Assembly groupingdrop-down menu:
Basic Block/Address, or
Function Range/Basic Block/Address.
VTuneupdates the Assembly view grouping the instructions into collapsible nodes according to the selected hierarchy.
If there is no correct debug information, or symbol file is unavailable, the assembly data may be incorrect. In this case, the
VTuneuses heuristics to define function boundaries in the binary module.
Heat map markers. Use the blue markers to the right of the vertical scroll bar to quickly identify the hotspot lines (based on the hotspot navigation 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.
- In theSourcepane, select a line you want to edit.
- Right-click the line and selectEdit Sourcefrom the context menu, or click theOpen Source File Editorbutton on the Source/Assembly toolbar.Your source code opens in the code editor set in your system as default. For example, on Linux the code editor is defined in theEDITORenvironment variable (for example,vi) orVISUALenvironment variables (for example,gedit,emacs). Depending on the editor application, the code may open exactly on the selected line.