Use the Pause/Resume API to collect data only on specific sections of your code instead of the full application run and to pause/resume the Activity with multiple runs.
Before using the Pause/Resume APIs, make sure to prepare your compilation and running environment following the steps in the Before You Begin Controlling Data Collection topic.
The following functions enable pausing and resuming data collection during sampling and call graph profiling:
VTPause() pauses data collection;
VTResume() resumes data collection.
In between the calls to VTPause() and VTResume() performance data is not collected.
For sampling, the VTune analyzer uses a system-wide flag to determine when to sample. A call to VTPause() pauses sampling throughout the system. Likewise, a call to VTResume() resumes sampling throughout the system.
If you are using the Pause/Resume API with event-based sampling, then whenever pause is called, the VTune analyzer suspends collecting samples. This decreases the number of events/second sampled. So although the events may still be occurring on the system, the data is not captured.
The VTune analyzer APIs do not support pause/resume collection for individual threads. For call graph profiling, calling VTPause()/VTResume() pauses/resumes data collection for all application threads.
The Pause/Resume Activity
toggle button in the toolbar provides the same functionality as the Pause/Resume
API.
The Pause/Resume Activity toggle button reflects the Activity state with an interval of 5 seconds. So, if during 5 seconds of data collection the Activity status changes to the initial state, the button does not reflect the change.
To use the VTune analyzer API perform the preliminary steps to compile and run your program.