User Guide

  • 2020.3
  • 07/10/2020
  • Public Content

See Also

The ITT API overhead and its impact on the overall application performance depends on the amount of instrumentation code added to the application. When instrumenting an application with ITT API, you should balance between application performance and the amount of performance data that you need to collect, in order to minimize API overhead while collecting sufficient performance data.
Follow these guidelines to achieve a good balance between overall performance of the instrumented application and instrumentation detail:
  • Instrument only those paths within your application that are important for analysis.
  • Create ITT domains and string handles outside the critical paths.
  • Filter data collection by different aspects of your application that can be analyzed separately. The overhead for a disabled API call (thus filtering out the associated call) is always less than 10 clock ticks, regardless of the API.
Usage Example: Using Domains and String Handles
ITT API includes a subset of functions which create domains and string handles. These functions always return identical handles for the same domain names and strings. This requires these functions to perform string comparisons and table lookups, which can incur serious performance penalties. In addition, the performance of these functions is proportional to the log of the number of created domains or string handles. It is best to create domains and string handles at global scope, or during application startup.
The following code section creates two domains in the global scope. You can use these domains to control the level of detail that is written to the trace file.
__itt_domain* basic = __itt_domain_create(__TEXT("MyFunction.Basic")); __itt_domain* detailed = __itt_domain_create(__TEXT("MyFunction.Detailed")); // Create string handles at global scope. __itt_string_handle* h_my_funcion = __itt_string_handle_create(__TEXT("MyFunction")); void MyFunction(int arg) { __itt_task_begin(basic, __itt_null, __itt_null, h_my_function); Foo(arg); FooEx(); __itt_task_end(basic); } __itt_string_handle* h_foo = __itt_string_handle_create(__TEXT("Foo")); void Foo(int arg) { // Skip tracing detailed data if the detailed domain is disabled. __itt_task_begin(detailed, __itt_null, __itt_null, h_foo); // Do some work here... __itt_task_end(detailed); } __itt_string_handle* h_foo_ex = __itt_string_handle_create(__TEXT("FooEx")); void FooEx() { // Skip tracing detailed data if the detailed domain is disabled. __itt_task_begin(detailed, __itt_null, __itt_null, h_foo_ex); // Do some work here... __itt_task_end(detailed); } // This is my entry point. int main(int argc, char** argv) { if(argc < 2) //Disable detailed domain if we do not need tracing from that in this //application run detailed ->flags = 0; MyFunction(atoi(argv[1])); }

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804