Group ITT profiling utilities#

group ITT profiling utilities

Configurable macro wrappers for ITT profiling.

Defines

OV_ITT_DOMAIN(...)#

Declare domain with a given name.

Parameters:
  • domainName – [in] Known at compile time name of module or library (the domain name).

  • domainDisplayName – [in] Domain name used as the ITT counter name and displayed in Intel VTune. Parameter is optional.

OV_ITT_SCOPE(group, ...)#

Annotate section of code till scope exit to be profiled using known handle or taskName as section id.

In case if handle or taskName absent, the current function name is used.

Note

Implements a task scope

Parameters:
  • group – [in] ITT counter group name used for enabling/disabling at compile time.

  • domainName – [in] Known at compile time name of module or library (the domain name).

  • handleOrTaskName – [in] The annotation name or handle for section of code. Parameter is optional.

OV_ITT_SCOPED_TASK(...)#

Annotate section of code till scope exit to be profiled using known handle or taskName as section id.

In case if handle or taskName absent, the current function name is used.

Note

Implements a task scope

Parameters:
  • domainName – [in] Known at compile time name of module or library (the domain name).

  • handleOrTaskName – [in] The annotation name or handle for section of code. Parameter is optional.

OV_ITT_SCOPED_TASK_BASE(...)#

Annotate section of code till scope exit for BASE/FULL modes regardless of profiling filter groups.

In case if handle or taskName absent, the current function name is used.

Note

All *_BASE() macros are enabled by default and will be used by supporting toolchains. The strings used/provided by these calls should follow the following rules:

  • Should NOT be deleted or modified to ensure correct visible names in profiling tools until CVS-179230 is implemented/resolved.

  • Should use string literals or constant strings when possible

Parameters:
  • domain – [in] Known at compile time name of module or library (the domain name).

  • handleOrTaskName – [in] The annotation name or handle for section of code. Parameter is optional.

  • metadata_key – [in] A metadata element’s key as a string. Parameter is optional.

  • metadata_value – [in] The metadata value. Parameter is optional.

OV_ITT_SCOPED_REGION_BASE(...)#

Annotate region of code till scope exit for BASE/FULL modes regardless of profiling filter groups.

In case if handle or regionName absent, the current function name is used.

Note

Implements a region scope (single-active per thread; tasks started within the region attach as children).

Note

All *_BASE() macros are enabled by default and will be used by supporting toolchains. The strings used/provided by these calls should follow the following rules:

  • Should NOT be deleted or modified to ensure correct visible names in profiling tools until CVS-179230 is implemented/resolved.

  • Should use string literals or constant strings when possible

Parameters:
  • domain – [in] Known at compile time name of module or library (the domain name).

  • handleOrRegionName – [in] The annotation name or handle for section of code. Parameter is optional.

  • metadata_key – [in] A metadata element’s key as a string. Parameter is optional.

  • metadata_value – [in] The metadata value. Parameter is optional.

OV_ITT_SCOPED_REGION(group, ...)#

Annotate region of code till scope exit to be profiled using known handle or regionName as section id.

In case if handle or regionName absent, the current function name is used.

Parameters:
  • group – [in] ITT counter group name used for enabling/disabling at compile time.

  • domainName – [in] Known at compile time name of module or library (the domain name).

  • handleOrRegionName – [in] The annotation name or handle for section of code. Parameter is optional.

OV_ITT_TASK_CHAIN(...)#

Begins the sequrence of an annotated sections of code using prefix and taskName as section id.

In case if prefix absent, the current function name is used, if taskName absent, the first chain index is used, i.e 1.

In case if prefix absent, the current function name is used, if taskName absent, the first chain index is used, i.e 1.

Parameters:
  • group – [in] ITT counter group name used for enabling/disabling at compile time.

  • chainId – [in] The tasks chain identifier.

  • domainName – [in] Known at compile time name of module or library (the domain name).

  • prefix – [in] The task chain name prefix. The task name starts with this prefix. Parameter is optional.

  • taskName – [in] The annotation name for section of code. Parameter is optional.

  • chainId – [in] The tasks chain identifier.

  • domainName – [in] Known at compile time name of module or library (the domain name).

  • prefix – [in] The task chain name prefix. The task name starts with this prefix. Parameter is optional.

  • taskName – [in] The annotation name for section of code. Parameter is optional.

OV_ITT_SCOPE_NEXT(group, ...)#

Inserts new annotated section of code to tasks chain using taskName as section id.

If taskName is missing, the current chain index is used.

