This information applies to the command-line interface (vtl) only.
There are several options for configuring the source view. These options enable you to switch between different code formats:
Use the -src option to display high-level programming language. To display the code in this mode, the VTune(TM) Performance Analyzer requires symbol and line number information and a source file. By default, the code is displayed in the Source Only mode if all the required information is available.
If symbol and line number information is available but VTune analyzer cannot find the source file, use the -source-file ( or -sf) option to specify which source file to open.
Use the -asm option to display the disassembly code of the module.
Use the -mixed option to display high-level programming language together with its related assembly instructions. To display the code in this mode, the VTune analyzer requires symbol and line number information and a source file. By default, the code is displayed in the Mixed by Execution mode.
This format enables you to understand how disassembly code lines relate to the source code lines.
There are three different Mixed formats, according to the type of code that drives the mixed display:
Use the -mixed-by-asm (or -mba) option to display the disassembly lines according to the order of their execution. The disassembly code is in order and the relevant source code line appears before the disassembly code lines.
This format shows code similar to the Microsoft* Visual C++* disassembly view.
Advantage: Shows the disassembly code in the order as it appears in the binary file.
Disadvantage: Not easy to follow the execution flow of the source code.
Use the -mixed-by-src (or -mbs) option to display the assembly lines that are generated from each source line. The source code is in order and the relevant disassembly code lines appear under each source code line.
This format shows code similar to a debug compilation.
Advantage: Use this to locate the disassembly code lines related to your source lines.
Disadvantage: The code shown does not appear in the actual execution order. The compiler optimization changes the order.
To display both the source and the disassembly code in their order, use the -mixed-by-combination (-mbc) option. In this format, in order to keep the numeric order of the code lines, some disassembly code lines may appear under an unrelated source code line. You can check the source code line in the Line Number column.
This format shows the mixed code format as in the VTune analyzer version 5.0.
Advantage: Can often provide the advantages of both the other two methods.
Disadvantage: May generate chunks of disassembly code that are misplaced from their original code due to compiler reassignment.
Command-line examples:
>vtl view a1::r1 -code -asm -mn mylib.so -rva 0x1000
In this example, the assembly code of the module mylib.so is displayed around the address 0x1000 annotated with all events in the Activity result r1.
>vtl view a1::r2 -code -src -mn /usr/test/mylib.so -fn "int main(int argc, char* argv[])"
In this example, the source code of the module mylib.so around the function main is displayed annotated with all events in the Activity result r2.