Intel® VTune™ Amplifier XE and Intel® VTune™ Amplifier for Systems Help

Collection Control API

You can use the collection control APIs in your code to control the way the Intel® VTune™ Amplifier collects data for applications.

Use This Primitive

To Do This

void __itt_pause (void)

Run the application without collecting data. VTune Amplifier reduces the overhead of collection, by collecting only critical information, such as thread and process creation.

void __itt_resume (void)

Resume data collection. VTune Amplifier resumes collecting all data.

void __itt_detatch (void)

Detach data collection. VTune Amplifier detaches all collectors from all processes. Your application continues to work but no data is collected for the running collection.

Pausing the data collection has the following effects:

Note

The Pause/Resume API call frequency is about 1Hz for a reasonable rate. Since this operation pauses and resumes data collection in all processes in the analysis run with the corresponding collection state notification to GUI, you are not recommended to call it on frequent basis for small workloads. For small workloads, consider using the Frame APIs.

Usage Example: Focus on Specific Code Section

The pause/resume calls shown in the following code snippet enable you to focus the collection on a specific section of code, and start the application run with collection paused.

int main(int argc, char* argv[])
{
  // Do initialization work here
  __itt_resume();
 	// Do profiling work here
  __itt_pause();
  // Do finalization work here
  return 0;
}

Usage Example: Hide Sections of Code

The pause/resume calls shown in the following code snippet enable you to hide some intensive work that you are not currently focusing on:

int main(int argc, char* argv[])
{
  // Do work here
  __itt_pause();
  // Do uninteresting work here
  __itt_resume();
  // Do work here
  __itt_detach();
  // Do uninteresting work here
  return 0;
}

See Also