Parameters:
  • group – [in] ITT counter group name used for enabling/disabling at compile time.

  • chainId – [in] The tasks chain identifier.

  • taskOrTaskName – [in] The annotation name or handle for section of code. Parameter is optional.

OV_ITT_SCOPE_SKIP(group, chainId)#

Skips the remaining task scope.

Parameters:
  • group – [in] ITT counter group name used for enabling/disabling at compile time.

  • chainId – [in] The tasks chain identifier.

OV_ITT_TASK_NEXT(...)#

Inserts new annotated section of code to tasks chain using taskName as section id.

If taskName is missing, the current chain index is used.

Parameters:
  • chainId – [in] The tasks chain identifier.

  • taskOrTaskName – [in] The annotation name or handle for section of code. Parameter is optional.

OV_ITT_TASK_SKIP(chainId)#

Skips the remaining task scope.

Parameters:
  • chainId – [in] The tasks chain identifier.

OV_ITT_REGION_BEGIN(group, domain, handleOrRegionName)#

Begin a region of code to be profiled using known handle or regionName as section id.

Parameters:
  • group – [in] ITT counter group name used for enabling/disabling at compile time.

  • domain – [in] Known at compile time name of module or library (the domain name).

  • handleOrRegionName – [in] The annotation name or handle for section of code.

OV_ITT_REGION_END(group, domain, handleOrRegionName)#

End a region of code to be profiled using known handle or regionName as section id.

Parameters:
  • group – [in] ITT counter group name used for enabling/disabling at compile time.

  • domain – [in] Known at compile time name of module or library (the domain name).

  • handleOrRegionName – [in] The annotation name or handle for section of code.

Typedefs

typedef struct openvino::itt::domain_ *domain_t#

A domain type which enables tagging trace data for different modules or libraries in a program.

typedef struct openvino::itt::handle_ *handle_t#

Annotation handle for section of code which would be named at runtime.

Functions

inline void threadName(const char *name)#

Set thread name using a char string.

Parameters:

name – [in] The thread name

inline handle_t handle(const char *name)#

Create annotation handle with a given name.

If template function is instantiated with a tag, the handle is created as a singleton.

Parameters:

name – [in] The annotation name

template<domain_t (*domain)()>
class ScopedTask#
#include <itt.hpp>

Used to annotate section of code which would be named at runtime.

Note

Uses ITT task begin/end. If a region is active on the current thread, tasks started within it are recorded as its children.

Template Parameters:

Thedomain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.

Public Functions

inline ScopedTask(handle_t taskHandle) noexcept#

Construct ScopedTask with defined annotation handle.

inline ScopedTask(handle_t taskHandle, const char *key, uint64_t value) noexcept#

Constructs a scoped task with an associated key-value metadata pair.

Creates an ITT (Intel Tracing Technology) scoped task that will automatically begin upon construction and end when the object goes out of scope (RAII pattern). This overload allows attaching custom metadata to the task for enhanced profiling.

See also

ScopedTask(handle_t) for the basic constructor without metadata.

Note

The task begins immediately upon construction via internal::taskBegin.

Note

The key string must remain valid for the duration of the task scope.

Note

This constructor is noexcept, ensuring exception safety in profiling code.

Parameters:
  • taskHandle – Handle identifying the task type for profiling tools.

  • key – String identifier for the metadata attribute (e.g., “InferenceID”).

  • value – Numeric value associated with the key (e.g., unique request ID).

inline ~ScopedTask() noexcept#

The ScopedTask destructor closes or ends the task scope.

template<domain_t (*domain)()>
class ScopedRegion#
#include <itt.hpp>

Used to annotate region of code which would be named at runtime using RAII.

Note

Uses ITT region begin/end. At most one region is active per thread; tasks started while a region is active attach to it as their parent.

Template Parameters:

Thedomain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.

Public Functions

inline ScopedRegion(handle_t handle) noexcept#

Construct ScopedRegion with defined annotation handle.

inline ScopedRegion(handle_t handle, const char *key, uint64_t value) noexcept#

Constructs a scoped region with metadata for ITT profiling.

Note

Region begins immediately and ends when object goes out of scope (RAII).

Note

The key string must remain valid for the region’s lifetime.

Parameters:
  • handle – Region identifier for profiling tools.

  • key – Metadata attribute name (e.g., “RequestID”).

  • value – Metadata numeric value associated with the key.

inline ~ScopedRegion() noexcept#

The ScopedRegion destructor closes or ends the region scope.

template<domain_t (*domain)()>
class TaskChain#
#include <itt.hpp>

Used to annotate a sequence of sections of code which would be named at runtime.

Template Parameters:

Thedomain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.

Public Functions

inline TaskChain(handle_t taskHandle, std::string &&prefix) noexcept#

