Quantcast
Channel: C#
Viewing all articles
Browse latest Browse all 1853

Managing Analysis Duration from the Command Line

$
0
0

Manage analysis duration for best results on short-running targets, or to minimize unnecessary overhead on longer-running targets.

Here are some ways to minimize duration while optimizing the analysis process.

Begin with a Predefined Analysis Type

Intel® VTune™ Amplifier provides predefined general analysis types for hardware event-based sampling that are designed to keep overhead to a reasonable level. The option reference topic for the collect action identifies analysis types that are recommended as starting points; and points out some more advanced analysis types that have higher overhead. For more information, see About Performance Analysis with VTune Amplifier.

Note

To view all the analysis types that are available for your processor, use the command line help:

$ amplxe-cl -help collect

If the Target Runs Over 15 Minutes, or Under 1 Minute, Adjust the Sampling Interval

The sampling interval determines how much data is collected. The default sampling interval is short, which is appropriate for targets that complete in 1 - 15 minutes.

If your target runs shorter or longer than this, use the target-duration action-option to set the appropriate duration type, which adjusts the sampling interval.

  • If the target takes less than 1 minute to run, specify veryshort.

  • If the target takes 15 minutes to 3 hours to run, specify medium.

  • If the target takes over 3 hours, specify long.

Note

For hardware event-based analysis types, a multiplier applies to the configured Sample After value.

Example

Perform a Hotspots analysis using a medium sampling interval that is appropriate for targets with a duration of 15 minutes to 3 hours.

$ amplxe-cl -collect hotspots -target-duration-type medium -- myApp.exe

Manually Interrupt and Restart Analysis

If you want to temporarily pause analysis for some part of the target process, or you find that the analysis is taking too long and you want to stop it altogether, you can do this manually by opening another terminal and using the command action. Alternatively, you can use the Pause and Resume buttons in the GUI.

The command process is synchronous with the analysis process, and will not exit until the command is executed - that is, until the collection is actually paused, resumed, or stopped.

To choose the analysis process you want to control, use the result-dir option to explicitly specify the result directory in which collection is being performed. If you don't specify the result directory path, the latest result directory is chosen based on the current user data directory (user-data-dir option settings) and highest numbered result.

Note

This is analogous to the Pause and Resume buttons in the GUI.

Examples

Run an unlimited duration advanced-hotspots analysis, which will run until you stop it.

$ amplxe-cl -collect advanced-hotspots -duration unlimited -result-dir C:\test\results\r002ah

To pause this analysis manually, open a new terminal and use the command action with the pause argument, being sure to specify the result directory. The target process continues to run, but data collection is paused.

amplxe-cl -command pause -result-dir C:\test\results\r002lh

To resume analysis, use the command action with the resume argument.

amplxe-cl -command resume -r C:\test\results\r002lh

To stop analysis altogether, use the command action with the stop argument. Once analysis is stopped, it cannot be resumed.

amplxe-cl -command stop -r C:\test\results\r002lh

Set Analysis to Start at a Specified Time

VTune Amplifier offers other ways to limit the analysis process, for example, you can set the analysis to begin at a certain time in the process.

Note

VTune Amplifier also provides APIs for this purpose. For more information, see the Collection Control API topic.

To start analysis at a specified time after initiating target execution, use the start-paused option with the resume-after option. Alternatively, use -command resume, as described previously.

amplxe-cl -start-paused -resume-after <value> -collect <analysis_type> -- <target>

where

  • <value> is the time at which to resume in milliseconds

  • <analysis_type> is the type of analysis to run

  • <target> is the target to analyze

Example

Start myApplication.exe in paused mode, and begin a lightweight-hotspots analysis after 50 milliseconds.

$ amplxe-cl -start-paused -resume-after 50 -collect lightweight-hotspots -- C:\test\myApplication.exe

Set Analysis to End After a Specified Time

You can also set the analysis to end after a certain amount of time elapses.

To stop analysis at a specified time after initiating target execution, use theduration option.

amplxe-cl -duration <value> -collect <analysis_type> -- <target>

where

  • <value> is the duration in seconds

  • <analysis_type> is the type of analysis to run

  • <target> is the target to analyze

Example

Start an advanced hotspots analysis of myApplication.exe and end analysis after 60 seconds.

$ amplxe-cl -duration 60 -collect advanced-hotspots -- C:\test\myApplication.exe

Inglese

Viewing all articles
Browse latest Browse all 1853

Trending Articles