Prepare Application for Analysis

Follow this guidance to understand how to compile an application for analysis with Intel® VTune™ Profiler and make your analysis more productive.

Recommendations for All Compiled Languages

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.

Prepare a C++ Application on Windows

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*:

  1. Enable Release build configuration:
    1. On the Visual Studio toolbar, from the Solution Configuration drop-down list, select Release.

      This also enables the /O2 optimization level. To check, right-click on your project and open Properties > C/C++ > Optimization.

  2. Enable Debug information generation:
    1. Right-click your project and select the Properties item in the context menu.

      The Property Pages dialog opens.

    2. Make sure the Release configuration is selected in the Configuration drop-down list.
    3. From the left pane, select C++ > General.
    4. In the Debug Information Format field, choose Program Database (/Zi).
    5. From the left pane, select Linker > Debugging.
    6. In the Generate Debug Info field, select Generate Debug Information (/DEBUG).
    7. Click OK to save your changes and close the dialog box.

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.

Prepare a C++ Application on Linux

To fulfill the recommendations on Linux, you will need these compiler flags:

-O2 -g

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.

Prepare a SYCL Application

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.

(Optional) Instrument Your Code

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.