Intel® VTune™ Amplifier

Generating a Difference Report for Regression Testing

Use the amplxe-cl command to test your code for regressions on a daily basis:

  1. Create a baseline.
    1. Run the amplxe-cl tool to analyze your target using a particular analysis type. For example:

      $ amplxe-cl -collect hotspots -- sample

      Runs a Hotspots analysis on the sample target and writes the result to the current working directory. A Summary report is written to stdout.

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

      $ amplxe-cl -report hotspots -result-dir r001hs -report-output myHotspotsReport.txt

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

  2. Update your source code to optimize the target application.
  3. Run the script that:
    1. Sets the path to the amplxe-cl installation folder. The default installation path is /opt/intel/vtune_amplifier_xe_<version>.
    2. Starts the amplxe-cl command to collect performance data.
    3. Runs the amplxe-cl command to compare the current result with the initial baseline result and displays the difference. For example:

      $ amplxe-cl -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 the results of the same analysis type or performance metrics only.

  4. No regressions found. Test result: Pass.
  5. Repeat steps 2-4 on a regular basis.

Example

This example compares r001hs and r002hs Hotspot analysis results 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.

$ amplxe-cl -report hotspots -result-dir r001hs -result-dir 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 

See Also