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.

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.

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
  return 0;
}

See Also


Submit feedback on this help topic

Studio-specific supplemental documentation may be available at <install-dir>/<studio>/documentation/.