Skip to content

Latest commit

 

History

History
73 lines (60 loc) · 3.59 KB

ITT.md

File metadata and controls

73 lines (60 loc) · 3.59 KB

Instrumentation and Tracing Technology API (ITT API)

Overview

The Instrumentation and Tracing Technology API (ITT API) enables the application to generate and control the collection of tracing data during its execution. It is intended for use with Intel(R) VTune(TM) Profiler.

Instrumentation and Tracing Technology API (ITT API) provides the following capabilities:

  • Enable user to control collection;
  • Enable user to set marks during the execution of the specific code;
  • Enable user to mark frames and tasks;
  • Enable user to specify custom synchronization primitives implemented without standard system APIs;
  • Support applications in C/C++ environments.

User applications/modules linked to the static user API library do not have a runtime dependency on a dynamic library. Therefore, they can be executed without Intel(R) VTune(TM) Profiler with close-to-zero overhead.

Supported OS:

  • Linux
  • Windows

Supported HW:

  • Any

Needed Headers:

Needed Libraries:

How To Use

The following steps should be performed to enable ITT based code annotation for target application:

  1. Get ITT source code from github.
  2. Call ITT functions to annotate the regions-of-interest inside the source code:
#include <ittnotify.h>

int main() {
  __itt_domain* domain = __itt_domain_create("Domain.Global");
  assert(domain != nullptr);

  // Place a new frame
  __itt_frame_begin_v3(domain, nullptr);
  {
    // Annotate the first task
    __itt_string_handle* first_task_handle =
      __itt_string_handle_create("FirstTask");
    __itt_task_begin(domain, __itt_null, __itt_null, first_task_handle);
    {
      /* First Task Body */
    }
    __itt_task_end(domain);

    // Annotate the second task
    __itt_string_handle* second_task_handle =
      __itt_string_handle_create("SecondTask");
    __itt_task_begin(domain, __itt_null, __itt_null, second_task_handle);
    {
      /* Second Task Body */
    }
    __itt_task_end(domain);
  }
  __itt_frame_end_v3(domain, nullptr);

  return 0;
}
  1. Build the application and link it with ITT library implementation. One may build ITT static library first, and then link the application with it. Another way is to add ITT sources (in particular, ittnotify_static.c file) into the application directly.
  2. Run the application under Intel(R) VTune(TM) Profiler to see the result.

Usage Details

  • refer to Instrumentation and Tracing Technology API (ITT API) documentation documentation to learn more on programming interfaces
  • refer to Instrumentation and Tracing Technology API (ITT API) code repository to learn more on implementation details

Samples