Construct TaskChain with defined annotation handle.

inline ~TaskChain() noexcept#

The TaskChain destructor closes or ends the task scope.

inline void next(handle_t taskHandle)#

Ends the previous task from the chain and starts a new one with the given annotation handle.

namespace openvino#

openvino namespace

namespace cc#
template<typename Key, typename T>
class Factory#
template<typename Key, typename T, typename ...Args>
class Factory<Key, T(Args...)>#
#include <factory.h>
namespace internal#

Functions

template<typename T, typename C>
case_wrapper<C, T> make_case_wrapper(C &&val)#
template<template<typename...> class Fn, typename Ctx, typename T, typename Case>
bool match(Ctx &&ctx, T &&val, Case &&cs)#
template<template<typename...> class Fn, typename Ctx, typename T, typename Case, typename ...Cases>
bool match(Ctx &&ctx, T &&val, Case &&cs, Cases&&... cases)#
template<typename C, typename T>
struct case_wrapper#
#include <selective_build.h>
namespace itt#

Typedefs

typedef struct openvino::itt::domain_ *domain_t#

A domain type which enables tagging trace data for different modules or libraries in a program.

typedef struct openvino::itt::handle_ *handle_t#

Annotation handle for section of code which would be named at runtime.

Functions

inline void threadName(const char *name)#

Set thread name using a char string.

Parameters:

name – [in] The thread name

inline void threadName(const std::string &name)#
inline handle_t handle(const char *name)#

Create annotation handle with a given name.

If template function is instantiated with a tag, the handle is created as a singleton.

Parameters:

name – [in] The annotation name

inline handle_t handle(const std::string &name)#
template<typename Tag>
handle_t handle(handle_t h)#
struct domain_#
#include <itt.hpp>
struct handle_#
#include <itt.hpp>
template<domain_t (*domain)()>
class ScopedRegion
#include <itt.hpp>

Used to annotate region of code which would be named at runtime using RAII.

Note

Uses ITT region begin/end. At most one region is active per thread; tasks started while a region is active attach to it as their parent.

Template Parameters:

Thedomain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.

Public Functions

inline ScopedRegion(handle_t handle) noexcept

Construct ScopedRegion with defined annotation handle.

inline ScopedRegion(handle_t handle, const char *key, uint64_t value) noexcept

Constructs a scoped region with metadata for ITT profiling.

Note

Region begins immediately and ends when object goes out of scope (RAII).

Note

The key string must remain valid for the region’s lifetime.

Parameters:
  • handle – Region identifier for profiling tools.

  • key – Metadata attribute name (e.g., “RequestID”).

  • value – Metadata numeric value associated with the key.

inline ~ScopedRegion() noexcept

The ScopedRegion destructor closes or ends the region scope.

template<domain_t (*domain)()>
class ScopedTask
#include <itt.hpp>

Used to annotate section of code which would be named at runtime.

Note

Uses ITT task begin/end. If a region is active on the current thread, tasks started within it are recorded as its children.

Template Parameters:

Thedomain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.

Public Functions

inline ScopedTask(handle_t taskHandle) noexcept

Construct ScopedTask with defined annotation handle.

inline ScopedTask(handle_t taskHandle, const char *key, uint64_t value) noexcept

Constructs a scoped task with an associated key-value metadata pair.

Creates an ITT (Intel Tracing Technology) scoped task that will automatically begin upon construction and end when the object goes out of scope (RAII pattern). This overload allows attaching custom metadata to the task for enhanced profiling.

See also

ScopedTask(handle_t) for the basic constructor without metadata.

Note

The task begins immediately upon construction via internal::taskBegin.

Note

The key string must remain valid for the duration of the task scope.

Note

This constructor is noexcept, ensuring exception safety in profiling code.

Parameters:
  • taskHandle – Handle identifying the task type for profiling tools.

  • key – String identifier for the metadata attribute (e.g., “InferenceID”).

  • value – Numeric value associated with the key (e.g., unique request ID).

inline ~ScopedTask() noexcept

The ScopedTask destructor closes or ends the task scope.

template<domain_t (*domain)()>
class TaskChain
#include <itt.hpp>

Used to annotate a sequence of sections of code which would be named at runtime.

Template Parameters:

Thedomain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.

Public Functions

inline TaskChain(handle_t taskHandle, std::string &&prefix) noexcept

Construct TaskChain with defined annotation handle.

inline ~TaskChain() noexcept

The TaskChain destructor closes or ends the task scope.

inline void next(handle_t taskHandle)

Ends the previous task from the chain and starts a new one with the given annotation handle.