Sometimes it is necessary to increase or decrease the sampling rate of data collection when performance
profiling your application. For example, you may have many small functions that execute so quickly that few samples are collected within them, or perhaps you are not collecting enough cache misses to be statistically significant. Alternatively, you may wish to reduce the sampling rate if you are collecting data for a long period of time. This article explains the steps to adjust sampling frequency in the VTune™ Amplifier user interface.
The easiest method to adjust sampling rates is to use the Duration time estimate dropdown when configuring the project. This option is found in the Advanced section of the What panel, also known as the Analysis Target panel.
The default setting is Between 1 and 15 minutes; selecting other options scales the sampling factors. For example, Between 15 minutes and 3 hours automatically scales the "sample after" value for events by a factor of 10, so they collect less frequently.
You can also adjust the CPU sampling interval for an analysis and, for hardware-event-based sampling (or EBS), the Sample After values for individual events. First, you must make a custom copy of an existing analysis type. The copy button can be found in the upper right corner of the How panel, also known as the Analysis Type panel. In this screenshot, we are copying the Microarchitecture Exploration analysis.
In older versions, the display name, description, and CLI command name of your custom analysis will be editable from the Custom Analysis window launched prior to the creation of your new analysis type. Later versions did away with this prompt window and moved to creating your new analysis immediately. In these versions, you can click the edit icon in the upper right corner of your analysis configuration panel to change these values.
Scrolling down in the analysis configuration panel, you will see a field to alter the CPU sampling interval in milliseconds for your analysis type. For user-mode analysis types (such as Hotspots or Threading), the value should be between 1 and 1000. For EBS analysis types, it should be between 0.01 and 1000.
For EBS analysis types, scrolling further down will reveal a table of events and their Sample After values. These values can be adjusted individually to control how often the events are sampled.
Be aware that increasing the Sample After value will decrease your sample rate and vice versa. Be careful when lowering the Sample After value: sampling too often can cause the system to become unresponsive (requiring you to reboot it to get control back). Typically, decreasing the value by a factor of 10, e.g., changing 100000 to 10000, is safe. If you go much farther than that, do it incrementally and slowly. Finally, note that increasing the sample rate increases overhead and increasing overhead inherently makes your measurements less accurate.