Intel® VTune™ Profiler

User Guide

ID 766319
Date 10/31/2024
Public
Document Table of Contents

Difference Report

Comparing two results from the command line is a quick way to check for your application regressions. Use the following syntax to create the difference report for the specified analysis results:

vtune -report <report_name> -r <result1_path> -r <result2_path>

where

  • <report_name> is the type of report for comparison
  • <result1_path> is a directory where your first result file is located
  • <result2_path> is a directory where your second result file is located

Example

This example compares r001hs and r002hs Hotspots analysis results collected on Linux and displays CPU time difference for each function of the analyzed application. In the result for the optimized application (r002hs), a new main function is running for 0.010 seconds, while the Hotspot function algorithm_2 is optimized by 1.678 seconds.

vtune -report hotspots -r r001hs -r r002hs


Function      Module    Result 1:CPU Time   Result 2:CPU Time   Difference:CPU Time 
algorithm_1   matrix    1.225               1.222               0.003
algorithm_2   matrix    3.280               1.602               1.678
main          matrix    0                   0.010               -0.010 

Generate a Difference Report for Regression Testing

Use the vtune command to test your code for regressions on a daily basis:

  1. Create a baseline.

    • Run the vtune tool to analyze your target using a particular analysis type. For example:

      On Linux*

      vtune -collect hotspots -- sample

      On Windows*:

      vtune -collect hotspots -- sample.exe

      The command runs a Hotspots analysis on the sample or sample.exe target and writes the result to the current working directory. A Summary report is written to stdout.

    • Generate a report to use as a baseline for further analysis. For example:

      vtune -report hotspots -result-dir r001hs

      This creates a Hotspots report that shows the CPU time for each function of the sample or sample.exe target.

  2. Update your source code to optimize the target application.

  3. Create and run the script that:

    • On Linux: Sets the path to thevtuneinstallation folder

    • On Windows: Invokes sep-vars.cmd in the Intel® VTune™ Profilerinstallation folder to set up the environment.

    • Starts the vtune command to collect performance data.

    • Runs the vtune command to compare the current result with the initial baseline result and displays the difference. For example:

      vtune -R hotspots -r r001hs -r r002hs

      This example compares CPU time for each function in results r001hs and r002hs and displays both results side-by-side with the calculated difference. The positive difference between the performance values indicates an improvement for result 2. The negative difference indicates a regression.

      NOTE:

      You can compare results of the same analysis type or performance metrics only.

  4. The test is passed if no regressions found.

  5. Repeat steps 2-4 on a regular basis.

Installation Information

Follow these instructions in the Installation Guide to install VTune Profiler on:

Whether you download Intel® VTune™ Profiler as a standalone component or with the Intel® oneAPI Base Toolkit, the default path for your <install-dir> is:

Operating System Path to <install-dir>

Windows* OS

  • C:\Program Files (x86)\Intel\oneAPI\
  • C:\Program Files\Intel\oneAPI\

    (in certain systems)

Linux* OS

  • /opt/intel/oneapi/ for root users
  • $HOME/intel/oneapi/ for non-root users

Make sure that your installation of Intel® VTune™ Profiler has also installed the sampling drivers necessary for data collection.