Follow this guidance to understand how to compile an application for analysis with Intel® VTune™ Profiler and make your analysis more productive.
These guidelines apply to all supported operating system hosts and compiled languages. It is highly recommended that you follow this guidance to make your use of VTune Profiler as effective as possible.
Build your application in Release mode, with maximum appropriate compiler optimization level.
Because:
Generate debug information for your application, and, if possible, download debug information for any third-party libraries it uses.
Because:
To fulfill the recommendations on Windows, you will need these compiler flags:
/O2 /Zi /DEBUG
Follow these steps to configure the optimization level and debug information generation in Microsoft Visual Studio*:
This also enables the /O2 optimization level. To check, right-click on your project and open Properties > C/C++ > Optimization.
The Property Pages dialog opens.
These steps cover the most important compiler switches that apply to all C++ applications.
Additional compiler switches are recommended for applications that use OpenMP* or Intel® oneAPI Threading Building Blocks for threading. See the Compiler Switches for Performance Analysis on Windows* Targets topic for more information.
Once you have the debug information, make sure to set the Search Directories to point VTune Profiler to the PDB and source files.
To fulfill the recommendations on Linux, you will need these compiler flags:
-O2 -g
On Linux, VTune Profiler requires debug information in the DWARF format to enable source and call stack analysis.
The -g option usually produces debugging information in the DWARF format. If you are having trouble generating debug information in the DWARF format, see Debug Information for Linux Binaries.
These steps cover the most important compiler switches that apply to all C++ applications.
Additional compiler switches are recommended for applications that use OpenMP* or Intel® oneAPI Threading Building Blocks for threading. See the Compiler Switches for Performance Analysis on Linux* Targets topic for more information.
Once you have the debug information, make sure to set the Search Directories to point VTune Profiler to the binary and source files.
Same basic recommendations apply to SYCL applications.
Additionally, add these flags to enable functionality specific to accelerators:
This Flag | Does This |
---|---|
-gline-tables-only -fdebug-info-for-profiling |
Enable generating debug information for GPU analysis of a SYCL application. |
-Xsprofile |
Enable source-level mapping of performance data for CPU/FPGA Interaction analysis. |
VTune Profiler also offers the Instrumentation and Tracing Technology API (ITT API) for C++ and Fortran, which enables you to:
See the Instrumentation and Tracing Technology API section for details on configuration and usage.