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:
- Instrumentation and Tracing Technology (ITT) library, can be installed as part of Intel(R) VTune(TM) Profiler
The following steps should be performed to enable ITT based code annotation for target application:
- Get ITT source code from github.
- 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;
}
- 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.
- Run the application under Intel(R) VTune(TM) Profiler to see the result.
- 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