4867 lines · c
1 2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _ITTNOTIFY_H_11#define _ITTNOTIFY_H_12 13/**14@file15@brief Public User API functions and types16@mainpage17 18The Instrumentation and Tracing Technology API (ITT API) is used to19annotate a user's program with additional information20that can be used by correctness and performance tools. The user inserts21calls in their program. Those calls generate information that is collected22at runtime, and used by Intel(R) Threading Tools.23 24@section API Concepts25The following general concepts are used throughout the API.26 27@subsection Unicode Support28Many API functions take character string arguments. On Windows, there29are two versions of each such function. The function name is suffixed30by W if Unicode support is enabled, and by A otherwise. Any API function31that takes a character string argument adheres to this convention.32 33@subsection Conditional Compilation34Many users prefer having an option to modify ITT API code when linking it35inside their runtimes. ITT API header file provides a mechanism to replace36ITT API function names inside your code with empty strings. To do this,37define the macros INTEL_NO_ITTNOTIFY_API during compilation and remove the38static library from the linker script.39 40@subsection Domains41[see domains]42Domains provide a way to separate notification for different modules or43libraries in a program. Domains are specified by dotted character strings,44e.g. TBB.Internal.Control.45 46A mechanism (to be specified) is provided to enable and disable47domains. By default, all domains are enabled.48@subsection Named Entities and Instances49Named entities (frames, regions, tasks, and markers) communicate50information about the program to the analysis tools. A named entity often51refers to a section of program code, or to some set of logical concepts52that the programmer wants to group together.53 54Named entities relate to the programmer's static view of the program. When55the program actually executes, many instances of a given named entity56may be created.57 58The API annotations denote instances of named entities. The actual59named entities are displayed using the analysis tools. In other words,60the named entities come into existence when instances are created.61 62Instances of named entities may have instance identifiers (IDs). Some63API calls use instance identifiers to create relationships between64different instances of named entities. Other API calls associate data65with instances of named entities.66 67Some named entities must always have instance IDs. In particular, regions68and frames always have IDs. Task and markers need IDs only if the ID is69needed in another API call (such as adding a relation or metadata).70 71The lifetime of instance IDs is distinct from the lifetime of72instances. This allows various relationships to be specified separate73from the actual execution of instances. This flexibility comes at the74expense of extra API calls.75 76The same ID may not be reused for different instances, unless a previous77[ref] __itt_id_destroy call for that ID has been issued.78*/79 80/** @cond exclude_from_documentation */81#ifndef ITT_OS_WIN82#define ITT_OS_WIN 183#endif /* ITT_OS_WIN */84 85#ifndef ITT_OS_LINUX86#define ITT_OS_LINUX 287#endif /* ITT_OS_LINUX */88 89#ifndef ITT_OS_MAC90#define ITT_OS_MAC 391#endif /* ITT_OS_MAC */92 93#ifndef ITT_OS_FREEBSD94#define ITT_OS_FREEBSD 495#endif /* ITT_OS_FREEBSD */96 97#ifndef ITT_OS98#if defined WIN32 || defined _WIN3299#define ITT_OS ITT_OS_WIN100#elif defined(__APPLE__) && defined(__MACH__)101#define ITT_OS ITT_OS_MAC102#elif defined(__FreeBSD__)103#define ITT_OS ITT_OS_FREEBSD104#else105#define ITT_OS ITT_OS_LINUX106#endif107#endif /* ITT_OS */108 109#ifndef ITT_PLATFORM_WIN110#define ITT_PLATFORM_WIN 1111#endif /* ITT_PLATFORM_WIN */112 113#ifndef ITT_PLATFORM_POSIX114#define ITT_PLATFORM_POSIX 2115#endif /* ITT_PLATFORM_POSIX */116 117#ifndef ITT_PLATFORM_MAC118#define ITT_PLATFORM_MAC 3119#endif /* ITT_PLATFORM_MAC */120 121#ifndef ITT_PLATFORM_FREEBSD122#define ITT_PLATFORM_FREEBSD 4123#endif /* ITT_PLATFORM_FREEBSD */124 125#ifndef ITT_PLATFORM126#if ITT_OS == ITT_OS_WIN127#define ITT_PLATFORM ITT_PLATFORM_WIN128#elif ITT_OS == ITT_OS_MAC129#define ITT_PLATFORM ITT_PLATFORM_MAC130#elif ITT_OS == ITT_OS_FREEBSD131#define ITT_PLATFORM ITT_PLATFORM_FREEBSD132#else133#define ITT_PLATFORM ITT_PLATFORM_POSIX134#endif135#endif /* ITT_PLATFORM */136 137#if defined(_UNICODE) && !defined(UNICODE)138#define UNICODE139#endif140 141#include <stddef.h>142#if ITT_PLATFORM == ITT_PLATFORM_WIN143#include <tchar.h>144#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */145#include <stdint.h>146#if defined(UNICODE) || defined(_UNICODE)147#include <wchar.h>148#endif /* UNICODE || _UNICODE */149#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */150 151#ifndef ITTAPI_CDECL152#if ITT_PLATFORM == ITT_PLATFORM_WIN153#define ITTAPI_CDECL __cdecl154#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */155#if defined _M_IX86 || defined __i386__156#define ITTAPI_CDECL __attribute__((cdecl))157#else /* _M_IX86 || __i386__ */158#define ITTAPI_CDECL /* actual only on x86 platform */159#endif /* _M_IX86 || __i386__ */160#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */161#endif /* ITTAPI_CDECL */162 163#ifndef STDCALL164#if ITT_PLATFORM == ITT_PLATFORM_WIN165#define STDCALL __stdcall166#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */167#if defined _M_IX86 || defined __i386__168#define STDCALL __attribute__((stdcall))169#else /* _M_IX86 || __i386__ */170#define STDCALL /* supported only on x86 platform */171#endif /* _M_IX86 || __i386__ */172#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */173#endif /* STDCALL */174 175#define ITTAPI ITTAPI_CDECL176#define LIBITTAPI ITTAPI_CDECL177 178/* TODO: Temporary for compatibility! */179#define ITTAPI_CALL ITTAPI_CDECL180#define LIBITTAPI_CALL ITTAPI_CDECL181 182#if ITT_PLATFORM == ITT_PLATFORM_WIN183/* use __forceinline (VC++ specific) */184#if defined(__MINGW32__) && !defined(__cplusplus)185#define ITT_INLINE \186 static __inline__ __attribute__((__always_inline__, __gnu_inline__))187#else188#define ITT_INLINE static __forceinline189#endif /* __MINGW32__ */190 191#define ITT_INLINE_ATTRIBUTE /* nothing */192#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */193/*194 * Generally, functions are not inlined unless optimization is specified.195 * For functions declared inline, this attribute inlines the function even196 * if no optimization level was specified.197 */198#ifdef __STRICT_ANSI__199#define ITT_INLINE static200#define ITT_INLINE_ATTRIBUTE __attribute__((unused))201#else /* __STRICT_ANSI__ */202#define ITT_INLINE static inline203#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))204#endif /* __STRICT_ANSI__ */205#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */206/** @endcond */207 208#ifdef INTEL_ITTNOTIFY_ENABLE_LEGACY209#if ITT_PLATFORM == ITT_PLATFORM_WIN210#pragma message( \211 "WARNING!!! Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro")212#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */213#warning \214 "Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro"215#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */216#include "legacy/ittnotify.h"217#endif /* INTEL_ITTNOTIFY_ENABLE_LEGACY */218 219/** @cond exclude_from_documentation */220/* Helper macro for joining tokens */221#define ITT_JOIN_AUX(p, n) p##n222#define ITT_JOIN(p, n) ITT_JOIN_AUX(p, n)223 224#ifdef ITT_MAJOR225#undef ITT_MAJOR226#endif227#ifdef ITT_MINOR228#undef ITT_MINOR229#endif230#define ITT_MAJOR 3231#define ITT_MINOR 0232 233/* Standard versioning of a token with major and minor version numbers */234#define ITT_VERSIONIZE(x) \235 ITT_JOIN(x, ITT_JOIN(_, ITT_JOIN(ITT_MAJOR, ITT_JOIN(_, ITT_MINOR))))236 237#ifndef INTEL_ITTNOTIFY_PREFIX238#define INTEL_ITTNOTIFY_PREFIX __itt_239#endif /* INTEL_ITTNOTIFY_PREFIX */240#ifndef INTEL_ITTNOTIFY_POSTFIX241#define INTEL_ITTNOTIFY_POSTFIX _ptr_242#endif /* INTEL_ITTNOTIFY_POSTFIX */243 244#define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, n)245#define ITTNOTIFY_NAME(n) \246 ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n, INTEL_ITTNOTIFY_POSTFIX)))247 248#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)249#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)250 251#define ITTNOTIFY_VOID_D0(n, d) \252 (!(d)->flags) ? (void)0 \253 : (!ITTNOTIFY_NAME(n)) ? (void)0 \254 : ITTNOTIFY_NAME(n)(d)255#define ITTNOTIFY_VOID_D1(n, d, x) \256 (!(d)->flags) ? (void)0 \257 : (!ITTNOTIFY_NAME(n)) ? (void)0 \258 : ITTNOTIFY_NAME(n)(d, x)259#define ITTNOTIFY_VOID_D2(n, d, x, y) \260 (!(d)->flags) ? (void)0 \261 : (!ITTNOTIFY_NAME(n)) ? (void)0 \262 : ITTNOTIFY_NAME(n)(d, x, y)263#define ITTNOTIFY_VOID_D3(n, d, x, y, z) \264 (!(d)->flags) ? (void)0 \265 : (!ITTNOTIFY_NAME(n)) ? (void)0 \266 : ITTNOTIFY_NAME(n)(d, x, y, z)267#define ITTNOTIFY_VOID_D4(n, d, x, y, z, a) \268 (!(d)->flags) ? (void)0 \269 : (!ITTNOTIFY_NAME(n)) ? (void)0 \270 : ITTNOTIFY_NAME(n)(d, x, y, z, a)271#define ITTNOTIFY_VOID_D5(n, d, x, y, z, a, b) \272 (!(d)->flags) ? (void)0 \273 : (!ITTNOTIFY_NAME(n)) ? (void)0 \274 : ITTNOTIFY_NAME(n)(d, x, y, z, a, b)275#define ITTNOTIFY_VOID_D6(n, d, x, y, z, a, b, c) \276 (!(d)->flags) ? (void)0 \277 : (!ITTNOTIFY_NAME(n)) ? (void)0 \278 : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c)279#define ITTNOTIFY_DATA_D0(n, d) \280 (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)281#define ITTNOTIFY_DATA_D1(n, d, x) \282 (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x)283#define ITTNOTIFY_DATA_D2(n, d, x, y) \284 (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y)285#define ITTNOTIFY_DATA_D3(n, d, x, y, z) \286 (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y, z)287#define ITTNOTIFY_DATA_D4(n, d, x, y, z, a) \288 (!(d)->flags) ? 0 \289 : (!ITTNOTIFY_NAME(n)) ? 0 \290 : ITTNOTIFY_NAME(n)(d, x, y, z, a)291#define ITTNOTIFY_DATA_D5(n, d, x, y, z, a, b) \292 (!(d)->flags) ? 0 \293 : (!ITTNOTIFY_NAME(n)) ? 0 \294 : ITTNOTIFY_NAME(n)(d, x, y, z, a, b)295#define ITTNOTIFY_DATA_D6(n, d, x, y, z, a, b, c) \296 (!(d)->flags) ? 0 \297 : (!ITTNOTIFY_NAME(n)) ? 0 \298 : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c)299 300#ifdef ITT_STUB301#undef ITT_STUB302#endif303#ifdef ITT_STUBV304#undef ITT_STUBV305#endif306#define ITT_STUBV(api, type, name, args) \307 typedef type(api *ITT_JOIN(ITTNOTIFY_NAME(name), _t)) args; \308 extern ITT_JOIN(ITTNOTIFY_NAME(name), _t) ITTNOTIFY_NAME(name);309#define ITT_STUB ITT_STUBV310/** @endcond */311 312#ifdef __cplusplus313extern "C" {314#endif /* __cplusplus */315 316/** @cond exclude_from_gpa_documentation */317/**318 * @defgroup public Public API319 * @{320 * @}321 */322 323/**324 * @defgroup control Collection Control325 * @ingroup public326 * General behavior: application continues to run, but no profiling information327 * is being collected328 *329 * Pausing occurs not only for the current thread but for all process as well as330 * spawned processes331 * - Intel(R) Parallel Inspector and Intel(R) Inspector XE:332 * - Does not analyze or report errors that involve memory access.333 * - Other errors are reported as usual. Pausing data collection in334 * Intel(R) Parallel Inspector and Intel(R) Inspector XE335 * only pauses tracing and analyzing memory access.336 * It does not pause tracing or analyzing threading APIs.337 * .338 * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:339 * - Does continue to record when new threads are started.340 * .341 * - Other effects:342 * - Possible reduction of runtime overhead.343 * .344 * @{345 */346/** @brief Pause collection */347void ITTAPI __itt_pause(void);348/** @brief Resume collection */349void ITTAPI __itt_resume(void);350/** @brief Detach collection */351void ITTAPI __itt_detach(void);352 353/** @cond exclude_from_documentation */354#ifndef INTEL_NO_MACRO_BODY355#ifndef INTEL_NO_ITTNOTIFY_API356ITT_STUBV(ITTAPI, void, pause, (void))357ITT_STUBV(ITTAPI, void, resume, (void))358ITT_STUBV(ITTAPI, void, detach, (void))359#define __itt_pause ITTNOTIFY_VOID(pause)360#define __itt_pause_ptr ITTNOTIFY_NAME(pause)361#define __itt_resume ITTNOTIFY_VOID(resume)362#define __itt_resume_ptr ITTNOTIFY_NAME(resume)363#define __itt_detach ITTNOTIFY_VOID(detach)364#define __itt_detach_ptr ITTNOTIFY_NAME(detach)365#else /* INTEL_NO_ITTNOTIFY_API */366#define __itt_pause()367#define __itt_pause_ptr 0368#define __itt_resume()369#define __itt_resume_ptr 0370#define __itt_detach()371#define __itt_detach_ptr 0372#endif /* INTEL_NO_ITTNOTIFY_API */373#else /* INTEL_NO_MACRO_BODY */374#define __itt_pause_ptr 0375#define __itt_resume_ptr 0376#define __itt_detach_ptr 0377#endif /* INTEL_NO_MACRO_BODY */378/** @endcond */379/** @} control group */380/** @endcond */381 382/**383 * @defgroup Intel Processor Trace control384 * API from this group provides control over collection and analysis of Intel385 * Processor Trace (Intel PT) data Information about Intel Processor Trace386 * technology can be found here (Volume 3 chapter 35):387 * https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf388 * Use this API to mark particular code regions for loading detailed performance389 * statistics. This mode makes your analysis faster and more accurate.390 * @{391 */392typedef unsigned char __itt_pt_region;393 394/**395 * @brief function saves a region name marked with Intel PT API and returns a396 * region id. Only 7 names can be registered. Attempts to register more names397 * will be ignored and a region id with auto names will be returned. For398 * automatic naming of regions pass NULL as function parameter399 */400#if ITT_PLATFORM == ITT_PLATFORM_WIN401__itt_pt_region ITTAPI __itt_pt_region_createA(const char *name);402__itt_pt_region ITTAPI __itt_pt_region_createW(const wchar_t *name);403#if defined(UNICODE) || defined(_UNICODE)404#define __itt_pt_region_create __itt_pt_region_createW405#else /* UNICODE */406#define __itt_pt_region_create __itt_pt_region_createA407#endif /* UNICODE */408#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */409__itt_pt_region ITTAPI __itt_pt_region_create(const char *name);410#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */411 412/** @cond exclude_from_documentation */413#ifndef INTEL_NO_MACRO_BODY414#ifndef INTEL_NO_ITTNOTIFY_API415#if ITT_PLATFORM == ITT_PLATFORM_WIN416ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name))417ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name))418#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */419ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name))420#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */421#if ITT_PLATFORM == ITT_PLATFORM_WIN422#define __itt_pt_region_createA ITTNOTIFY_DATA(pt_region_createA)423#define __itt_pt_region_createA_ptr ITTNOTIFY_NAME(pt_region_createA)424#define __itt_pt_region_createW ITTNOTIFY_DATA(pt_region_createW)425#define __itt_pt_region_createW_ptr ITTNOTIFY_NAME(pt_region_createW)426#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */427#define __itt_pt_region_create ITTNOTIFY_DATA(pt_region_create)428#define __itt_pt_region_create_ptr ITTNOTIFY_NAME(pt_region_create)429#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */430#else /* INTEL_NO_ITTNOTIFY_API */431#if ITT_PLATFORM == ITT_PLATFORM_WIN432#define __itt_pt_region_createA(name) (__itt_pt_region)0433#define __itt_pt_region_createA_ptr 0434#define __itt_pt_region_createW(name) (__itt_pt_region)0435#define __itt_pt_region_createW_ptr 0436#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */437#define __itt_pt_region_create(name) (__itt_pt_region)0438#define __itt_pt_region_create_ptr 0439#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */440#endif /* INTEL_NO_ITTNOTIFY_API */441#else /* INTEL_NO_MACRO_BODY */442#if ITT_PLATFORM == ITT_PLATFORM_WIN443#define __itt_pt_region_createA_ptr 0444#define __itt_pt_region_createW_ptr 0445#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */446#define __itt_pt_region_create_ptr 0447#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */448#endif /* INTEL_NO_MACRO_BODY */449/** @endcond */450 451/**452 * @brief function contains a special code pattern identified on the453 * post-processing stage and marks the beginning of a code region targeted for454 * Intel PT analysis455 * @param[in] region - region id, 0 <= region < 8456 */457void __itt_mark_pt_region_begin(__itt_pt_region region);458/**459 * @brief function contains a special code pattern identified on the460 * post-processing stage and marks the end of a code region targeted for Intel461 * PT analysis462 * @param[in] region - region id, 0 <= region < 8463 */464void __itt_mark_pt_region_end(__itt_pt_region region);465/** @} Intel PT control group*/466 467/**468 * @defgroup threads Threads469 * @ingroup public470 * Give names to threads471 * @{472 */473/**474 * @brief Sets thread name of calling thread475 * @param[in] name - name of thread476 */477#if ITT_PLATFORM == ITT_PLATFORM_WIN478void ITTAPI __itt_thread_set_nameA(const char *name);479void ITTAPI __itt_thread_set_nameW(const wchar_t *name);480#if defined(UNICODE) || defined(_UNICODE)481#define __itt_thread_set_name __itt_thread_set_nameW482#define __itt_thread_set_name_ptr __itt_thread_set_nameW_ptr483#else /* UNICODE */484#define __itt_thread_set_name __itt_thread_set_nameA485#define __itt_thread_set_name_ptr __itt_thread_set_nameA_ptr486#endif /* UNICODE */487#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */488void ITTAPI __itt_thread_set_name(const char *name);489#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */490 491/** @cond exclude_from_documentation */492#ifndef INTEL_NO_MACRO_BODY493#ifndef INTEL_NO_ITTNOTIFY_API494#if ITT_PLATFORM == ITT_PLATFORM_WIN495ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name))496ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name))497#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */498ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name))499#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */500#if ITT_PLATFORM == ITT_PLATFORM_WIN501#define __itt_thread_set_nameA ITTNOTIFY_VOID(thread_set_nameA)502#define __itt_thread_set_nameA_ptr ITTNOTIFY_NAME(thread_set_nameA)503#define __itt_thread_set_nameW ITTNOTIFY_VOID(thread_set_nameW)504#define __itt_thread_set_nameW_ptr ITTNOTIFY_NAME(thread_set_nameW)505#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */506#define __itt_thread_set_name ITTNOTIFY_VOID(thread_set_name)507#define __itt_thread_set_name_ptr ITTNOTIFY_NAME(thread_set_name)508#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */509#else /* INTEL_NO_ITTNOTIFY_API */510#if ITT_PLATFORM == ITT_PLATFORM_WIN511#define __itt_thread_set_nameA(name)512#define __itt_thread_set_nameA_ptr 0513#define __itt_thread_set_nameW(name)514#define __itt_thread_set_nameW_ptr 0515#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */516#define __itt_thread_set_name(name)517#define __itt_thread_set_name_ptr 0518#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */519#endif /* INTEL_NO_ITTNOTIFY_API */520#else /* INTEL_NO_MACRO_BODY */521#if ITT_PLATFORM == ITT_PLATFORM_WIN522#define __itt_thread_set_nameA_ptr 0523#define __itt_thread_set_nameW_ptr 0524#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */525#define __itt_thread_set_name_ptr 0526#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */527#endif /* INTEL_NO_MACRO_BODY */528/** @endcond */529 530/** @cond exclude_from_gpa_documentation */531 532/**533 * @brief Mark current thread as ignored from this point on, for the duration of534 * its existence.535 */536void ITTAPI __itt_thread_ignore(void);537 538/** @cond exclude_from_documentation */539#ifndef INTEL_NO_MACRO_BODY540#ifndef INTEL_NO_ITTNOTIFY_API541ITT_STUBV(ITTAPI, void, thread_ignore, (void))542#define __itt_thread_ignore ITTNOTIFY_VOID(thread_ignore)543#define __itt_thread_ignore_ptr ITTNOTIFY_NAME(thread_ignore)544#else /* INTEL_NO_ITTNOTIFY_API */545#define __itt_thread_ignore()546#define __itt_thread_ignore_ptr 0547#endif /* INTEL_NO_ITTNOTIFY_API */548#else /* INTEL_NO_MACRO_BODY */549#define __itt_thread_ignore_ptr 0550#endif /* INTEL_NO_MACRO_BODY */551/** @endcond */552/** @} threads group */553 554/**555 * @defgroup suppress Error suppression556 * @ingroup public557 * General behavior: application continues to run, but errors are suppressed558 *559 * @{560 */561 562/*********************************************************************563 * @name group of functions used for error suppression in correctness tools564 *********************************************************************/565/** @{ */566/**567 * @hideinitializer568 * @brief possible value for suppression mask569 */570#define __itt_suppress_all_errors 0x7fffffff571 572/**573 * @hideinitializer574 * @brief possible value for suppression mask (suppresses errors from threading575 * analysis)576 */577#define __itt_suppress_threading_errors 0x000000ff578 579/**580 * @hideinitializer581 * @brief possible value for suppression mask (suppresses errors from memory582 * analysis)583 */584#define __itt_suppress_memory_errors 0x0000ff00585 586/**587 * @brief Start suppressing errors identified in mask on this thread588 */589void ITTAPI __itt_suppress_push(unsigned int mask);590 591/** @cond exclude_from_documentation */592#ifndef INTEL_NO_MACRO_BODY593#ifndef INTEL_NO_ITTNOTIFY_API594ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask))595#define __itt_suppress_push ITTNOTIFY_VOID(suppress_push)596#define __itt_suppress_push_ptr ITTNOTIFY_NAME(suppress_push)597#else /* INTEL_NO_ITTNOTIFY_API */598#define __itt_suppress_push(mask)599#define __itt_suppress_push_ptr 0600#endif /* INTEL_NO_ITTNOTIFY_API */601#else /* INTEL_NO_MACRO_BODY */602#define __itt_suppress_push_ptr 0603#endif /* INTEL_NO_MACRO_BODY */604/** @endcond */605 606/**607 * @brief Undo the effects of the matching call to __itt_suppress_push608 */609void ITTAPI __itt_suppress_pop(void);610 611/** @cond exclude_from_documentation */612#ifndef INTEL_NO_MACRO_BODY613#ifndef INTEL_NO_ITTNOTIFY_API614ITT_STUBV(ITTAPI, void, suppress_pop, (void))615#define __itt_suppress_pop ITTNOTIFY_VOID(suppress_pop)616#define __itt_suppress_pop_ptr ITTNOTIFY_NAME(suppress_pop)617#else /* INTEL_NO_ITTNOTIFY_API */618#define __itt_suppress_pop()619#define __itt_suppress_pop_ptr 0620#endif /* INTEL_NO_ITTNOTIFY_API */621#else /* INTEL_NO_MACRO_BODY */622#define __itt_suppress_pop_ptr 0623#endif /* INTEL_NO_MACRO_BODY */624/** @endcond */625 626/**627 * @enum __itt_model_disable628 * @brief Enumerator for the disable methods629 */630typedef enum __itt_suppress_mode {631 __itt_unsuppress_range,632 __itt_suppress_range633} __itt_suppress_mode_t;634 635/**636 * @brief Mark a range of memory for error suppression or unsuppression for637 * error types included in mask638 */639void ITTAPI __itt_suppress_mark_range(__itt_suppress_mode_t mode,640 unsigned int mask, void *address,641 size_t size);642 643/** @cond exclude_from_documentation */644#ifndef INTEL_NO_MACRO_BODY645#ifndef INTEL_NO_ITTNOTIFY_API646ITT_STUBV(ITTAPI, void, suppress_mark_range,647 (__itt_suppress_mode_t mode, unsigned int mask, void *address,648 size_t size))649#define __itt_suppress_mark_range ITTNOTIFY_VOID(suppress_mark_range)650#define __itt_suppress_mark_range_ptr ITTNOTIFY_NAME(suppress_mark_range)651#else /* INTEL_NO_ITTNOTIFY_API */652#define __itt_suppress_mark_range(mask)653#define __itt_suppress_mark_range_ptr 0654#endif /* INTEL_NO_ITTNOTIFY_API */655#else /* INTEL_NO_MACRO_BODY */656#define __itt_suppress_mark_range_ptr 0657#endif /* INTEL_NO_MACRO_BODY */658/** @endcond */659 660/**661 * @brief Undo the effect of a matching call to __itt_suppress_mark_range. If662 * not matching call is found, nothing is changed.663 */664void ITTAPI __itt_suppress_clear_range(__itt_suppress_mode_t mode,665 unsigned int mask, void *address,666 size_t size);667 668/** @cond exclude_from_documentation */669#ifndef INTEL_NO_MACRO_BODY670#ifndef INTEL_NO_ITTNOTIFY_API671ITT_STUBV(ITTAPI, void, suppress_clear_range,672 (__itt_suppress_mode_t mode, unsigned int mask, void *address,673 size_t size))674#define __itt_suppress_clear_range ITTNOTIFY_VOID(suppress_clear_range)675#define __itt_suppress_clear_range_ptr ITTNOTIFY_NAME(suppress_clear_range)676#else /* INTEL_NO_ITTNOTIFY_API */677#define __itt_suppress_clear_range(mask)678#define __itt_suppress_clear_range_ptr 0679#endif /* INTEL_NO_ITTNOTIFY_API */680#else /* INTEL_NO_MACRO_BODY */681#define __itt_suppress_clear_range_ptr 0682#endif /* INTEL_NO_MACRO_BODY */683/** @endcond */684/** @} */685/** @} suppress group */686 687/**688 * @defgroup sync Synchronization689 * @ingroup public690 * Indicate user-written synchronization code691 * @{692 */693/**694 * @hideinitializer695 * @brief possible value of attribute argument for sync object type696 */697#define __itt_attr_barrier 1698 699/**700 * @hideinitializer701 * @brief possible value of attribute argument for sync object type702 */703#define __itt_attr_mutex 2704 705/**706@brief Name a synchronization object707@param[in] addr Handle for the synchronization object. You should708use a real address to uniquely identify the synchronization object.709@param[in] objtype null-terminated object type string. If NULL is710passed, the name will be "User Synchronization".711@param[in] objname null-terminated object name string. If NULL,712no name will be assigned to the object.713@param[in] attribute one of [#__itt_attr_barrier, #__itt_attr_mutex]714 */715 716#if ITT_PLATFORM == ITT_PLATFORM_WIN717void ITTAPI __itt_sync_createA(void *addr, const char *objtype,718 const char *objname, int attribute);719void ITTAPI __itt_sync_createW(void *addr, const wchar_t *objtype,720 const wchar_t *objname, int attribute);721#if defined(UNICODE) || defined(_UNICODE)722#define __itt_sync_create __itt_sync_createW723#define __itt_sync_create_ptr __itt_sync_createW_ptr724#else /* UNICODE */725#define __itt_sync_create __itt_sync_createA726#define __itt_sync_create_ptr __itt_sync_createA_ptr727#endif /* UNICODE */728#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */729void ITTAPI __itt_sync_create(void *addr, const char *objtype,730 const char *objname, int attribute);731#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */732 733/** @cond exclude_from_documentation */734#ifndef INTEL_NO_MACRO_BODY735#ifndef INTEL_NO_ITTNOTIFY_API736#if ITT_PLATFORM == ITT_PLATFORM_WIN737ITT_STUBV(ITTAPI, void, sync_createA,738 (void *addr, const char *objtype, const char *objname, int attribute))739ITT_STUBV(ITTAPI, void, sync_createW,740 (void *addr, const wchar_t *objtype, const wchar_t *objname,741 int attribute))742#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */743ITT_STUBV(ITTAPI, void, sync_create,744 (void *addr, const char *objtype, const char *objname, int attribute))745#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */746#if ITT_PLATFORM == ITT_PLATFORM_WIN747#define __itt_sync_createA ITTNOTIFY_VOID(sync_createA)748#define __itt_sync_createA_ptr ITTNOTIFY_NAME(sync_createA)749#define __itt_sync_createW ITTNOTIFY_VOID(sync_createW)750#define __itt_sync_createW_ptr ITTNOTIFY_NAME(sync_createW)751#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */752#define __itt_sync_create ITTNOTIFY_VOID(sync_create)753#define __itt_sync_create_ptr ITTNOTIFY_NAME(sync_create)754#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */755#else /* INTEL_NO_ITTNOTIFY_API */756#if ITT_PLATFORM == ITT_PLATFORM_WIN757#define __itt_sync_createA(addr, objtype, objname, attribute)758#define __itt_sync_createA_ptr 0759#define __itt_sync_createW(addr, objtype, objname, attribute)760#define __itt_sync_createW_ptr 0761#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */762#define __itt_sync_create(addr, objtype, objname, attribute)763#define __itt_sync_create_ptr 0764#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */765#endif /* INTEL_NO_ITTNOTIFY_API */766#else /* INTEL_NO_MACRO_BODY */767#if ITT_PLATFORM == ITT_PLATFORM_WIN768#define __itt_sync_createA_ptr 0769#define __itt_sync_createW_ptr 0770#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */771#define __itt_sync_create_ptr 0772#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */773#endif /* INTEL_NO_MACRO_BODY */774/** @endcond */775 776/**777@brief Rename a synchronization object778 779You can use the rename call to assign or reassign a name to a given780synchronization object.781@param[in] addr handle for the synchronization object.782@param[in] name null-terminated object name string.783*/784#if ITT_PLATFORM == ITT_PLATFORM_WIN785void ITTAPI __itt_sync_renameA(void *addr, const char *name);786void ITTAPI __itt_sync_renameW(void *addr, const wchar_t *name);787#if defined(UNICODE) || defined(_UNICODE)788#define __itt_sync_rename __itt_sync_renameW789#define __itt_sync_rename_ptr __itt_sync_renameW_ptr790#else /* UNICODE */791#define __itt_sync_rename __itt_sync_renameA792#define __itt_sync_rename_ptr __itt_sync_renameA_ptr793#endif /* UNICODE */794#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */795void ITTAPI __itt_sync_rename(void *addr, const char *name);796#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */797 798/** @cond exclude_from_documentation */799#ifndef INTEL_NO_MACRO_BODY800#ifndef INTEL_NO_ITTNOTIFY_API801#if ITT_PLATFORM == ITT_PLATFORM_WIN802ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name))803ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name))804#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */805ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name))806#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */807#if ITT_PLATFORM == ITT_PLATFORM_WIN808#define __itt_sync_renameA ITTNOTIFY_VOID(sync_renameA)809#define __itt_sync_renameA_ptr ITTNOTIFY_NAME(sync_renameA)810#define __itt_sync_renameW ITTNOTIFY_VOID(sync_renameW)811#define __itt_sync_renameW_ptr ITTNOTIFY_NAME(sync_renameW)812#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */813#define __itt_sync_rename ITTNOTIFY_VOID(sync_rename)814#define __itt_sync_rename_ptr ITTNOTIFY_NAME(sync_rename)815#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */816#else /* INTEL_NO_ITTNOTIFY_API */817#if ITT_PLATFORM == ITT_PLATFORM_WIN818#define __itt_sync_renameA(addr, name)819#define __itt_sync_renameA_ptr 0820#define __itt_sync_renameW(addr, name)821#define __itt_sync_renameW_ptr 0822#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */823#define __itt_sync_rename(addr, name)824#define __itt_sync_rename_ptr 0825#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */826#endif /* INTEL_NO_ITTNOTIFY_API */827#else /* INTEL_NO_MACRO_BODY */828#if ITT_PLATFORM == ITT_PLATFORM_WIN829#define __itt_sync_renameA_ptr 0830#define __itt_sync_renameW_ptr 0831#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */832#define __itt_sync_rename_ptr 0833#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */834#endif /* INTEL_NO_MACRO_BODY */835/** @endcond */836 837/**838 @brief Destroy a synchronization object.839 @param addr Handle for the synchronization object.840 */841void ITTAPI __itt_sync_destroy(void *addr);842 843/** @cond exclude_from_documentation */844#ifndef INTEL_NO_MACRO_BODY845#ifndef INTEL_NO_ITTNOTIFY_API846ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr))847#define __itt_sync_destroy ITTNOTIFY_VOID(sync_destroy)848#define __itt_sync_destroy_ptr ITTNOTIFY_NAME(sync_destroy)849#else /* INTEL_NO_ITTNOTIFY_API */850#define __itt_sync_destroy(addr)851#define __itt_sync_destroy_ptr 0852#endif /* INTEL_NO_ITTNOTIFY_API */853#else /* INTEL_NO_MACRO_BODY */854#define __itt_sync_destroy_ptr 0855#endif /* INTEL_NO_MACRO_BODY */856/** @endcond */857 858/*********************************************************************859 * @name group of functions is used for performance measurement tools860 *********************************************************************/861/** @{ */862/**863 * @brief Enter spin loop on user-defined sync object864 */865void ITTAPI __itt_sync_prepare(void *addr);866 867/** @cond exclude_from_documentation */868#ifndef INTEL_NO_MACRO_BODY869#ifndef INTEL_NO_ITTNOTIFY_API870ITT_STUBV(ITTAPI, void, sync_prepare, (void *addr))871#define __itt_sync_prepare ITTNOTIFY_VOID(sync_prepare)872#define __itt_sync_prepare_ptr ITTNOTIFY_NAME(sync_prepare)873#else /* INTEL_NO_ITTNOTIFY_API */874#define __itt_sync_prepare(addr)875#define __itt_sync_prepare_ptr 0876#endif /* INTEL_NO_ITTNOTIFY_API */877#else /* INTEL_NO_MACRO_BODY */878#define __itt_sync_prepare_ptr 0879#endif /* INTEL_NO_MACRO_BODY */880/** @endcond */881 882/**883 * @brief Quit spin loop without acquiring spin object884 */885void ITTAPI __itt_sync_cancel(void *addr);886 887/** @cond exclude_from_documentation */888#ifndef INTEL_NO_MACRO_BODY889#ifndef INTEL_NO_ITTNOTIFY_API890ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr))891#define __itt_sync_cancel ITTNOTIFY_VOID(sync_cancel)892#define __itt_sync_cancel_ptr ITTNOTIFY_NAME(sync_cancel)893#else /* INTEL_NO_ITTNOTIFY_API */894#define __itt_sync_cancel(addr)895#define __itt_sync_cancel_ptr 0896#endif /* INTEL_NO_ITTNOTIFY_API */897#else /* INTEL_NO_MACRO_BODY */898#define __itt_sync_cancel_ptr 0899#endif /* INTEL_NO_MACRO_BODY */900/** @endcond */901 902/**903 * @brief Successful spin loop completion (sync object acquired)904 */905void ITTAPI __itt_sync_acquired(void *addr);906 907/** @cond exclude_from_documentation */908#ifndef INTEL_NO_MACRO_BODY909#ifndef INTEL_NO_ITTNOTIFY_API910ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr))911#define __itt_sync_acquired ITTNOTIFY_VOID(sync_acquired)912#define __itt_sync_acquired_ptr ITTNOTIFY_NAME(sync_acquired)913#else /* INTEL_NO_ITTNOTIFY_API */914#define __itt_sync_acquired(addr)915#define __itt_sync_acquired_ptr 0916#endif /* INTEL_NO_ITTNOTIFY_API */917#else /* INTEL_NO_MACRO_BODY */918#define __itt_sync_acquired_ptr 0919#endif /* INTEL_NO_MACRO_BODY */920/** @endcond */921 922/**923 * @brief Start sync object releasing code. Is called before the lock release924 * call.925 */926void ITTAPI __itt_sync_releasing(void *addr);927 928/** @cond exclude_from_documentation */929#ifndef INTEL_NO_MACRO_BODY930#ifndef INTEL_NO_ITTNOTIFY_API931ITT_STUBV(ITTAPI, void, sync_releasing, (void *addr))932#define __itt_sync_releasing ITTNOTIFY_VOID(sync_releasing)933#define __itt_sync_releasing_ptr ITTNOTIFY_NAME(sync_releasing)934#else /* INTEL_NO_ITTNOTIFY_API */935#define __itt_sync_releasing(addr)936#define __itt_sync_releasing_ptr 0937#endif /* INTEL_NO_ITTNOTIFY_API */938#else /* INTEL_NO_MACRO_BODY */939#define __itt_sync_releasing_ptr 0940#endif /* INTEL_NO_MACRO_BODY */941/** @endcond */942/** @} */943 944/** @} sync group */945 946/******************************************************************947 * @name group of functions is used for correctness checking tools948 ******************************************************************/949/** @{ */950/**951 * @ingroup legacy952 * @deprecated Legacy API953 * @brief Fast synchronization which does no require spinning.954 * - This special function is to be used by TBB and OpenMP libraries only when955 * they know there is no spin but they need to suppress TC warnings about shared956 * variable modifications.957 * - It only has corresponding pointers in static library and does not have958 * corresponding function in dynamic library.959 * @see void __itt_sync_prepare(void* addr);960 */961void ITTAPI __itt_fsync_prepare(void *addr);962 963/** @cond exclude_from_documentation */964#ifndef INTEL_NO_MACRO_BODY965#ifndef INTEL_NO_ITTNOTIFY_API966ITT_STUBV(ITTAPI, void, fsync_prepare, (void *addr))967#define __itt_fsync_prepare ITTNOTIFY_VOID(fsync_prepare)968#define __itt_fsync_prepare_ptr ITTNOTIFY_NAME(fsync_prepare)969#else /* INTEL_NO_ITTNOTIFY_API */970#define __itt_fsync_prepare(addr)971#define __itt_fsync_prepare_ptr 0972#endif /* INTEL_NO_ITTNOTIFY_API */973#else /* INTEL_NO_MACRO_BODY */974#define __itt_fsync_prepare_ptr 0975#endif /* INTEL_NO_MACRO_BODY */976/** @endcond */977 978/**979 * @ingroup legacy980 * @deprecated Legacy API981 * @brief Fast synchronization which does no require spinning.982 * - This special function is to be used by TBB and OpenMP libraries only when983 * they know there is no spin but they need to suppress TC warnings about shared984 * variable modifications.985 * - It only has corresponding pointers in static library and does not have986 * corresponding function in dynamic library.987 * @see void __itt_sync_cancel(void *addr);988 */989void ITTAPI __itt_fsync_cancel(void *addr);990 991/** @cond exclude_from_documentation */992#ifndef INTEL_NO_MACRO_BODY993#ifndef INTEL_NO_ITTNOTIFY_API994ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr))995#define __itt_fsync_cancel ITTNOTIFY_VOID(fsync_cancel)996#define __itt_fsync_cancel_ptr ITTNOTIFY_NAME(fsync_cancel)997#else /* INTEL_NO_ITTNOTIFY_API */998#define __itt_fsync_cancel(addr)999#define __itt_fsync_cancel_ptr 01000#endif /* INTEL_NO_ITTNOTIFY_API */1001#else /* INTEL_NO_MACRO_BODY */1002#define __itt_fsync_cancel_ptr 01003#endif /* INTEL_NO_MACRO_BODY */1004/** @endcond */1005 1006/**1007 * @ingroup legacy1008 * @deprecated Legacy API1009 * @brief Fast synchronization which does no require spinning.1010 * - This special function is to be used by TBB and OpenMP libraries only when1011 * they know there is no spin but they need to suppress TC warnings about shared1012 * variable modifications.1013 * - It only has corresponding pointers in static library and does not have1014 * corresponding function in dynamic library.1015 * @see void __itt_sync_acquired(void *addr);1016 */1017void ITTAPI __itt_fsync_acquired(void *addr);1018 1019/** @cond exclude_from_documentation */1020#ifndef INTEL_NO_MACRO_BODY1021#ifndef INTEL_NO_ITTNOTIFY_API1022ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr))1023#define __itt_fsync_acquired ITTNOTIFY_VOID(fsync_acquired)1024#define __itt_fsync_acquired_ptr ITTNOTIFY_NAME(fsync_acquired)1025#else /* INTEL_NO_ITTNOTIFY_API */1026#define __itt_fsync_acquired(addr)1027#define __itt_fsync_acquired_ptr 01028#endif /* INTEL_NO_ITTNOTIFY_API */1029#else /* INTEL_NO_MACRO_BODY */1030#define __itt_fsync_acquired_ptr 01031#endif /* INTEL_NO_MACRO_BODY */1032/** @endcond */1033 1034/**1035 * @ingroup legacy1036 * @deprecated Legacy API1037 * @brief Fast synchronization which does no require spinning.1038 * - This special function is to be used by TBB and OpenMP libraries only when1039 * they know there is no spin but they need to suppress TC warnings about shared1040 * variable modifications.1041 * - It only has corresponding pointers in static library and does not have1042 * corresponding function in dynamic library.1043 * @see void __itt_sync_releasing(void* addr);1044 */1045void ITTAPI __itt_fsync_releasing(void *addr);1046 1047/** @cond exclude_from_documentation */1048#ifndef INTEL_NO_MACRO_BODY1049#ifndef INTEL_NO_ITTNOTIFY_API1050ITT_STUBV(ITTAPI, void, fsync_releasing, (void *addr))1051#define __itt_fsync_releasing ITTNOTIFY_VOID(fsync_releasing)1052#define __itt_fsync_releasing_ptr ITTNOTIFY_NAME(fsync_releasing)1053#else /* INTEL_NO_ITTNOTIFY_API */1054#define __itt_fsync_releasing(addr)1055#define __itt_fsync_releasing_ptr 01056#endif /* INTEL_NO_ITTNOTIFY_API */1057#else /* INTEL_NO_MACRO_BODY */1058#define __itt_fsync_releasing_ptr 01059#endif /* INTEL_NO_MACRO_BODY */1060/** @endcond */1061/** @} */1062 1063/**1064 * @defgroup model Modeling by Intel(R) Parallel Advisor1065 * @ingroup public1066 * This is the subset of itt used for modeling by Intel(R) Parallel Advisor.1067 * This API is called ONLY using annotate.h, by "Annotation" macros1068 * the user places in their sources during the parallelism modeling steps.1069 *1070 * site_begin/end and task_begin/end take the address of handle variables,1071 * which are writeable by the API. Handles must be 0 initialized prior1072 * to the first call to begin, or may cause a run-time failure.1073 * The handles are initialized in a multi-thread safe way by the API if1074 * the handle is 0. The commonly expected idiom is one static handle to1075 * identify a site or task. If a site or task of the same name has already1076 * been started during this collection, the same handle MAY be returned,1077 * but is not required to be - it is unspecified if data merging is done1078 * based on name. These routines also take an instance variable. Like1079 * the lexical instance, these must be 0 initialized. Unlike the lexical1080 * instance, this is used to track a single dynamic instance.1081 *1082 * API used by the Intel(R) Parallel Advisor to describe potential concurrency1083 * and related activities. User-added source annotations expand to calls1084 * to these procedures to enable modeling of a hypothetical concurrent1085 * execution serially.1086 * @{1087 */1088#if !defined(_ADVISOR_ANNOTATE_H_) || defined(ANNOTATE_EXPAND_NULL)1089 1090typedef void *__itt_model_site; /*!< @brief handle for lexical site */1091typedef void1092 *__itt_model_site_instance; /*!< @brief handle for dynamic instance */1093typedef void *__itt_model_task; /*!< @brief handle for lexical site */1094typedef void1095 *__itt_model_task_instance; /*!< @brief handle for dynamic instance */1096 1097/**1098 * @enum __itt_model_disable1099 * @brief Enumerator for the disable methods1100 */1101typedef enum {1102 __itt_model_disable_observation,1103 __itt_model_disable_collection1104} __itt_model_disable;1105 1106#endif /* !_ADVISOR_ANNOTATE_H_ || ANNOTATE_EXPAND_NULL */1107 1108/**1109 * @brief ANNOTATE_SITE_BEGIN/ANNOTATE_SITE_END support.1110 *1111 * site_begin/end model a potential concurrency site.1112 * site instances may be recursively nested with themselves.1113 * site_end exits the most recently started but unended site for the current1114 * thread. The handle passed to end may be used to validate structure.1115 * Instances of a site encountered on different threads concurrently1116 * are considered completely distinct. If the site name for two different1117 * lexical sites match, it is unspecified whether they are treated as the1118 * same or different for data presentation.1119 */1120void ITTAPI __itt_model_site_begin(__itt_model_site *site,1121 __itt_model_site_instance *instance,1122 const char *name);1123#if ITT_PLATFORM == ITT_PLATFORM_WIN1124void ITTAPI __itt_model_site_beginW(const wchar_t *name);1125#endif1126void ITTAPI __itt_model_site_beginA(const char *name);1127void ITTAPI __itt_model_site_beginAL(const char *name, size_t siteNameLen);1128void ITTAPI __itt_model_site_end(__itt_model_site *site,1129 __itt_model_site_instance *instance);1130void ITTAPI __itt_model_site_end_2(void);1131 1132/** @cond exclude_from_documentation */1133#ifndef INTEL_NO_MACRO_BODY1134#ifndef INTEL_NO_ITTNOTIFY_API1135ITT_STUBV(ITTAPI, void, model_site_begin,1136 (__itt_model_site * site, __itt_model_site_instance *instance,1137 const char *name))1138#if ITT_PLATFORM == ITT_PLATFORM_WIN1139ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name))1140#endif1141ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name))1142ITT_STUBV(ITTAPI, void, model_site_beginAL,1143 (const char *name, size_t siteNameLen))1144ITT_STUBV(ITTAPI, void, model_site_end,1145 (__itt_model_site * site, __itt_model_site_instance *instance))1146ITT_STUBV(ITTAPI, void, model_site_end_2, (void))1147#define __itt_model_site_begin ITTNOTIFY_VOID(model_site_begin)1148#define __itt_model_site_begin_ptr ITTNOTIFY_NAME(model_site_begin)1149#if ITT_PLATFORM == ITT_PLATFORM_WIN1150#define __itt_model_site_beginW ITTNOTIFY_VOID(model_site_beginW)1151#define __itt_model_site_beginW_ptr ITTNOTIFY_NAME(model_site_beginW)1152#endif1153#define __itt_model_site_beginA ITTNOTIFY_VOID(model_site_beginA)1154#define __itt_model_site_beginA_ptr ITTNOTIFY_NAME(model_site_beginA)1155#define __itt_model_site_beginAL ITTNOTIFY_VOID(model_site_beginAL)1156#define __itt_model_site_beginAL_ptr ITTNOTIFY_NAME(model_site_beginAL)1157#define __itt_model_site_end ITTNOTIFY_VOID(model_site_end)1158#define __itt_model_site_end_ptr ITTNOTIFY_NAME(model_site_end)1159#define __itt_model_site_end_2 ITTNOTIFY_VOID(model_site_end_2)1160#define __itt_model_site_end_2_ptr ITTNOTIFY_NAME(model_site_end_2)1161#else /* INTEL_NO_ITTNOTIFY_API */1162#define __itt_model_site_begin(site, instance, name)1163#define __itt_model_site_begin_ptr 01164#if ITT_PLATFORM == ITT_PLATFORM_WIN1165#define __itt_model_site_beginW(name)1166#define __itt_model_site_beginW_ptr 01167#endif1168#define __itt_model_site_beginA(name)1169#define __itt_model_site_beginA_ptr 01170#define __itt_model_site_beginAL(name, siteNameLen)1171#define __itt_model_site_beginAL_ptr 01172#define __itt_model_site_end(site, instance)1173#define __itt_model_site_end_ptr 01174#define __itt_model_site_end_2()1175#define __itt_model_site_end_2_ptr 01176#endif /* INTEL_NO_ITTNOTIFY_API */1177#else /* INTEL_NO_MACRO_BODY */1178#define __itt_model_site_begin_ptr 01179#if ITT_PLATFORM == ITT_PLATFORM_WIN1180#define __itt_model_site_beginW_ptr 01181#endif1182#define __itt_model_site_beginA_ptr 01183#define __itt_model_site_beginAL_ptr 01184#define __itt_model_site_end_ptr 01185#define __itt_model_site_end_2_ptr 01186#endif /* INTEL_NO_MACRO_BODY */1187/** @endcond */1188 1189/**1190 * @brief ANNOTATE_TASK_BEGIN/ANNOTATE_TASK_END support1191 *1192 * task_begin/end model a potential task, which is contained within the most1193 * closely enclosing dynamic site. task_end exits the most recently started1194 * but unended task. The handle passed to end may be used to validate1195 * structure. It is unspecified if bad dynamic nesting is detected. If it1196 * is, it should be encoded in the resulting data collection. The collector1197 * should not fail due to construct nesting issues, nor attempt to directly1198 * indicate the problem.1199 */1200void ITTAPI __itt_model_task_begin(__itt_model_task *task,1201 __itt_model_task_instance *instance,1202 const char *name);1203#if ITT_PLATFORM == ITT_PLATFORM_WIN1204void ITTAPI __itt_model_task_beginW(const wchar_t *name);1205void ITTAPI __itt_model_iteration_taskW(const wchar_t *name);1206#endif1207void ITTAPI __itt_model_task_beginA(const char *name);1208void ITTAPI __itt_model_task_beginAL(const char *name, size_t taskNameLen);1209void ITTAPI __itt_model_iteration_taskA(const char *name);1210void ITTAPI __itt_model_iteration_taskAL(const char *name, size_t taskNameLen);1211void ITTAPI __itt_model_task_end(__itt_model_task *task,1212 __itt_model_task_instance *instance);1213void ITTAPI __itt_model_task_end_2(void);1214 1215/** @cond exclude_from_documentation */1216#ifndef INTEL_NO_MACRO_BODY1217#ifndef INTEL_NO_ITTNOTIFY_API1218ITT_STUBV(ITTAPI, void, model_task_begin,1219 (__itt_model_task * task, __itt_model_task_instance *instance,1220 const char *name))1221#if ITT_PLATFORM == ITT_PLATFORM_WIN1222ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name))1223ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name))1224#endif1225ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name))1226ITT_STUBV(ITTAPI, void, model_task_beginAL,1227 (const char *name, size_t taskNameLen))1228ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name))1229ITT_STUBV(ITTAPI, void, model_iteration_taskAL,1230 (const char *name, size_t taskNameLen))1231ITT_STUBV(ITTAPI, void, model_task_end,1232 (__itt_model_task * task, __itt_model_task_instance *instance))1233ITT_STUBV(ITTAPI, void, model_task_end_2, (void))1234#define __itt_model_task_begin ITTNOTIFY_VOID(model_task_begin)1235#define __itt_model_task_begin_ptr ITTNOTIFY_NAME(model_task_begin)1236#if ITT_PLATFORM == ITT_PLATFORM_WIN1237#define __itt_model_task_beginW ITTNOTIFY_VOID(model_task_beginW)1238#define __itt_model_task_beginW_ptr ITTNOTIFY_NAME(model_task_beginW)1239#define __itt_model_iteration_taskW ITTNOTIFY_VOID(model_iteration_taskW)1240#define __itt_model_iteration_taskW_ptr ITTNOTIFY_NAME(model_iteration_taskW)1241#endif1242#define __itt_model_task_beginA ITTNOTIFY_VOID(model_task_beginA)1243#define __itt_model_task_beginA_ptr ITTNOTIFY_NAME(model_task_beginA)1244#define __itt_model_task_beginAL ITTNOTIFY_VOID(model_task_beginAL)1245#define __itt_model_task_beginAL_ptr ITTNOTIFY_NAME(model_task_beginAL)1246#define __itt_model_iteration_taskA ITTNOTIFY_VOID(model_iteration_taskA)1247#define __itt_model_iteration_taskA_ptr ITTNOTIFY_NAME(model_iteration_taskA)1248#define __itt_model_iteration_taskAL ITTNOTIFY_VOID(model_iteration_taskAL)1249#define __itt_model_iteration_taskAL_ptr ITTNOTIFY_NAME(model_iteration_taskAL)1250#define __itt_model_task_end ITTNOTIFY_VOID(model_task_end)1251#define __itt_model_task_end_ptr ITTNOTIFY_NAME(model_task_end)1252#define __itt_model_task_end_2 ITTNOTIFY_VOID(model_task_end_2)1253#define __itt_model_task_end_2_ptr ITTNOTIFY_NAME(model_task_end_2)1254#else /* INTEL_NO_ITTNOTIFY_API */1255#define __itt_model_task_begin(task, instance, name)1256#define __itt_model_task_begin_ptr 01257#if ITT_PLATFORM == ITT_PLATFORM_WIN1258#define __itt_model_task_beginW(name)1259#define __itt_model_task_beginW_ptr 01260#endif1261#define __itt_model_task_beginA(name)1262#define __itt_model_task_beginA_ptr 01263#define __itt_model_task_beginAL(name, siteNameLen)1264#define __itt_model_task_beginAL_ptr 01265#define __itt_model_iteration_taskA(name)1266#define __itt_model_iteration_taskA_ptr 01267#define __itt_model_iteration_taskAL(name, siteNameLen)1268#define __itt_model_iteration_taskAL_ptr 01269#define __itt_model_task_end(task, instance)1270#define __itt_model_task_end_ptr 01271#define __itt_model_task_end_2()1272#define __itt_model_task_end_2_ptr 01273#endif /* INTEL_NO_ITTNOTIFY_API */1274#else /* INTEL_NO_MACRO_BODY */1275#define __itt_model_task_begin_ptr 01276#if ITT_PLATFORM == ITT_PLATFORM_WIN1277#define __itt_model_task_beginW_ptr 01278#endif1279#define __itt_model_task_beginA_ptr 01280#define __itt_model_task_beginAL_ptr 01281#define __itt_model_iteration_taskA_ptr 01282#define __itt_model_iteration_taskAL_ptr 01283#define __itt_model_task_end_ptr 01284#define __itt_model_task_end_2_ptr 01285#endif /* INTEL_NO_MACRO_BODY */1286/** @endcond */1287 1288/**1289 * @brief ANNOTATE_LOCK_ACQUIRE/ANNOTATE_LOCK_RELEASE support1290 *1291 * lock_acquire/release model a potential lock for both lockset and1292 * performance modeling. Each unique address is modeled as a separate1293 * lock, with invalid addresses being valid lock IDs. Specifically:1294 * no storage is accessed by the API at the specified address - it is only1295 * used for lock identification. Lock acquires may be self-nested and are1296 * unlocked by a corresponding number of releases.1297 * (These closely correspond to __itt_sync_acquired/__itt_sync_releasing,1298 * but may not have identical semantics.)1299 */1300void ITTAPI __itt_model_lock_acquire(void *lock);1301void ITTAPI __itt_model_lock_acquire_2(void *lock);1302void ITTAPI __itt_model_lock_release(void *lock);1303void ITTAPI __itt_model_lock_release_2(void *lock);1304 1305/** @cond exclude_from_documentation */1306#ifndef INTEL_NO_MACRO_BODY1307#ifndef INTEL_NO_ITTNOTIFY_API1308ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock))1309ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock))1310ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock))1311ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock))1312#define __itt_model_lock_acquire ITTNOTIFY_VOID(model_lock_acquire)1313#define __itt_model_lock_acquire_ptr ITTNOTIFY_NAME(model_lock_acquire)1314#define __itt_model_lock_acquire_2 ITTNOTIFY_VOID(model_lock_acquire_2)1315#define __itt_model_lock_acquire_2_ptr ITTNOTIFY_NAME(model_lock_acquire_2)1316#define __itt_model_lock_release ITTNOTIFY_VOID(model_lock_release)1317#define __itt_model_lock_release_ptr ITTNOTIFY_NAME(model_lock_release)1318#define __itt_model_lock_release_2 ITTNOTIFY_VOID(model_lock_release_2)1319#define __itt_model_lock_release_2_ptr ITTNOTIFY_NAME(model_lock_release_2)1320#else /* INTEL_NO_ITTNOTIFY_API */1321#define __itt_model_lock_acquire(lock)1322#define __itt_model_lock_acquire_ptr 01323#define __itt_model_lock_acquire_2(lock)1324#define __itt_model_lock_acquire_2_ptr 01325#define __itt_model_lock_release(lock)1326#define __itt_model_lock_release_ptr 01327#define __itt_model_lock_release_2(lock)1328#define __itt_model_lock_release_2_ptr 01329#endif /* INTEL_NO_ITTNOTIFY_API */1330#else /* INTEL_NO_MACRO_BODY */1331#define __itt_model_lock_acquire_ptr 01332#define __itt_model_lock_acquire_2_ptr 01333#define __itt_model_lock_release_ptr 01334#define __itt_model_lock_release_2_ptr 01335#endif /* INTEL_NO_MACRO_BODY */1336/** @endcond */1337 1338/**1339 * @brief ANNOTATE_RECORD_ALLOCATION/ANNOTATE_RECORD_DEALLOCATION support1340 *1341 * record_allocation/deallocation describe user-defined memory allocator1342 * behavior, which may be required for correctness modeling to understand1343 * when storage is not expected to be actually reused across threads.1344 */1345void ITTAPI __itt_model_record_allocation(void *addr, size_t size);1346void ITTAPI __itt_model_record_deallocation(void *addr);1347 1348/** @cond exclude_from_documentation */1349#ifndef INTEL_NO_MACRO_BODY1350#ifndef INTEL_NO_ITTNOTIFY_API1351ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size))1352ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr))1353#define __itt_model_record_allocation ITTNOTIFY_VOID(model_record_allocation)1354#define __itt_model_record_allocation_ptr \1355 ITTNOTIFY_NAME(model_record_allocation)1356#define __itt_model_record_deallocation \1357 ITTNOTIFY_VOID(model_record_deallocation)1358#define __itt_model_record_deallocation_ptr \1359 ITTNOTIFY_NAME(model_record_deallocation)1360#else /* INTEL_NO_ITTNOTIFY_API */1361#define __itt_model_record_allocation(addr, size)1362#define __itt_model_record_allocation_ptr 01363#define __itt_model_record_deallocation(addr)1364#define __itt_model_record_deallocation_ptr 01365#endif /* INTEL_NO_ITTNOTIFY_API */1366#else /* INTEL_NO_MACRO_BODY */1367#define __itt_model_record_allocation_ptr 01368#define __itt_model_record_deallocation_ptr 01369#endif /* INTEL_NO_MACRO_BODY */1370/** @endcond */1371 1372/**1373 * @brief ANNOTATE_INDUCTION_USES support1374 *1375 * Note particular storage is inductive through the end of the current site1376 */1377void ITTAPI __itt_model_induction_uses(void *addr, size_t size);1378 1379/** @cond exclude_from_documentation */1380#ifndef INTEL_NO_MACRO_BODY1381#ifndef INTEL_NO_ITTNOTIFY_API1382ITT_STUBV(ITTAPI, void, model_induction_uses, (void *addr, size_t size))1383#define __itt_model_induction_uses ITTNOTIFY_VOID(model_induction_uses)1384#define __itt_model_induction_uses_ptr ITTNOTIFY_NAME(model_induction_uses)1385#else /* INTEL_NO_ITTNOTIFY_API */1386#define __itt_model_induction_uses(addr, size)1387#define __itt_model_induction_uses_ptr 01388#endif /* INTEL_NO_ITTNOTIFY_API */1389#else /* INTEL_NO_MACRO_BODY */1390#define __itt_model_induction_uses_ptr 01391#endif /* INTEL_NO_MACRO_BODY */1392/** @endcond */1393 1394/**1395 * @brief ANNOTATE_REDUCTION_USES support1396 *1397 * Note particular storage is used for reduction through the end1398 * of the current site1399 */1400void ITTAPI __itt_model_reduction_uses(void *addr, size_t size);1401 1402/** @cond exclude_from_documentation */1403#ifndef INTEL_NO_MACRO_BODY1404#ifndef INTEL_NO_ITTNOTIFY_API1405ITT_STUBV(ITTAPI, void, model_reduction_uses, (void *addr, size_t size))1406#define __itt_model_reduction_uses ITTNOTIFY_VOID(model_reduction_uses)1407#define __itt_model_reduction_uses_ptr ITTNOTIFY_NAME(model_reduction_uses)1408#else /* INTEL_NO_ITTNOTIFY_API */1409#define __itt_model_reduction_uses(addr, size)1410#define __itt_model_reduction_uses_ptr 01411#endif /* INTEL_NO_ITTNOTIFY_API */1412#else /* INTEL_NO_MACRO_BODY */1413#define __itt_model_reduction_uses_ptr 01414#endif /* INTEL_NO_MACRO_BODY */1415/** @endcond */1416 1417/**1418 * @brief ANNOTATE_OBSERVE_USES support1419 *1420 * Have correctness modeling record observations about uses of storage1421 * through the end of the current site1422 */1423void ITTAPI __itt_model_observe_uses(void *addr, size_t size);1424 1425/** @cond exclude_from_documentation */1426#ifndef INTEL_NO_MACRO_BODY1427#ifndef INTEL_NO_ITTNOTIFY_API1428ITT_STUBV(ITTAPI, void, model_observe_uses, (void *addr, size_t size))1429#define __itt_model_observe_uses ITTNOTIFY_VOID(model_observe_uses)1430#define __itt_model_observe_uses_ptr ITTNOTIFY_NAME(model_observe_uses)1431#else /* INTEL_NO_ITTNOTIFY_API */1432#define __itt_model_observe_uses(addr, size)1433#define __itt_model_observe_uses_ptr 01434#endif /* INTEL_NO_ITTNOTIFY_API */1435#else /* INTEL_NO_MACRO_BODY */1436#define __itt_model_observe_uses_ptr 01437#endif /* INTEL_NO_MACRO_BODY */1438/** @endcond */1439 1440/**1441 * @brief ANNOTATE_CLEAR_USES support1442 *1443 * Clear the special handling of a piece of storage related to induction,1444 * reduction or observe_uses1445 */1446void ITTAPI __itt_model_clear_uses(void *addr);1447 1448/** @cond exclude_from_documentation */1449#ifndef INTEL_NO_MACRO_BODY1450#ifndef INTEL_NO_ITTNOTIFY_API1451ITT_STUBV(ITTAPI, void, model_clear_uses, (void *addr))1452#define __itt_model_clear_uses ITTNOTIFY_VOID(model_clear_uses)1453#define __itt_model_clear_uses_ptr ITTNOTIFY_NAME(model_clear_uses)1454#else /* INTEL_NO_ITTNOTIFY_API */1455#define __itt_model_clear_uses(addr)1456#define __itt_model_clear_uses_ptr 01457#endif /* INTEL_NO_ITTNOTIFY_API */1458#else /* INTEL_NO_MACRO_BODY */1459#define __itt_model_clear_uses_ptr 01460#endif /* INTEL_NO_MACRO_BODY */1461/** @endcond */1462 1463/**1464 * @brief ANNOTATE_DISABLE_*_PUSH/ANNOTATE_DISABLE_*_POP support1465 *1466 * disable_push/disable_pop push and pop disabling based on a parameter.1467 * Disabling observations stops processing of memory references during1468 * correctness modeling, and all annotations that occur in the disabled1469 * region. This allows description of code that is expected to be handled1470 * specially during conversion to parallelism or that is not recognized1471 * by tools (e.g. some kinds of synchronization operations.)1472 * This mechanism causes all annotations in the disabled region, other1473 * than disable_push and disable_pop, to be ignored. (For example, this1474 * might validly be used to disable an entire parallel site and the contained1475 * tasks and locking in it for data collection purposes.)1476 * The disable for collection is a more expensive operation, but reduces1477 * collector overhead significantly. This applies to BOTH correctness data1478 * collection and performance data collection. For example, a site1479 * containing a task might only enable data collection for the first 101480 * iterations. Both performance and correctness data should reflect this,1481 * and the program should run as close to full speed as possible when1482 * collection is disabled.1483 */1484void ITTAPI __itt_model_disable_push(__itt_model_disable x);1485void ITTAPI __itt_model_disable_pop(void);1486void ITTAPI __itt_model_aggregate_task(size_t x);1487 1488/** @cond exclude_from_documentation */1489#ifndef INTEL_NO_MACRO_BODY1490#ifndef INTEL_NO_ITTNOTIFY_API1491ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x))1492ITT_STUBV(ITTAPI, void, model_disable_pop, (void))1493ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t x))1494#define __itt_model_disable_push ITTNOTIFY_VOID(model_disable_push)1495#define __itt_model_disable_push_ptr ITTNOTIFY_NAME(model_disable_push)1496#define __itt_model_disable_pop ITTNOTIFY_VOID(model_disable_pop)1497#define __itt_model_disable_pop_ptr ITTNOTIFY_NAME(model_disable_pop)1498#define __itt_model_aggregate_task ITTNOTIFY_VOID(model_aggregate_task)1499#define __itt_model_aggregate_task_ptr ITTNOTIFY_NAME(model_aggregate_task)1500#else /* INTEL_NO_ITTNOTIFY_API */1501#define __itt_model_disable_push(x)1502#define __itt_model_disable_push_ptr 01503#define __itt_model_disable_pop()1504#define __itt_model_disable_pop_ptr 01505#define __itt_model_aggregate_task(x)1506#define __itt_model_aggregate_task_ptr 01507#endif /* INTEL_NO_ITTNOTIFY_API */1508#else /* INTEL_NO_MACRO_BODY */1509#define __itt_model_disable_push_ptr 01510#define __itt_model_disable_pop_ptr 01511#define __itt_model_aggregate_task_ptr 01512#endif /* INTEL_NO_MACRO_BODY */1513/** @endcond */1514/** @} model group */1515 1516/**1517 * @defgroup heap Heap1518 * @ingroup public1519 * Heap group1520 * @{1521 */1522 1523typedef void *__itt_heap_function;1524 1525/**1526 * @brief Create an identification for heap function1527 * @return non-zero identifier or NULL1528 */1529#if ITT_PLATFORM == ITT_PLATFORM_WIN1530__itt_heap_function ITTAPI __itt_heap_function_createA(const char *name,1531 const char *domain);1532__itt_heap_function ITTAPI __itt_heap_function_createW(const wchar_t *name,1533 const wchar_t *domain);1534#if defined(UNICODE) || defined(_UNICODE)1535#define __itt_heap_function_create __itt_heap_function_createW1536#define __itt_heap_function_create_ptr __itt_heap_function_createW_ptr1537#else1538#define __itt_heap_function_create __itt_heap_function_createA1539#define __itt_heap_function_create_ptr __itt_heap_function_createA_ptr1540#endif /* UNICODE */1541#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1542__itt_heap_function ITTAPI __itt_heap_function_create(const char *name,1543 const char *domain);1544#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1545 1546/** @cond exclude_from_documentation */1547#ifndef INTEL_NO_MACRO_BODY1548#ifndef INTEL_NO_ITTNOTIFY_API1549#if ITT_PLATFORM == ITT_PLATFORM_WIN1550ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA,1551 (const char *name, const char *domain))1552ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW,1553 (const wchar_t *name, const wchar_t *domain))1554#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1555ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create,1556 (const char *name, const char *domain))1557#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1558#if ITT_PLATFORM == ITT_PLATFORM_WIN1559#define __itt_heap_function_createA ITTNOTIFY_DATA(heap_function_createA)1560#define __itt_heap_function_createA_ptr ITTNOTIFY_NAME(heap_function_createA)1561#define __itt_heap_function_createW ITTNOTIFY_DATA(heap_function_createW)1562#define __itt_heap_function_createW_ptr ITTNOTIFY_NAME(heap_function_createW)1563#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1564#define __itt_heap_function_create ITTNOTIFY_DATA(heap_function_create)1565#define __itt_heap_function_create_ptr ITTNOTIFY_NAME(heap_function_create)1566#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1567#else /* INTEL_NO_ITTNOTIFY_API */1568#if ITT_PLATFORM == ITT_PLATFORM_WIN1569#define __itt_heap_function_createA(name, domain) (__itt_heap_function)01570#define __itt_heap_function_createA_ptr 01571#define __itt_heap_function_createW(name, domain) (__itt_heap_function)01572#define __itt_heap_function_createW_ptr 01573#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1574#define __itt_heap_function_create(name, domain) (__itt_heap_function)01575#define __itt_heap_function_create_ptr 01576#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1577#endif /* INTEL_NO_ITTNOTIFY_API */1578#else /* INTEL_NO_MACRO_BODY */1579#if ITT_PLATFORM == ITT_PLATFORM_WIN1580#define __itt_heap_function_createA_ptr 01581#define __itt_heap_function_createW_ptr 01582#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1583#define __itt_heap_function_create_ptr 01584#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1585#endif /* INTEL_NO_MACRO_BODY */1586/** @endcond */1587 1588/**1589 * @brief Record an allocation begin occurrence.1590 */1591void ITTAPI __itt_heap_allocate_begin(__itt_heap_function h, size_t size,1592 int initialized);1593 1594/** @cond exclude_from_documentation */1595#ifndef INTEL_NO_MACRO_BODY1596#ifndef INTEL_NO_ITTNOTIFY_API1597ITT_STUBV(ITTAPI, void, heap_allocate_begin,1598 (__itt_heap_function h, size_t size, int initialized))1599#define __itt_heap_allocate_begin ITTNOTIFY_VOID(heap_allocate_begin)1600#define __itt_heap_allocate_begin_ptr ITTNOTIFY_NAME(heap_allocate_begin)1601#else /* INTEL_NO_ITTNOTIFY_API */1602#define __itt_heap_allocate_begin(h, size, initialized)1603#define __itt_heap_allocate_begin_ptr 01604#endif /* INTEL_NO_ITTNOTIFY_API */1605#else /* INTEL_NO_MACRO_BODY */1606#define __itt_heap_allocate_begin_ptr 01607#endif /* INTEL_NO_MACRO_BODY */1608/** @endcond */1609 1610/**1611 * @brief Record an allocation end occurrence.1612 */1613void ITTAPI __itt_heap_allocate_end(__itt_heap_function h, void **addr,1614 size_t size, int initialized);1615 1616/** @cond exclude_from_documentation */1617#ifndef INTEL_NO_MACRO_BODY1618#ifndef INTEL_NO_ITTNOTIFY_API1619ITT_STUBV(ITTAPI, void, heap_allocate_end,1620 (__itt_heap_function h, void **addr, size_t size, int initialized))1621#define __itt_heap_allocate_end ITTNOTIFY_VOID(heap_allocate_end)1622#define __itt_heap_allocate_end_ptr ITTNOTIFY_NAME(heap_allocate_end)1623#else /* INTEL_NO_ITTNOTIFY_API */1624#define __itt_heap_allocate_end(h, addr, size, initialized)1625#define __itt_heap_allocate_end_ptr 01626#endif /* INTEL_NO_ITTNOTIFY_API */1627#else /* INTEL_NO_MACRO_BODY */1628#define __itt_heap_allocate_end_ptr 01629#endif /* INTEL_NO_MACRO_BODY */1630/** @endcond */1631 1632/**1633 * @brief Record a free begin occurrence.1634 */1635void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void *addr);1636 1637/** @cond exclude_from_documentation */1638#ifndef INTEL_NO_MACRO_BODY1639#ifndef INTEL_NO_ITTNOTIFY_API1640ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void *addr))1641#define __itt_heap_free_begin ITTNOTIFY_VOID(heap_free_begin)1642#define __itt_heap_free_begin_ptr ITTNOTIFY_NAME(heap_free_begin)1643#else /* INTEL_NO_ITTNOTIFY_API */1644#define __itt_heap_free_begin(h, addr)1645#define __itt_heap_free_begin_ptr 01646#endif /* INTEL_NO_ITTNOTIFY_API */1647#else /* INTEL_NO_MACRO_BODY */1648#define __itt_heap_free_begin_ptr 01649#endif /* INTEL_NO_MACRO_BODY */1650/** @endcond */1651 1652/**1653 * @brief Record a free end occurrence.1654 */1655void ITTAPI __itt_heap_free_end(__itt_heap_function h, void *addr);1656 1657/** @cond exclude_from_documentation */1658#ifndef INTEL_NO_MACRO_BODY1659#ifndef INTEL_NO_ITTNOTIFY_API1660ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void *addr))1661#define __itt_heap_free_end ITTNOTIFY_VOID(heap_free_end)1662#define __itt_heap_free_end_ptr ITTNOTIFY_NAME(heap_free_end)1663#else /* INTEL_NO_ITTNOTIFY_API */1664#define __itt_heap_free_end(h, addr)1665#define __itt_heap_free_end_ptr 01666#endif /* INTEL_NO_ITTNOTIFY_API */1667#else /* INTEL_NO_MACRO_BODY */1668#define __itt_heap_free_end_ptr 01669#endif /* INTEL_NO_MACRO_BODY */1670/** @endcond */1671 1672/**1673 * @brief Record a reallocation begin occurrence.1674 */1675void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void *addr,1676 size_t new_size, int initialized);1677 1678/** @cond exclude_from_documentation */1679#ifndef INTEL_NO_MACRO_BODY1680#ifndef INTEL_NO_ITTNOTIFY_API1681ITT_STUBV(ITTAPI, void, heap_reallocate_begin,1682 (__itt_heap_function h, void *addr, size_t new_size, int initialized))1683#define __itt_heap_reallocate_begin ITTNOTIFY_VOID(heap_reallocate_begin)1684#define __itt_heap_reallocate_begin_ptr ITTNOTIFY_NAME(heap_reallocate_begin)1685#else /* INTEL_NO_ITTNOTIFY_API */1686#define __itt_heap_reallocate_begin(h, addr, new_size, initialized)1687#define __itt_heap_reallocate_begin_ptr 01688#endif /* INTEL_NO_ITTNOTIFY_API */1689#else /* INTEL_NO_MACRO_BODY */1690#define __itt_heap_reallocate_begin_ptr 01691#endif /* INTEL_NO_MACRO_BODY */1692/** @endcond */1693 1694/**1695 * @brief Record a reallocation end occurrence.1696 */1697void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void *addr,1698 void **new_addr, size_t new_size,1699 int initialized);1700 1701/** @cond exclude_from_documentation */1702#ifndef INTEL_NO_MACRO_BODY1703#ifndef INTEL_NO_ITTNOTIFY_API1704ITT_STUBV(ITTAPI, void, heap_reallocate_end,1705 (__itt_heap_function h, void *addr, void **new_addr, size_t new_size,1706 int initialized))1707#define __itt_heap_reallocate_end ITTNOTIFY_VOID(heap_reallocate_end)1708#define __itt_heap_reallocate_end_ptr ITTNOTIFY_NAME(heap_reallocate_end)1709#else /* INTEL_NO_ITTNOTIFY_API */1710#define __itt_heap_reallocate_end(h, addr, new_addr, new_size, initialized)1711#define __itt_heap_reallocate_end_ptr 01712#endif /* INTEL_NO_ITTNOTIFY_API */1713#else /* INTEL_NO_MACRO_BODY */1714#define __itt_heap_reallocate_end_ptr 01715#endif /* INTEL_NO_MACRO_BODY */1716/** @endcond */1717 1718/** @brief internal access begin */1719void ITTAPI __itt_heap_internal_access_begin(void);1720 1721/** @cond exclude_from_documentation */1722#ifndef INTEL_NO_MACRO_BODY1723#ifndef INTEL_NO_ITTNOTIFY_API1724ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void))1725#define __itt_heap_internal_access_begin \1726 ITTNOTIFY_VOID(heap_internal_access_begin)1727#define __itt_heap_internal_access_begin_ptr \1728 ITTNOTIFY_NAME(heap_internal_access_begin)1729#else /* INTEL_NO_ITTNOTIFY_API */1730#define __itt_heap_internal_access_begin()1731#define __itt_heap_internal_access_begin_ptr 01732#endif /* INTEL_NO_ITTNOTIFY_API */1733#else /* INTEL_NO_MACRO_BODY */1734#define __itt_heap_internal_access_begin_ptr 01735#endif /* INTEL_NO_MACRO_BODY */1736/** @endcond */1737 1738/** @brief internal access end */1739void ITTAPI __itt_heap_internal_access_end(void);1740 1741/** @cond exclude_from_documentation */1742#ifndef INTEL_NO_MACRO_BODY1743#ifndef INTEL_NO_ITTNOTIFY_API1744ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void))1745#define __itt_heap_internal_access_end ITTNOTIFY_VOID(heap_internal_access_end)1746#define __itt_heap_internal_access_end_ptr \1747 ITTNOTIFY_NAME(heap_internal_access_end)1748#else /* INTEL_NO_ITTNOTIFY_API */1749#define __itt_heap_internal_access_end()1750#define __itt_heap_internal_access_end_ptr 01751#endif /* INTEL_NO_ITTNOTIFY_API */1752#else /* INTEL_NO_MACRO_BODY */1753#define __itt_heap_internal_access_end_ptr 01754#endif /* INTEL_NO_MACRO_BODY */1755/** @endcond */1756 1757/** @brief record memory growth begin */1758void ITTAPI __itt_heap_record_memory_growth_begin(void);1759 1760/** @cond exclude_from_documentation */1761#ifndef INTEL_NO_MACRO_BODY1762#ifndef INTEL_NO_ITTNOTIFY_API1763ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void))1764#define __itt_heap_record_memory_growth_begin \1765 ITTNOTIFY_VOID(heap_record_memory_growth_begin)1766#define __itt_heap_record_memory_growth_begin_ptr \1767 ITTNOTIFY_NAME(heap_record_memory_growth_begin)1768#else /* INTEL_NO_ITTNOTIFY_API */1769#define __itt_heap_record_memory_growth_begin()1770#define __itt_heap_record_memory_growth_begin_ptr 01771#endif /* INTEL_NO_ITTNOTIFY_API */1772#else /* INTEL_NO_MACRO_BODY */1773#define __itt_heap_record_memory_growth_begin_ptr 01774#endif /* INTEL_NO_MACRO_BODY */1775/** @endcond */1776 1777/** @brief record memory growth end */1778void ITTAPI __itt_heap_record_memory_growth_end(void);1779 1780/** @cond exclude_from_documentation */1781#ifndef INTEL_NO_MACRO_BODY1782#ifndef INTEL_NO_ITTNOTIFY_API1783ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void))1784#define __itt_heap_record_memory_growth_end \1785 ITTNOTIFY_VOID(heap_record_memory_growth_end)1786#define __itt_heap_record_memory_growth_end_ptr \1787 ITTNOTIFY_NAME(heap_record_memory_growth_end)1788#else /* INTEL_NO_ITTNOTIFY_API */1789#define __itt_heap_record_memory_growth_end()1790#define __itt_heap_record_memory_growth_end_ptr 01791#endif /* INTEL_NO_ITTNOTIFY_API */1792#else /* INTEL_NO_MACRO_BODY */1793#define __itt_heap_record_memory_growth_end_ptr 01794#endif /* INTEL_NO_MACRO_BODY */1795/** @endcond */1796 1797/**1798 * @brief Specify the type of heap detection/reporting to modify.1799 */1800/**1801 * @hideinitializer1802 * @brief Report on memory leaks.1803 */1804#define __itt_heap_leaks 0x000000011805 1806/**1807 * @hideinitializer1808 * @brief Report on memory growth.1809 */1810#define __itt_heap_growth 0x000000021811 1812/** @brief heap reset detection */1813void ITTAPI __itt_heap_reset_detection(unsigned int reset_mask);1814 1815/** @cond exclude_from_documentation */1816#ifndef INTEL_NO_MACRO_BODY1817#ifndef INTEL_NO_ITTNOTIFY_API1818ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask))1819#define __itt_heap_reset_detection ITTNOTIFY_VOID(heap_reset_detection)1820#define __itt_heap_reset_detection_ptr ITTNOTIFY_NAME(heap_reset_detection)1821#else /* INTEL_NO_ITTNOTIFY_API */1822#define __itt_heap_reset_detection()1823#define __itt_heap_reset_detection_ptr 01824#endif /* INTEL_NO_ITTNOTIFY_API */1825#else /* INTEL_NO_MACRO_BODY */1826#define __itt_heap_reset_detection_ptr 01827#endif /* INTEL_NO_MACRO_BODY */1828/** @endcond */1829 1830/** @brief report */1831void ITTAPI __itt_heap_record(unsigned int record_mask);1832 1833/** @cond exclude_from_documentation */1834#ifndef INTEL_NO_MACRO_BODY1835#ifndef INTEL_NO_ITTNOTIFY_API1836ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask))1837#define __itt_heap_record ITTNOTIFY_VOID(heap_record)1838#define __itt_heap_record_ptr ITTNOTIFY_NAME(heap_record)1839#else /* INTEL_NO_ITTNOTIFY_API */1840#define __itt_heap_record()1841#define __itt_heap_record_ptr 01842#endif /* INTEL_NO_ITTNOTIFY_API */1843#else /* INTEL_NO_MACRO_BODY */1844#define __itt_heap_record_ptr 01845#endif /* INTEL_NO_MACRO_BODY */1846/** @endcond */1847 1848/** @} heap group */1849/** @endcond */1850/* ========================================================================== */1851 1852/**1853 * @defgroup domains Domains1854 * @ingroup public1855 * Domains group1856 * @{1857 */1858 1859/** @cond exclude_from_documentation */1860#pragma pack(push, 8)1861 1862typedef struct ___itt_domain {1863 volatile int flags; /*!< Zero if disabled, non-zero if enabled. The meaning of1864 different non-zero values is reserved to the runtime */1865 const char *nameA; /*!< Copy of original name in ASCII. */1866#if defined(UNICODE) || defined(_UNICODE)1867 const wchar_t *nameW; /*!< Copy of original name in UNICODE. */1868#else /* UNICODE || _UNICODE */1869 void *nameW;1870#endif /* UNICODE || _UNICODE */1871 int extra1; /*!< Reserved to the runtime */1872 void *extra2; /*!< Reserved to the runtime */1873 struct ___itt_domain *next;1874} __itt_domain;1875 1876#pragma pack(pop)1877/** @endcond */1878 1879/**1880 * @ingroup domains1881 * @brief Create a domain.1882 * Create domain using some domain name: the URI naming style is recommended.1883 * Because the set of domains is expected to be static over the application's1884 * execution time, there is no mechanism to destroy a domain.1885 * Any domain can be accessed by any thread in the process, regardless of1886 * which thread created the domain. This call is thread-safe.1887 * @param[in] name name of domain1888 */1889#if ITT_PLATFORM == ITT_PLATFORM_WIN1890__itt_domain *ITTAPI __itt_domain_createA(const char *name);1891__itt_domain *ITTAPI __itt_domain_createW(const wchar_t *name);1892#if defined(UNICODE) || defined(_UNICODE)1893#define __itt_domain_create __itt_domain_createW1894#define __itt_domain_create_ptr __itt_domain_createW_ptr1895#else /* UNICODE */1896#define __itt_domain_create __itt_domain_createA1897#define __itt_domain_create_ptr __itt_domain_createA_ptr1898#endif /* UNICODE */1899#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1900__itt_domain *ITTAPI __itt_domain_create(const char *name);1901#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1902 1903/** @cond exclude_from_documentation */1904#ifndef INTEL_NO_MACRO_BODY1905#ifndef INTEL_NO_ITTNOTIFY_API1906#if ITT_PLATFORM == ITT_PLATFORM_WIN1907ITT_STUB(ITTAPI, __itt_domain *, domain_createA, (const char *name))1908ITT_STUB(ITTAPI, __itt_domain *, domain_createW, (const wchar_t *name))1909#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1910ITT_STUB(ITTAPI, __itt_domain *, domain_create, (const char *name))1911#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1912#if ITT_PLATFORM == ITT_PLATFORM_WIN1913#define __itt_domain_createA ITTNOTIFY_DATA(domain_createA)1914#define __itt_domain_createA_ptr ITTNOTIFY_NAME(domain_createA)1915#define __itt_domain_createW ITTNOTIFY_DATA(domain_createW)1916#define __itt_domain_createW_ptr ITTNOTIFY_NAME(domain_createW)1917#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1918#define __itt_domain_create ITTNOTIFY_DATA(domain_create)1919#define __itt_domain_create_ptr ITTNOTIFY_NAME(domain_create)1920#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1921#else /* INTEL_NO_ITTNOTIFY_API */1922#if ITT_PLATFORM == ITT_PLATFORM_WIN1923#define __itt_domain_createA(name) (__itt_domain *)01924#define __itt_domain_createA_ptr 01925#define __itt_domain_createW(name) (__itt_domain *)01926#define __itt_domain_createW_ptr 01927#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1928#define __itt_domain_create(name) (__itt_domain *)01929#define __itt_domain_create_ptr 01930#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1931#endif /* INTEL_NO_ITTNOTIFY_API */1932#else /* INTEL_NO_MACRO_BODY */1933#if ITT_PLATFORM == ITT_PLATFORM_WIN1934#define __itt_domain_createA_ptr 01935#define __itt_domain_createW_ptr 01936#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */1937#define __itt_domain_create_ptr 01938#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */1939#endif /* INTEL_NO_MACRO_BODY */1940/** @endcond */1941/** @} domains group */1942 1943/**1944 * @defgroup ids IDs1945 * @ingroup public1946 * IDs group1947 * @{1948 */1949 1950/** @cond exclude_from_documentation */1951#pragma pack(push, 8)1952 1953typedef struct ___itt_id {1954 unsigned long long d1, d2, d3;1955} __itt_id;1956 1957#pragma pack(pop)1958/** @endcond */1959 1960static const __itt_id __itt_null = {0, 0, 0};1961 1962/**1963 * @ingroup ids1964 * @brief A convenience function is provided to create an ID without domain1965 * control.1966 * @brief This is a convenience function to initialize an __itt_id structure.1967 * This function does not affect the collector runtime in any way. After you1968 * make the ID with this function, you still must create it with the1969 * __itt_id_create function before using the ID to identify a named entity.1970 * @param[in] addr The address of object; high QWORD of the ID value.1971 * @param[in] extra The extra data to unique identify object; low QWORD of the1972 * ID value.1973 */1974 1975ITT_INLINE __itt_id ITTAPI __itt_id_make(void *addr, unsigned long long extra)1976 ITT_INLINE_ATTRIBUTE;1977ITT_INLINE __itt_id ITTAPI __itt_id_make(void *addr, unsigned long long extra) {1978 __itt_id id = __itt_null;1979 id.d1 = (unsigned long long)((uintptr_t)addr);1980 id.d2 = (unsigned long long)extra;1981 id.d3 = (unsigned long long)0; /* Reserved. Must be zero */1982 return id;1983}1984 1985/**1986 * @ingroup ids1987 * @brief Create an instance of identifier.1988 * This establishes the beginning of the lifetime of an instance of1989 * the given ID in the trace. Once this lifetime starts, the ID1990 * can be used to tag named entity instances in calls such as1991 * __itt_task_begin, and to specify relationships among1992 * identified named entity instances, using the \ref relations APIs.1993 * Instance IDs are not domain specific!1994 * @param[in] domain The domain controlling the execution of this call.1995 * @param[in] id The ID to create.1996 */1997void ITTAPI __itt_id_create(const __itt_domain *domain, __itt_id id);1998 1999/** @cond exclude_from_documentation */2000#ifndef INTEL_NO_MACRO_BODY2001#ifndef INTEL_NO_ITTNOTIFY_API2002ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id))2003#define __itt_id_create(d, x) ITTNOTIFY_VOID_D1(id_create, d, x)2004#define __itt_id_create_ptr ITTNOTIFY_NAME(id_create)2005#else /* INTEL_NO_ITTNOTIFY_API */2006#define __itt_id_create(domain, id)2007#define __itt_id_create_ptr 02008#endif /* INTEL_NO_ITTNOTIFY_API */2009#else /* INTEL_NO_MACRO_BODY */2010#define __itt_id_create_ptr 02011#endif /* INTEL_NO_MACRO_BODY */2012/** @endcond */2013 2014/**2015 * @ingroup ids2016 * @brief Destroy an instance of identifier.2017 * This ends the lifetime of the current instance of the given ID value in the2018 * trace. Any relationships that are established after this lifetime ends are2019 * invalid. This call must be performed before the given ID value can be reused2020 * for a different named entity instance.2021 * @param[in] domain The domain controlling the execution of this call.2022 * @param[in] id The ID to destroy.2023 */2024void ITTAPI __itt_id_destroy(const __itt_domain *domain, __itt_id id);2025 2026/** @cond exclude_from_documentation */2027#ifndef INTEL_NO_MACRO_BODY2028#ifndef INTEL_NO_ITTNOTIFY_API2029ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id))2030#define __itt_id_destroy(d, x) ITTNOTIFY_VOID_D1(id_destroy, d, x)2031#define __itt_id_destroy_ptr ITTNOTIFY_NAME(id_destroy)2032#else /* INTEL_NO_ITTNOTIFY_API */2033#define __itt_id_destroy(domain, id)2034#define __itt_id_destroy_ptr 02035#endif /* INTEL_NO_ITTNOTIFY_API */2036#else /* INTEL_NO_MACRO_BODY */2037#define __itt_id_destroy_ptr 02038#endif /* INTEL_NO_MACRO_BODY */2039/** @endcond */2040/** @} ids group */2041 2042/**2043 * @defgroup handless String Handles2044 * @ingroup public2045 * String Handles group2046 * @{2047 */2048 2049/** @cond exclude_from_documentation */2050#pragma pack(push, 8)2051 2052typedef struct ___itt_string_handle {2053 const char *strA; /*!< Copy of original string in ASCII. */2054#if defined(UNICODE) || defined(_UNICODE)2055 const wchar_t *strW; /*!< Copy of original string in UNICODE. */2056#else /* UNICODE || _UNICODE */2057 void *strW;2058#endif /* UNICODE || _UNICODE */2059 int extra1; /*!< Reserved. Must be zero */2060 void *extra2; /*!< Reserved. Must be zero */2061 struct ___itt_string_handle *next;2062} __itt_string_handle;2063 2064#pragma pack(pop)2065/** @endcond */2066 2067/**2068 * @ingroup handles2069 * @brief Create a string handle.2070 * Create and return handle value that can be associated with a string.2071 * Consecutive calls to __itt_string_handle_create with the same name2072 * return the same value. Because the set of string handles is expected to2073 * remain static during the application's execution time, there is no mechanism2074 * to destroy a string handle. Any string handle can be accessed by any thread2075 * in the process, regardless of which thread created the string handle. This2076 * call is thread-safe.2077 * @param[in] name The input string2078 */2079#if ITT_PLATFORM == ITT_PLATFORM_WIN2080__itt_string_handle *ITTAPI __itt_string_handle_createA(const char *name);2081__itt_string_handle *ITTAPI __itt_string_handle_createW(const wchar_t *name);2082#if defined(UNICODE) || defined(_UNICODE)2083#define __itt_string_handle_create __itt_string_handle_createW2084#define __itt_string_handle_create_ptr __itt_string_handle_createW_ptr2085#else /* UNICODE */2086#define __itt_string_handle_create __itt_string_handle_createA2087#define __itt_string_handle_create_ptr __itt_string_handle_createA_ptr2088#endif /* UNICODE */2089#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2090__itt_string_handle *ITTAPI __itt_string_handle_create(const char *name);2091#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2092 2093/** @cond exclude_from_documentation */2094#ifndef INTEL_NO_MACRO_BODY2095#ifndef INTEL_NO_ITTNOTIFY_API2096#if ITT_PLATFORM == ITT_PLATFORM_WIN2097ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_createA,2098 (const char *name))2099ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_createW,2100 (const wchar_t *name))2101#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2102ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_create,2103 (const char *name))2104#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2105#if ITT_PLATFORM == ITT_PLATFORM_WIN2106#define __itt_string_handle_createA ITTNOTIFY_DATA(string_handle_createA)2107#define __itt_string_handle_createA_ptr ITTNOTIFY_NAME(string_handle_createA)2108#define __itt_string_handle_createW ITTNOTIFY_DATA(string_handle_createW)2109#define __itt_string_handle_createW_ptr ITTNOTIFY_NAME(string_handle_createW)2110#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2111#define __itt_string_handle_create ITTNOTIFY_DATA(string_handle_create)2112#define __itt_string_handle_create_ptr ITTNOTIFY_NAME(string_handle_create)2113#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2114#else /* INTEL_NO_ITTNOTIFY_API */2115#if ITT_PLATFORM == ITT_PLATFORM_WIN2116#define __itt_string_handle_createA(name) (__itt_string_handle *)02117#define __itt_string_handle_createA_ptr 02118#define __itt_string_handle_createW(name) (__itt_string_handle *)02119#define __itt_string_handle_createW_ptr 02120#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2121#define __itt_string_handle_create(name) (__itt_string_handle *)02122#define __itt_string_handle_create_ptr 02123#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2124#endif /* INTEL_NO_ITTNOTIFY_API */2125#else /* INTEL_NO_MACRO_BODY */2126#if ITT_PLATFORM == ITT_PLATFORM_WIN2127#define __itt_string_handle_createA_ptr 02128#define __itt_string_handle_createW_ptr 02129#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2130#define __itt_string_handle_create_ptr 02131#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2132#endif /* INTEL_NO_MACRO_BODY */2133/** @endcond */2134/** @} handles group */2135 2136/** @cond exclude_from_documentation */2137typedef unsigned long long __itt_timestamp;2138/** @endcond */2139 2140#define __itt_timestamp_none ((__itt_timestamp)-1LL)2141 2142/** @cond exclude_from_gpa_documentation */2143 2144/**2145 * @ingroup timestamps2146 * @brief Return timestamp corresponding to the current moment.2147 * This returns the timestamp in the format that is the most relevant for the2148 * current host or platform (RDTSC, QPC, and others). You can use the "<"2149 * operator to compare __itt_timestamp values.2150 */2151__itt_timestamp ITTAPI __itt_get_timestamp(void);2152 2153/** @cond exclude_from_documentation */2154#ifndef INTEL_NO_MACRO_BODY2155#ifndef INTEL_NO_ITTNOTIFY_API2156ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void))2157#define __itt_get_timestamp ITTNOTIFY_DATA(get_timestamp)2158#define __itt_get_timestamp_ptr ITTNOTIFY_NAME(get_timestamp)2159#else /* INTEL_NO_ITTNOTIFY_API */2160#define __itt_get_timestamp()2161#define __itt_get_timestamp_ptr 02162#endif /* INTEL_NO_ITTNOTIFY_API */2163#else /* INTEL_NO_MACRO_BODY */2164#define __itt_get_timestamp_ptr 02165#endif /* INTEL_NO_MACRO_BODY */2166/** @endcond */2167/** @} timestamps */2168/** @endcond */2169 2170/** @cond exclude_from_gpa_documentation */2171 2172/**2173 * @defgroup regions Regions2174 * @ingroup public2175 * Regions group2176 * @{2177 */2178/**2179 * @ingroup regions2180 * @brief Begin of region instance.2181 * Successive calls to __itt_region_begin with the same ID are ignored2182 * until a call to __itt_region_end with the same ID2183 * @param[in] domain The domain for this region instance2184 * @param[in] id The instance ID for this region instance. Must not be2185 * __itt_null2186 * @param[in] parentid The instance ID for the parent of this region instance,2187 * or __itt_null2188 * @param[in] name The name of this region2189 */2190void ITTAPI __itt_region_begin(const __itt_domain *domain, __itt_id id,2191 __itt_id parentid, __itt_string_handle *name);2192 2193/**2194 * @ingroup regions2195 * @brief End of region instance.2196 * The first call to __itt_region_end with a given ID ends the2197 * region. Successive calls with the same ID are ignored, as are2198 * calls that do not have a matching __itt_region_begin call.2199 * @param[in] domain The domain for this region instance2200 * @param[in] id The instance ID for this region instance2201 */2202void ITTAPI __itt_region_end(const __itt_domain *domain, __itt_id id);2203 2204/** @cond exclude_from_documentation */2205#ifndef INTEL_NO_MACRO_BODY2206#ifndef INTEL_NO_ITTNOTIFY_API2207ITT_STUBV(ITTAPI, void, region_begin,2208 (const __itt_domain *domain, __itt_id id, __itt_id parentid,2209 __itt_string_handle *name))2210ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id))2211#define __itt_region_begin(d, x, y, z) \2212 ITTNOTIFY_VOID_D3(region_begin, d, x, y, z)2213#define __itt_region_begin_ptr ITTNOTIFY_NAME(region_begin)2214#define __itt_region_end(d, x) ITTNOTIFY_VOID_D1(region_end, d, x)2215#define __itt_region_end_ptr ITTNOTIFY_NAME(region_end)2216#else /* INTEL_NO_ITTNOTIFY_API */2217#define __itt_region_begin(d, x, y, z)2218#define __itt_region_begin_ptr 02219#define __itt_region_end(d, x)2220#define __itt_region_end_ptr 02221#endif /* INTEL_NO_ITTNOTIFY_API */2222#else /* INTEL_NO_MACRO_BODY */2223#define __itt_region_begin_ptr 02224#define __itt_region_end_ptr 02225#endif /* INTEL_NO_MACRO_BODY */2226/** @endcond */2227/** @} regions group */2228 2229/**2230 * @defgroup frames Frames2231 * @ingroup public2232 * Frames are similar to regions, but are intended to be easier to use and to2233 * implement. In particular:2234 * - Frames always represent periods of elapsed time2235 * - By default, frames have no nesting relationships2236 * @{2237 */2238 2239/**2240 * @ingroup frames2241 * @brief Begin a frame instance.2242 * Successive calls to __itt_frame_begin with the2243 * same ID are ignored until a call to __itt_frame_end with the same ID.2244 * @param[in] domain The domain for this frame instance2245 * @param[in] id The instance ID for this frame instance or NULL2246 */2247void ITTAPI __itt_frame_begin_v3(const __itt_domain *domain, __itt_id *id);2248 2249/**2250 * @ingroup frames2251 * @brief End a frame instance.2252 * The first call to __itt_frame_end with a given ID2253 * ends the frame. Successive calls with the same ID are ignored, as are2254 * calls that do not have a matching __itt_frame_begin call.2255 * @param[in] domain The domain for this frame instance2256 * @param[in] id The instance ID for this frame instance or NULL for current2257 */2258void ITTAPI __itt_frame_end_v3(const __itt_domain *domain, __itt_id *id);2259 2260/**2261 * @ingroup frames2262 * @brief Submits a frame instance.2263 * Successive calls to __itt_frame_begin or __itt_frame_submit with the2264 * same ID are ignored until a call to __itt_frame_end or __itt_frame_submit2265 * with the same ID.2266 * Passing special __itt_timestamp_none value as "end" argument means2267 * take the current timestamp as the end timestamp.2268 * @param[in] domain The domain for this frame instance2269 * @param[in] id The instance ID for this frame instance or NULL2270 * @param[in] begin Timestamp of the beginning of the frame2271 * @param[in] end Timestamp of the end of the frame2272 */2273void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id,2274 __itt_timestamp begin, __itt_timestamp end);2275 2276/** @cond exclude_from_documentation */2277#ifndef INTEL_NO_MACRO_BODY2278#ifndef INTEL_NO_ITTNOTIFY_API2279ITT_STUBV(ITTAPI, void, frame_begin_v3,2280 (const __itt_domain *domain, __itt_id *id))2281ITT_STUBV(ITTAPI, void, frame_end_v3,2282 (const __itt_domain *domain, __itt_id *id))2283ITT_STUBV(ITTAPI, void, frame_submit_v3,2284 (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin,2285 __itt_timestamp end))2286#define __itt_frame_begin_v3(d, x) ITTNOTIFY_VOID_D1(frame_begin_v3, d, x)2287#define __itt_frame_begin_v3_ptr ITTNOTIFY_NAME(frame_begin_v3)2288#define __itt_frame_end_v3(d, x) ITTNOTIFY_VOID_D1(frame_end_v3, d, x)2289#define __itt_frame_end_v3_ptr ITTNOTIFY_NAME(frame_end_v3)2290#define __itt_frame_submit_v3(d, x, b, e) \2291 ITTNOTIFY_VOID_D3(frame_submit_v3, d, x, b, e)2292#define __itt_frame_submit_v3_ptr ITTNOTIFY_NAME(frame_submit_v3)2293#else /* INTEL_NO_ITTNOTIFY_API */2294#define __itt_frame_begin_v3(domain, id)2295#define __itt_frame_begin_v3_ptr 02296#define __itt_frame_end_v3(domain, id)2297#define __itt_frame_end_v3_ptr 02298#define __itt_frame_submit_v3(domain, id, begin, end)2299#define __itt_frame_submit_v3_ptr 02300#endif /* INTEL_NO_ITTNOTIFY_API */2301#else /* INTEL_NO_MACRO_BODY */2302#define __itt_frame_begin_v3_ptr 02303#define __itt_frame_end_v3_ptr 02304#define __itt_frame_submit_v3_ptr 02305#endif /* INTEL_NO_MACRO_BODY */2306/** @endcond */2307/** @} frames group */2308/** @endcond */2309 2310/**2311 * @defgroup taskgroup Task Group2312 * @ingroup public2313 * Task Group2314 * @{2315 */2316/**2317 * @ingroup task_groups2318 * @brief Denotes a task_group instance.2319 * Successive calls to __itt_task_group with the same ID are ignored.2320 * @param[in] domain The domain for this task_group instance2321 * @param[in] id The instance ID for this task_group instance. Must not be2322 * __itt_null.2323 * @param[in] parentid The instance ID for the parent of this task_group2324 * instance, or __itt_null.2325 * @param[in] name The name of this task_group2326 */2327void ITTAPI __itt_task_group(const __itt_domain *domain, __itt_id id,2328 __itt_id parentid, __itt_string_handle *name);2329 2330/** @cond exclude_from_documentation */2331#ifndef INTEL_NO_MACRO_BODY2332#ifndef INTEL_NO_ITTNOTIFY_API2333ITT_STUBV(ITTAPI, void, task_group,2334 (const __itt_domain *domain, __itt_id id, __itt_id parentid,2335 __itt_string_handle *name))2336#define __itt_task_group(d, x, y, z) ITTNOTIFY_VOID_D3(task_group, d, x, y, z)2337#define __itt_task_group_ptr ITTNOTIFY_NAME(task_group)2338#else /* INTEL_NO_ITTNOTIFY_API */2339#define __itt_task_group(d, x, y, z)2340#define __itt_task_group_ptr 02341#endif /* INTEL_NO_ITTNOTIFY_API */2342#else /* INTEL_NO_MACRO_BODY */2343#define __itt_task_group_ptr 02344#endif /* INTEL_NO_MACRO_BODY */2345/** @endcond */2346/** @} taskgroup group */2347 2348/**2349 * @defgroup tasks Tasks2350 * @ingroup public2351 * A task instance represents a piece of work performed by a particular2352 * thread for a period of time. A call to __itt_task_begin creates a2353 * task instance. This becomes the current instance for that task on that2354 * thread. A following call to __itt_task_end on the same thread ends the2355 * instance. There may be multiple simultaneous instances of tasks with the2356 * same name on different threads. If an ID is specified, the task instance2357 * receives that ID. Nested tasks are allowed.2358 *2359 * Note: The task is defined by the bracketing of __itt_task_begin and2360 * __itt_task_end on the same thread. If some scheduling mechanism causes2361 * task switching (the thread executes a different user task) or task2362 * switching (the user task switches to a different thread) then this breaks2363 * the notion of current instance. Additional API calls are required to2364 * deal with that possibility.2365 * @{2366 */2367 2368/**2369 * @ingroup tasks2370 * @brief Begin a task instance.2371 * @param[in] domain The domain for this task2372 * @param[in] taskid The instance ID for this task instance, or __itt_null2373 * @param[in] parentid The parent instance to which this task instance belongs,2374 * or __itt_null2375 * @param[in] name The name of this task2376 */2377void ITTAPI __itt_task_begin(const __itt_domain *domain, __itt_id taskid,2378 __itt_id parentid, __itt_string_handle *name);2379 2380/**2381 * @ingroup tasks2382 * @brief Begin a task instance.2383 * @param[in] domain The domain for this task2384 * @param[in] taskid The identifier for this task instance (may be 0)2385 * @param[in] parentid The parent of this task (may be 0)2386 * @param[in] fn The pointer to the function you are tracing2387 */2388void ITTAPI __itt_task_begin_fn(const __itt_domain *domain, __itt_id taskid,2389 __itt_id parentid, void *fn);2390 2391/**2392 * @ingroup tasks2393 * @brief End the current task instance.2394 * @param[in] domain The domain for this task2395 */2396void ITTAPI __itt_task_end(const __itt_domain *domain);2397 2398/**2399 * @ingroup tasks2400 * @brief Begin an overlapped task instance.2401 * @param[in] domain The domain for this task.2402 * @param[in] taskid The identifier for this task instance, *cannot* be2403 * __itt_null.2404 * @param[in] parentid The parent of this task, or __itt_null.2405 * @param[in] name The name of this task.2406 */2407void ITTAPI __itt_task_begin_overlapped(const __itt_domain *domain,2408 __itt_id taskid, __itt_id parentid,2409 __itt_string_handle *name);2410 2411/**2412 * @ingroup tasks2413 * @brief End an overlapped task instance.2414 * @param[in] domain The domain for this task2415 * @param[in] taskid Explicit ID of finished task2416 */2417void ITTAPI __itt_task_end_overlapped(const __itt_domain *domain,2418 __itt_id taskid);2419 2420/** @cond exclude_from_documentation */2421#ifndef INTEL_NO_MACRO_BODY2422#ifndef INTEL_NO_ITTNOTIFY_API2423ITT_STUBV(ITTAPI, void, task_begin,2424 (const __itt_domain *domain, __itt_id id, __itt_id parentid,2425 __itt_string_handle *name))2426ITT_STUBV(ITTAPI, void, task_begin_fn,2427 (const __itt_domain *domain, __itt_id id, __itt_id parentid,2428 void *fn))2429ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain))2430ITT_STUBV(ITTAPI, void, task_begin_overlapped,2431 (const __itt_domain *domain, __itt_id taskid, __itt_id parentid,2432 __itt_string_handle *name))2433ITT_STUBV(ITTAPI, void, task_end_overlapped,2434 (const __itt_domain *domain, __itt_id taskid))2435#define __itt_task_begin(d, x, y, z) ITTNOTIFY_VOID_D3(task_begin, d, x, y, z)2436#define __itt_task_begin_ptr ITTNOTIFY_NAME(task_begin)2437#define __itt_task_begin_fn(d, x, y, z) \2438 ITTNOTIFY_VOID_D3(task_begin_fn, d, x, y, z)2439#define __itt_task_begin_fn_ptr ITTNOTIFY_NAME(task_begin_fn)2440#define __itt_task_end(d) ITTNOTIFY_VOID_D0(task_end, d)2441#define __itt_task_end_ptr ITTNOTIFY_NAME(task_end)2442#define __itt_task_begin_overlapped(d, x, y, z) \2443 ITTNOTIFY_VOID_D3(task_begin_overlapped, d, x, y, z)2444#define __itt_task_begin_overlapped_ptr ITTNOTIFY_NAME(task_begin_overlapped)2445#define __itt_task_end_overlapped(d, x) \2446 ITTNOTIFY_VOID_D1(task_end_overlapped, d, x)2447#define __itt_task_end_overlapped_ptr ITTNOTIFY_NAME(task_end_overlapped)2448#else /* INTEL_NO_ITTNOTIFY_API */2449#define __itt_task_begin(domain, id, parentid, name)2450#define __itt_task_begin_ptr 02451#define __itt_task_begin_fn(domain, id, parentid, fn)2452#define __itt_task_begin_fn_ptr 02453#define __itt_task_end(domain)2454#define __itt_task_end_ptr 02455#define __itt_task_begin_overlapped(domain, taskid, parentid, name)2456#define __itt_task_begin_overlapped_ptr 02457#define __itt_task_end_overlapped(domain, taskid)2458#define __itt_task_end_overlapped_ptr 02459#endif /* INTEL_NO_ITTNOTIFY_API */2460#else /* INTEL_NO_MACRO_BODY */2461#define __itt_task_begin_ptr 02462#define __itt_task_begin_fn_ptr 02463#define __itt_task_end_ptr 02464#define __itt_task_begin_overlapped_ptr 02465#define __itt_task_end_overlapped_ptr 02466#endif /* INTEL_NO_MACRO_BODY */2467/** @endcond */2468/** @} tasks group */2469 2470/**2471 * @defgroup markers Markers2472 * Markers represent a single discreet event in time. Markers have a scope,2473 * described by an enumerated type __itt_scope. Markers are created by2474 * the API call __itt_marker. A marker instance can be given an ID for use in2475 * adding metadata.2476 * @{2477 */2478 2479/**2480 * @brief Describes the scope of an event object in the trace.2481 */2482typedef enum {2483 __itt_scope_unknown = 0,2484 __itt_scope_global,2485 __itt_scope_track_group,2486 __itt_scope_track,2487 __itt_scope_task,2488 __itt_scope_marker2489} __itt_scope;2490 2491/** @cond exclude_from_documentation */2492#define __itt_marker_scope_unknown __itt_scope_unknown2493#define __itt_marker_scope_global __itt_scope_global2494#define __itt_marker_scope_process __itt_scope_track_group2495#define __itt_marker_scope_thread __itt_scope_track2496#define __itt_marker_scope_task __itt_scope_task2497/** @endcond */2498 2499/**2500 * @ingroup markers2501 * @brief Create a marker instance2502 * @param[in] domain The domain for this marker2503 * @param[in] id The instance ID for this marker or __itt_null2504 * @param[in] name The name for this marker2505 * @param[in] scope The scope for this marker2506 */2507void ITTAPI __itt_marker(const __itt_domain *domain, __itt_id id,2508 __itt_string_handle *name, __itt_scope scope);2509 2510/** @cond exclude_from_documentation */2511#ifndef INTEL_NO_MACRO_BODY2512#ifndef INTEL_NO_ITTNOTIFY_API2513ITT_STUBV(ITTAPI, void, marker,2514 (const __itt_domain *domain, __itt_id id, __itt_string_handle *name,2515 __itt_scope scope))2516#define __itt_marker(d, x, y, z) ITTNOTIFY_VOID_D3(marker, d, x, y, z)2517#define __itt_marker_ptr ITTNOTIFY_NAME(marker)2518#else /* INTEL_NO_ITTNOTIFY_API */2519#define __itt_marker(domain, id, name, scope)2520#define __itt_marker_ptr 02521#endif /* INTEL_NO_ITTNOTIFY_API */2522#else /* INTEL_NO_MACRO_BODY */2523#define __itt_marker_ptr 02524#endif /* INTEL_NO_MACRO_BODY */2525/** @endcond */2526/** @} markers group */2527 2528/**2529 * @defgroup metadata Metadata2530 * The metadata API is used to attach extra information to named2531 * entities. Metadata can be attached to an identified named entity by ID,2532 * or to the current entity (which is always a task).2533 *2534 * Conceptually metadata has a type (what kind of metadata), a key (the2535 * name of the metadata), and a value (the actual data). The encoding of2536 * the value depends on the type of the metadata.2537 *2538 * The type of metadata is specified by an enumerated type __itt_metdata_type.2539 * @{2540 */2541 2542/**2543 * @ingroup parameters2544 * @brief describes the type of metadata2545 */2546typedef enum {2547 __itt_metadata_unknown = 0,2548 __itt_metadata_u64, /**< Unsigned 64-bit integer */2549 __itt_metadata_s64, /**< Signed 64-bit integer */2550 __itt_metadata_u32, /**< Unsigned 32-bit integer */2551 __itt_metadata_s32, /**< Signed 32-bit integer */2552 __itt_metadata_u16, /**< Unsigned 16-bit integer */2553 __itt_metadata_s16, /**< Signed 16-bit integer */2554 __itt_metadata_float, /**< Signed 32-bit floating-point */2555 __itt_metadata_double /**< SIgned 64-bit floating-point */2556} __itt_metadata_type;2557 2558/**2559 * @ingroup parameters2560 * @brief Add metadata to an instance of a named entity.2561 * @param[in] domain The domain controlling the call2562 * @param[in] id The identifier of the instance to which the metadata is to be2563 * added, or __itt_null to add to the current task2564 * @param[in] key The name of the metadata2565 * @param[in] type The type of the metadata2566 * @param[in] count The number of elements of the given type. If count == 0, no2567 * metadata will be added.2568 * @param[in] data The metadata itself2569 */2570void ITTAPI __itt_metadata_add(const __itt_domain *domain, __itt_id id,2571 __itt_string_handle *key,2572 __itt_metadata_type type, size_t count,2573 void *data);2574 2575/** @cond exclude_from_documentation */2576#ifndef INTEL_NO_MACRO_BODY2577#ifndef INTEL_NO_ITTNOTIFY_API2578ITT_STUBV(ITTAPI, void, metadata_add,2579 (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,2580 __itt_metadata_type type, size_t count, void *data))2581#define __itt_metadata_add(d, x, y, z, a, b) \2582 ITTNOTIFY_VOID_D5(metadata_add, d, x, y, z, a, b)2583#define __itt_metadata_add_ptr ITTNOTIFY_NAME(metadata_add)2584#else /* INTEL_NO_ITTNOTIFY_API */2585#define __itt_metadata_add(d, x, y, z, a, b)2586#define __itt_metadata_add_ptr 02587#endif /* INTEL_NO_ITTNOTIFY_API */2588#else /* INTEL_NO_MACRO_BODY */2589#define __itt_metadata_add_ptr 02590#endif /* INTEL_NO_MACRO_BODY */2591/** @endcond */2592 2593/**2594 * @ingroup parameters2595 * @brief Add string metadata to an instance of a named entity.2596 * @param[in] domain The domain controlling the call2597 * @param[in] id The identifier of the instance to which the metadata is to be2598 * added, or __itt_null to add to the current task2599 * @param[in] key The name of the metadata2600 * @param[in] data The metadata itself2601 * @param[in] length The number of characters in the string, or -1 if the length2602 * is unknown but the string is null-terminated2603 */2604#if ITT_PLATFORM == ITT_PLATFORM_WIN2605void ITTAPI __itt_metadata_str_addA(const __itt_domain *domain, __itt_id id,2606 __itt_string_handle *key, const char *data,2607 size_t length);2608void ITTAPI __itt_metadata_str_addW(const __itt_domain *domain, __itt_id id,2609 __itt_string_handle *key,2610 const wchar_t *data, size_t length);2611#if defined(UNICODE) || defined(_UNICODE)2612#define __itt_metadata_str_add __itt_metadata_str_addW2613#define __itt_metadata_str_add_ptr __itt_metadata_str_addW_ptr2614#else /* UNICODE */2615#define __itt_metadata_str_add __itt_metadata_str_addA2616#define __itt_metadata_str_add_ptr __itt_metadata_str_addA_ptr2617#endif /* UNICODE */2618#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2619void ITTAPI __itt_metadata_str_add(const __itt_domain *domain, __itt_id id,2620 __itt_string_handle *key, const char *data,2621 size_t length);2622#endif2623 2624/** @cond exclude_from_documentation */2625#ifndef INTEL_NO_MACRO_BODY2626#ifndef INTEL_NO_ITTNOTIFY_API2627#if ITT_PLATFORM == ITT_PLATFORM_WIN2628ITT_STUBV(ITTAPI, void, metadata_str_addA,2629 (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,2630 const char *data, size_t length))2631ITT_STUBV(ITTAPI, void, metadata_str_addW,2632 (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,2633 const wchar_t *data, size_t length))2634#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2635ITT_STUBV(ITTAPI, void, metadata_str_add,2636 (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,2637 const char *data, size_t length))2638#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2639#if ITT_PLATFORM == ITT_PLATFORM_WIN2640#define __itt_metadata_str_addA(d, x, y, z, a) \2641 ITTNOTIFY_VOID_D4(metadata_str_addA, d, x, y, z, a)2642#define __itt_metadata_str_addA_ptr ITTNOTIFY_NAME(metadata_str_addA)2643#define __itt_metadata_str_addW(d, x, y, z, a) \2644 ITTNOTIFY_VOID_D4(metadata_str_addW, d, x, y, z, a)2645#define __itt_metadata_str_addW_ptr ITTNOTIFY_NAME(metadata_str_addW)2646#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2647#define __itt_metadata_str_add(d, x, y, z, a) \2648 ITTNOTIFY_VOID_D4(metadata_str_add, d, x, y, z, a)2649#define __itt_metadata_str_add_ptr ITTNOTIFY_NAME(metadata_str_add)2650#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2651#else /* INTEL_NO_ITTNOTIFY_API */2652#if ITT_PLATFORM == ITT_PLATFORM_WIN2653#define __itt_metadata_str_addA(d, x, y, z, a)2654#define __itt_metadata_str_addA_ptr 02655#define __itt_metadata_str_addW(d, x, y, z, a)2656#define __itt_metadata_str_addW_ptr 02657#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2658#define __itt_metadata_str_add(d, x, y, z, a)2659#define __itt_metadata_str_add_ptr 02660#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2661#endif /* INTEL_NO_ITTNOTIFY_API */2662#else /* INTEL_NO_MACRO_BODY */2663#if ITT_PLATFORM == ITT_PLATFORM_WIN2664#define __itt_metadata_str_addA_ptr 02665#define __itt_metadata_str_addW_ptr 02666#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2667#define __itt_metadata_str_add_ptr 02668#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2669#endif /* INTEL_NO_MACRO_BODY */2670/** @endcond */2671 2672/**2673 * @ingroup parameters2674 * @brief Add metadata to an instance of a named entity.2675 * @param[in] domain The domain controlling the call2676 * @param[in] scope The scope of the instance to which the metadata is to be2677 added2678 2679 * @param[in] id The identifier of the instance to which the metadata is to be2680 added, or __itt_null to add to the current task2681 2682 * @param[in] key The name of the metadata2683 * @param[in] type The type of the metadata2684 * @param[in] count The number of elements of the given type. If count == 0, no2685 metadata will be added.2686 * @param[in] data The metadata itself2687*/2688void ITTAPI __itt_metadata_add_with_scope(const __itt_domain *domain,2689 __itt_scope scope,2690 __itt_string_handle *key,2691 __itt_metadata_type type,2692 size_t count, void *data);2693 2694/** @cond exclude_from_documentation */2695#ifndef INTEL_NO_MACRO_BODY2696#ifndef INTEL_NO_ITTNOTIFY_API2697ITT_STUBV(ITTAPI, void, metadata_add_with_scope,2698 (const __itt_domain *domain, __itt_scope scope,2699 __itt_string_handle *key, __itt_metadata_type type, size_t count,2700 void *data))2701#define __itt_metadata_add_with_scope(d, x, y, z, a, b) \2702 ITTNOTIFY_VOID_D5(metadata_add_with_scope, d, x, y, z, a, b)2703#define __itt_metadata_add_with_scope_ptr \2704 ITTNOTIFY_NAME(metadata_add_with_scope)2705#else /* INTEL_NO_ITTNOTIFY_API */2706#define __itt_metadata_add_with_scope(d, x, y, z, a, b)2707#define __itt_metadata_add_with_scope_ptr 02708#endif /* INTEL_NO_ITTNOTIFY_API */2709#else /* INTEL_NO_MACRO_BODY */2710#define __itt_metadata_add_with_scope_ptr 02711#endif /* INTEL_NO_MACRO_BODY */2712/** @endcond */2713 2714/**2715 * @ingroup parameters2716 * @brief Add string metadata to an instance of a named entity.2717 * @param[in] domain The domain controlling the call2718 * @param[in] scope The scope of the instance to which the metadata is to be2719 added2720 2721 * @param[in] id The identifier of the instance to which the metadata is to be2722 added, or __itt_null to add to the current task2723 2724 * @param[in] key The name of the metadata2725 * @param[in] data The metadata itself2726 * @param[in] length The number of characters in the string, or -1 if the length2727 is unknown but the string is null-terminated2728*/2729#if ITT_PLATFORM == ITT_PLATFORM_WIN2730void ITTAPI __itt_metadata_str_add_with_scopeA(const __itt_domain *domain,2731 __itt_scope scope,2732 __itt_string_handle *key,2733 const char *data, size_t length);2734void ITTAPI __itt_metadata_str_add_with_scopeW(const __itt_domain *domain,2735 __itt_scope scope,2736 __itt_string_handle *key,2737 const wchar_t *data,2738 size_t length);2739#if defined(UNICODE) || defined(_UNICODE)2740#define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeW2741#define __itt_metadata_str_add_with_scope_ptr \2742 __itt_metadata_str_add_with_scopeW_ptr2743#else /* UNICODE */2744#define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeA2745#define __itt_metadata_str_add_with_scope_ptr \2746 __itt_metadata_str_add_with_scopeA_ptr2747#endif /* UNICODE */2748#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2749void ITTAPI __itt_metadata_str_add_with_scope(const __itt_domain *domain,2750 __itt_scope scope,2751 __itt_string_handle *key,2752 const char *data, size_t length);2753#endif2754 2755/** @cond exclude_from_documentation */2756#ifndef INTEL_NO_MACRO_BODY2757#ifndef INTEL_NO_ITTNOTIFY_API2758#if ITT_PLATFORM == ITT_PLATFORM_WIN2759ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA,2760 (const __itt_domain *domain, __itt_scope scope,2761 __itt_string_handle *key, const char *data, size_t length))2762ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW,2763 (const __itt_domain *domain, __itt_scope scope,2764 __itt_string_handle *key, const wchar_t *data, size_t length))2765#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2766ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope,2767 (const __itt_domain *domain, __itt_scope scope,2768 __itt_string_handle *key, const char *data, size_t length))2769#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2770#if ITT_PLATFORM == ITT_PLATFORM_WIN2771#define __itt_metadata_str_add_with_scopeA(d, x, y, z, a) \2772 ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeA, d, x, y, z, a)2773#define __itt_metadata_str_add_with_scopeA_ptr \2774 ITTNOTIFY_NAME(metadata_str_add_with_scopeA)2775#define __itt_metadata_str_add_with_scopeW(d, x, y, z, a) \2776 ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeW, d, x, y, z, a)2777#define __itt_metadata_str_add_with_scopeW_ptr \2778 ITTNOTIFY_NAME(metadata_str_add_with_scopeW)2779#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2780#define __itt_metadata_str_add_with_scope(d, x, y, z, a) \2781 ITTNOTIFY_VOID_D4(metadata_str_add_with_scope, d, x, y, z, a)2782#define __itt_metadata_str_add_with_scope_ptr \2783 ITTNOTIFY_NAME(metadata_str_add_with_scope)2784#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2785#else /* INTEL_NO_ITTNOTIFY_API */2786#if ITT_PLATFORM == ITT_PLATFORM_WIN2787#define __itt_metadata_str_add_with_scopeA(d, x, y, z, a)2788#define __itt_metadata_str_add_with_scopeA_ptr 02789#define __itt_metadata_str_add_with_scopeW(d, x, y, z, a)2790#define __itt_metadata_str_add_with_scopeW_ptr 02791#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2792#define __itt_metadata_str_add_with_scope(d, x, y, z, a)2793#define __itt_metadata_str_add_with_scope_ptr 02794#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2795#endif /* INTEL_NO_ITTNOTIFY_API */2796#else /* INTEL_NO_MACRO_BODY */2797#if ITT_PLATFORM == ITT_PLATFORM_WIN2798#define __itt_metadata_str_add_with_scopeA_ptr 02799#define __itt_metadata_str_add_with_scopeW_ptr 02800#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */2801#define __itt_metadata_str_add_with_scope_ptr 02802#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */2803#endif /* INTEL_NO_MACRO_BODY */2804/** @endcond */2805 2806/** @} metadata group */2807 2808/**2809 * @defgroup relations Relations2810 * Instances of named entities can be explicitly associated with other2811 * instances using instance IDs and the relationship API calls.2812 *2813 * @{2814 */2815 2816/**2817 * @ingroup relations2818 * @brief The kind of relation between two instances is specified by the2819 * enumerated type __itt_relation. Relations between instances can be added with2820 * an API call. The relation API uses instance IDs. Relations can be added2821 * before or after the actual instances are created and persist independently of2822 * the instances. This is the motivation for having different lifetimes for2823 * instance IDs and the actual instances.2824 */2825typedef enum {2826 __itt_relation_is_unknown = 0,2827 __itt_relation_is_dependent_on, /**< "A is dependent on B" means that A cannot2828 start until B completes */2829 __itt_relation_is_sibling_of, /**< "A is sibling of B" means that A and B were2830 created as a group */2831 __itt_relation_is_parent_of, /**< "A is parent of B" means that A created B */2832 __itt_relation_is_continuation_of, /**< "A is continuation of B" means that A2833 assumes the dependencies of B */2834 __itt_relation_is_child_of, /**< "A is child of B" means that A was created by2835 B (inverse of is_parent_of) */2836 __itt_relation_is_continued_by, /**< "A is continued by B" means that B2837 assumes the dependencies of A (inverse of2838 is_continuation_of) */2839 __itt_relation_is_predecessor_to /**< "A is predecessor to B" means that B2840 cannot start until A completes (inverse of2841 is_dependent_on) */2842} __itt_relation;2843 2844/**2845 * @ingroup relations2846 * @brief Add a relation to the current task instance.2847 * The current task instance is the head of the relation.2848 * @param[in] domain The domain controlling this call2849 * @param[in] relation The kind of relation2850 * @param[in] tail The ID for the tail of the relation2851 */2852void ITTAPI __itt_relation_add_to_current(const __itt_domain *domain,2853 __itt_relation relation,2854 __itt_id tail);2855 2856/**2857 * @ingroup relations2858 * @brief Add a relation between two instance identifiers.2859 * @param[in] domain The domain controlling this call2860 * @param[in] head The ID for the head of the relation2861 * @param[in] relation The kind of relation2862 * @param[in] tail The ID for the tail of the relation2863 */2864void ITTAPI __itt_relation_add(const __itt_domain *domain, __itt_id head,2865 __itt_relation relation, __itt_id tail);2866 2867/** @cond exclude_from_documentation */2868#ifndef INTEL_NO_MACRO_BODY2869#ifndef INTEL_NO_ITTNOTIFY_API2870ITT_STUBV(ITTAPI, void, relation_add_to_current,2871 (const __itt_domain *domain, __itt_relation relation, __itt_id tail))2872ITT_STUBV(ITTAPI, void, relation_add,2873 (const __itt_domain *domain, __itt_id head, __itt_relation relation,2874 __itt_id tail))2875#define __itt_relation_add_to_current(d, x, y) \2876 ITTNOTIFY_VOID_D2(relation_add_to_current, d, x, y)2877#define __itt_relation_add_to_current_ptr \2878 ITTNOTIFY_NAME(relation_add_to_current)2879#define __itt_relation_add(d, x, y, z) \2880 ITTNOTIFY_VOID_D3(relation_add, d, x, y, z)2881#define __itt_relation_add_ptr ITTNOTIFY_NAME(relation_add)2882#else /* INTEL_NO_ITTNOTIFY_API */2883#define __itt_relation_add_to_current(d, x, y)2884#define __itt_relation_add_to_current_ptr 02885#define __itt_relation_add(d, x, y, z)2886#define __itt_relation_add_ptr 02887#endif /* INTEL_NO_ITTNOTIFY_API */2888#else /* INTEL_NO_MACRO_BODY */2889#define __itt_relation_add_to_current_ptr 02890#define __itt_relation_add_ptr 02891#endif /* INTEL_NO_MACRO_BODY */2892/** @endcond */2893/** @} relations group */2894 2895/** @cond exclude_from_documentation */2896#pragma pack(push, 8)2897 2898typedef struct ___itt_clock_info {2899 unsigned long long clock_freq; /*!< Clock domain frequency */2900 unsigned long long clock_base; /*!< Clock domain base timestamp */2901} __itt_clock_info;2902 2903#pragma pack(pop)2904/** @endcond */2905 2906/** @cond exclude_from_documentation */2907typedef void(ITTAPI *__itt_get_clock_info_fn)(__itt_clock_info *clock_info,2908 void *data);2909/** @endcond */2910 2911/** @cond exclude_from_documentation */2912#pragma pack(push, 8)2913 2914typedef struct ___itt_clock_domain {2915 __itt_clock_info info; /*!< Most recent clock domain info */2916 __itt_get_clock_info_fn fn; /*!< Callback function pointer */2917 void *fn_data; /*!< Input argument for the callback function */2918 int extra1; /*!< Reserved. Must be zero */2919 void *extra2; /*!< Reserved. Must be zero */2920 struct ___itt_clock_domain *next;2921} __itt_clock_domain;2922 2923#pragma pack(pop)2924/** @endcond */2925 2926/**2927 * @ingroup clockdomains2928 * @brief Create a clock domain.2929 * Certain applications require the capability to trace their application using2930 * a clock domain different than the CPU, for instance the instrumentation of2931 * events that occur on a GPU. Because the set of domains is expected to be2932 * static over the application's execution time, there is no mechanism to2933 * destroy a domain. Any domain can be accessed by any thread in the process,2934 * regardless of which thread created the domain. This call is thread-safe.2935 * @param[in] fn A pointer to a callback function which retrieves alternative2936 * CPU timestamps2937 * @param[in] fn_data Argument for a callback function; may be NULL2938 */2939__itt_clock_domain *ITTAPI __itt_clock_domain_create(__itt_get_clock_info_fn fn,2940 void *fn_data);2941 2942/** @cond exclude_from_documentation */2943#ifndef INTEL_NO_MACRO_BODY2944#ifndef INTEL_NO_ITTNOTIFY_API2945ITT_STUB(ITTAPI, __itt_clock_domain *, clock_domain_create,2946 (__itt_get_clock_info_fn fn, void *fn_data))2947#define __itt_clock_domain_create ITTNOTIFY_DATA(clock_domain_create)2948#define __itt_clock_domain_create_ptr ITTNOTIFY_NAME(clock_domain_create)2949#else /* INTEL_NO_ITTNOTIFY_API */2950#define __itt_clock_domain_create(fn, fn_data) (__itt_clock_domain *)02951#define __itt_clock_domain_create_ptr 02952#endif /* INTEL_NO_ITTNOTIFY_API */2953#else /* INTEL_NO_MACRO_BODY */2954#define __itt_clock_domain_create_ptr 02955#endif /* INTEL_NO_MACRO_BODY */2956/** @endcond */2957 2958/**2959 * @ingroup clockdomains2960 * @brief Recalculate clock domains frequencies and clock base timestamps.2961 */2962void ITTAPI __itt_clock_domain_reset(void);2963 2964/** @cond exclude_from_documentation */2965#ifndef INTEL_NO_MACRO_BODY2966#ifndef INTEL_NO_ITTNOTIFY_API2967ITT_STUBV(ITTAPI, void, clock_domain_reset, (void))2968#define __itt_clock_domain_reset ITTNOTIFY_VOID(clock_domain_reset)2969#define __itt_clock_domain_reset_ptr ITTNOTIFY_NAME(clock_domain_reset)2970#else /* INTEL_NO_ITTNOTIFY_API */2971#define __itt_clock_domain_reset()2972#define __itt_clock_domain_reset_ptr 02973#endif /* INTEL_NO_ITTNOTIFY_API */2974#else /* INTEL_NO_MACRO_BODY */2975#define __itt_clock_domain_reset_ptr 02976#endif /* INTEL_NO_MACRO_BODY */2977/** @endcond */2978 2979/**2980 * @ingroup clockdomain2981 * @brief Create an instance of identifier. This establishes the beginning of2982 * the lifetime of an instance of the given ID in the trace. Once this lifetime2983 * starts, the ID can be used to tag named entity instances in calls such as2984 * __itt_task_begin, and to specify relationships among identified named entity2985 * instances, using the \ref relations APIs.2986 * @param[in] domain The domain controlling the execution of this call.2987 * @param[in] clock_domain The clock domain controlling the execution of this2988 * call.2989 * @param[in] timestamp The user defined timestamp.2990 * @param[in] id The ID to create.2991 */2992void ITTAPI __itt_id_create_ex(const __itt_domain *domain,2993 __itt_clock_domain *clock_domain,2994 unsigned long long timestamp, __itt_id id);2995 2996/**2997 * @ingroup clockdomain2998 * @brief Destroy an instance of identifier. This ends the lifetime of the2999 * current instance of the given ID value in the trace. Any relationships that3000 * are established after this lifetime ends are invalid. This call must be3001 * performed before the given ID value can be reused for a different named3002 * entity instance.3003 * @param[in] domain The domain controlling the execution of this call.3004 * @param[in] clock_domain The clock domain controlling the execution of this3005 * call.3006 * @param[in] timestamp The user defined timestamp.3007 * @param[in] id The ID to destroy.3008 */3009void ITTAPI __itt_id_destroy_ex(const __itt_domain *domain,3010 __itt_clock_domain *clock_domain,3011 unsigned long long timestamp, __itt_id id);3012 3013/** @cond exclude_from_documentation */3014#ifndef INTEL_NO_MACRO_BODY3015#ifndef INTEL_NO_ITTNOTIFY_API3016ITT_STUBV(ITTAPI, void, id_create_ex,3017 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3018 unsigned long long timestamp, __itt_id id))3019ITT_STUBV(ITTAPI, void, id_destroy_ex,3020 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3021 unsigned long long timestamp, __itt_id id))3022#define __itt_id_create_ex(d, x, y, z) \3023 ITTNOTIFY_VOID_D3(id_create_ex, d, x, y, z)3024#define __itt_id_create_ex_ptr ITTNOTIFY_NAME(id_create_ex)3025#define __itt_id_destroy_ex(d, x, y, z) \3026 ITTNOTIFY_VOID_D3(id_destroy_ex, d, x, y, z)3027#define __itt_id_destroy_ex_ptr ITTNOTIFY_NAME(id_destroy_ex)3028#else /* INTEL_NO_ITTNOTIFY_API */3029#define __itt_id_create_ex(domain, clock_domain, timestamp, id)3030#define __itt_id_create_ex_ptr 03031#define __itt_id_destroy_ex(domain, clock_domain, timestamp, id)3032#define __itt_id_destroy_ex_ptr 03033#endif /* INTEL_NO_ITTNOTIFY_API */3034#else /* INTEL_NO_MACRO_BODY */3035#define __itt_id_create_ex_ptr 03036#define __itt_id_destroy_ex_ptr 03037#endif /* INTEL_NO_MACRO_BODY */3038/** @endcond */3039 3040/**3041 * @ingroup clockdomain3042 * @brief Begin a task instance.3043 * @param[in] domain The domain for this task3044 * @param[in] clock_domain The clock domain controlling the execution of this3045 * call.3046 * @param[in] timestamp The user defined timestamp.3047 * @param[in] taskid The instance ID for this task instance, or __itt_null3048 * @param[in] parentid The parent instance to which this task instance belongs,3049 * or __itt_null3050 * @param[in] name The name of this task3051 */3052void ITTAPI __itt_task_begin_ex(const __itt_domain *domain,3053 __itt_clock_domain *clock_domain,3054 unsigned long long timestamp, __itt_id taskid,3055 __itt_id parentid, __itt_string_handle *name);3056 3057/**3058 * @ingroup clockdomain3059 * @brief Begin a task instance.3060 * @param[in] domain The domain for this task3061 * @param[in] clock_domain The clock domain controlling the execution of this3062 * call.3063 * @param[in] timestamp The user defined timestamp.3064 * @param[in] taskid The identifier for this task instance, or __itt_null3065 * @param[in] parentid The parent of this task, or __itt_null3066 * @param[in] fn The pointer to the function you are tracing3067 */3068void ITTAPI __itt_task_begin_fn_ex(const __itt_domain *domain,3069 __itt_clock_domain *clock_domain,3070 unsigned long long timestamp,3071 __itt_id taskid, __itt_id parentid,3072 void *fn);3073 3074/**3075 * @ingroup clockdomain3076 * @brief End the current task instance.3077 * @param[in] domain The domain for this task3078 * @param[in] clock_domain The clock domain controlling the execution of this3079 * call.3080 * @param[in] timestamp The user defined timestamp.3081 */3082void ITTAPI __itt_task_end_ex(const __itt_domain *domain,3083 __itt_clock_domain *clock_domain,3084 unsigned long long timestamp);3085 3086/** @cond exclude_from_documentation */3087#ifndef INTEL_NO_MACRO_BODY3088#ifndef INTEL_NO_ITTNOTIFY_API3089ITT_STUBV(ITTAPI, void, task_begin_ex,3090 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3091 unsigned long long timestamp, __itt_id id, __itt_id parentid,3092 __itt_string_handle *name))3093ITT_STUBV(ITTAPI, void, task_begin_fn_ex,3094 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3095 unsigned long long timestamp, __itt_id id, __itt_id parentid,3096 void *fn))3097ITT_STUBV(ITTAPI, void, task_end_ex,3098 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3099 unsigned long long timestamp))3100#define __itt_task_begin_ex(d, x, y, z, a, b) \3101 ITTNOTIFY_VOID_D5(task_begin_ex, d, x, y, z, a, b)3102#define __itt_task_begin_ex_ptr ITTNOTIFY_NAME(task_begin_ex)3103#define __itt_task_begin_fn_ex(d, x, y, z, a, b) \3104 ITTNOTIFY_VOID_D5(task_begin_fn_ex, d, x, y, z, a, b)3105#define __itt_task_begin_fn_ex_ptr ITTNOTIFY_NAME(task_begin_fn_ex)3106#define __itt_task_end_ex(d, x, y) ITTNOTIFY_VOID_D2(task_end_ex, d, x, y)3107#define __itt_task_end_ex_ptr ITTNOTIFY_NAME(task_end_ex)3108#else /* INTEL_NO_ITTNOTIFY_API */3109#define __itt_task_begin_ex(domain, clock_domain, timestamp, id, parentid, name)3110#define __itt_task_begin_ex_ptr 03111#define __itt_task_begin_fn_ex(domain, clock_domain, timestamp, id, parentid, \3112 fn)3113#define __itt_task_begin_fn_ex_ptr 03114#define __itt_task_end_ex(domain, clock_domain, timestamp)3115#define __itt_task_end_ex_ptr 03116#endif /* INTEL_NO_ITTNOTIFY_API */3117#else /* INTEL_NO_MACRO_BODY */3118#define __itt_task_begin_ex_ptr 03119#define __itt_task_begin_fn_ex_ptr 03120#define __itt_task_end_ex_ptr 03121#endif /* INTEL_NO_MACRO_BODY */3122/** @endcond */3123 3124/**3125 * @defgroup counters Counters3126 * @ingroup public3127 * Counters are user-defined objects with a monotonically increasing3128 * value. Counter values are 64-bit unsigned integers.3129 * Counters have names that can be displayed in3130 * the tools.3131 * @{3132 */3133 3134/**3135 * @brief opaque structure for counter identification3136 */3137/** @cond exclude_from_documentation */3138 3139typedef struct ___itt_counter *__itt_counter;3140 3141/**3142 * @brief Create an unsigned 64 bits integer counter with given name/domain3143 *3144 * After __itt_counter_create() is called, __itt_counter_inc(id),3145 * __itt_counter_inc_delta(id, delta),3146 * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id,3147 * clock_domain, timestamp, value_ptr) can be used to change the value of the3148 * counter, where value_ptr is a pointer to an unsigned 64 bits integer3149 *3150 * The call is equal to __itt_counter_create_typed(name, domain,3151 * __itt_metadata_u64)3152 */3153#if ITT_PLATFORM == ITT_PLATFORM_WIN3154__itt_counter ITTAPI __itt_counter_createA(const char *name,3155 const char *domain);3156__itt_counter ITTAPI __itt_counter_createW(const wchar_t *name,3157 const wchar_t *domain);3158#if defined(UNICODE) || defined(_UNICODE)3159#define __itt_counter_create __itt_counter_createW3160#define __itt_counter_create_ptr __itt_counter_createW_ptr3161#else /* UNICODE */3162#define __itt_counter_create __itt_counter_createA3163#define __itt_counter_create_ptr __itt_counter_createA_ptr3164#endif /* UNICODE */3165#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3166__itt_counter ITTAPI __itt_counter_create(const char *name, const char *domain);3167#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3168 3169#ifndef INTEL_NO_MACRO_BODY3170#ifndef INTEL_NO_ITTNOTIFY_API3171#if ITT_PLATFORM == ITT_PLATFORM_WIN3172ITT_STUB(ITTAPI, __itt_counter, counter_createA,3173 (const char *name, const char *domain))3174ITT_STUB(ITTAPI, __itt_counter, counter_createW,3175 (const wchar_t *name, const wchar_t *domain))3176#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3177ITT_STUB(ITTAPI, __itt_counter, counter_create,3178 (const char *name, const char *domain))3179#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3180#if ITT_PLATFORM == ITT_PLATFORM_WIN3181#define __itt_counter_createA ITTNOTIFY_DATA(counter_createA)3182#define __itt_counter_createA_ptr ITTNOTIFY_NAME(counter_createA)3183#define __itt_counter_createW ITTNOTIFY_DATA(counter_createW)3184#define __itt_counter_createW_ptr ITTNOTIFY_NAME(counter_createW)3185#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3186#define __itt_counter_create ITTNOTIFY_DATA(counter_create)3187#define __itt_counter_create_ptr ITTNOTIFY_NAME(counter_create)3188#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3189#else /* INTEL_NO_ITTNOTIFY_API */3190#if ITT_PLATFORM == ITT_PLATFORM_WIN3191#define __itt_counter_createA(name, domain)3192#define __itt_counter_createA_ptr 03193#define __itt_counter_createW(name, domain)3194#define __itt_counter_createW_ptr 03195#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3196#define __itt_counter_create(name, domain)3197#define __itt_counter_create_ptr 03198#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3199#endif /* INTEL_NO_ITTNOTIFY_API */3200#else /* INTEL_NO_MACRO_BODY */3201#if ITT_PLATFORM == ITT_PLATFORM_WIN3202#define __itt_counter_createA_ptr 03203#define __itt_counter_createW_ptr 03204#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3205#define __itt_counter_create_ptr 03206#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3207#endif /* INTEL_NO_MACRO_BODY */3208/** @endcond */3209 3210/**3211 * @brief Increment the unsigned 64 bits integer counter value3212 *3213 * Calling this function to non-unsigned 64 bits integer counters has no effect3214 */3215void ITTAPI __itt_counter_inc(__itt_counter id);3216 3217#ifndef INTEL_NO_MACRO_BODY3218#ifndef INTEL_NO_ITTNOTIFY_API3219ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id))3220#define __itt_counter_inc ITTNOTIFY_VOID(counter_inc)3221#define __itt_counter_inc_ptr ITTNOTIFY_NAME(counter_inc)3222#else /* INTEL_NO_ITTNOTIFY_API */3223#define __itt_counter_inc(id)3224#define __itt_counter_inc_ptr 03225#endif /* INTEL_NO_ITTNOTIFY_API */3226#else /* INTEL_NO_MACRO_BODY */3227#define __itt_counter_inc_ptr 03228#endif /* INTEL_NO_MACRO_BODY */3229/** @endcond */3230/**3231 * @brief Increment the unsigned 64 bits integer counter value with x3232 *3233 * Calling this function to non-unsigned 64 bits integer counters has no effect3234 */3235void ITTAPI __itt_counter_inc_delta(__itt_counter id, unsigned long long value);3236 3237#ifndef INTEL_NO_MACRO_BODY3238#ifndef INTEL_NO_ITTNOTIFY_API3239ITT_STUBV(ITTAPI, void, counter_inc_delta,3240 (__itt_counter id, unsigned long long value))3241#define __itt_counter_inc_delta ITTNOTIFY_VOID(counter_inc_delta)3242#define __itt_counter_inc_delta_ptr ITTNOTIFY_NAME(counter_inc_delta)3243#else /* INTEL_NO_ITTNOTIFY_API */3244#define __itt_counter_inc_delta(id, value)3245#define __itt_counter_inc_delta_ptr 03246#endif /* INTEL_NO_ITTNOTIFY_API */3247#else /* INTEL_NO_MACRO_BODY */3248#define __itt_counter_inc_delta_ptr 03249#endif /* INTEL_NO_MACRO_BODY */3250/** @endcond */3251 3252/**3253 * @brief Decrement the unsigned 64 bits integer counter value3254 *3255 * Calling this function to non-unsigned 64 bits integer counters has no effect3256 */3257void ITTAPI __itt_counter_dec(__itt_counter id);3258 3259#ifndef INTEL_NO_MACRO_BODY3260#ifndef INTEL_NO_ITTNOTIFY_API3261ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id))3262#define __itt_counter_dec ITTNOTIFY_VOID(counter_dec)3263#define __itt_counter_dec_ptr ITTNOTIFY_NAME(counter_dec)3264#else /* INTEL_NO_ITTNOTIFY_API */3265#define __itt_counter_dec(id)3266#define __itt_counter_dec_ptr 03267#endif /* INTEL_NO_ITTNOTIFY_API */3268#else /* INTEL_NO_MACRO_BODY */3269#define __itt_counter_dec_ptr 03270#endif /* INTEL_NO_MACRO_BODY */3271/** @endcond */3272/**3273 * @brief Decrement the unsigned 64 bits integer counter value with x3274 *3275 * Calling this function to non-unsigned 64 bits integer counters has no effect3276 */3277void ITTAPI __itt_counter_dec_delta(__itt_counter id, unsigned long long value);3278 3279#ifndef INTEL_NO_MACRO_BODY3280#ifndef INTEL_NO_ITTNOTIFY_API3281ITT_STUBV(ITTAPI, void, counter_dec_delta,3282 (__itt_counter id, unsigned long long value))3283#define __itt_counter_dec_delta ITTNOTIFY_VOID(counter_dec_delta)3284#define __itt_counter_dec_delta_ptr ITTNOTIFY_NAME(counter_dec_delta)3285#else /* INTEL_NO_ITTNOTIFY_API */3286#define __itt_counter_dec_delta(id, value)3287#define __itt_counter_dec_delta_ptr 03288#endif /* INTEL_NO_ITTNOTIFY_API */3289#else /* INTEL_NO_MACRO_BODY */3290#define __itt_counter_dec_delta_ptr 03291#endif /* INTEL_NO_MACRO_BODY */3292/** @endcond */3293 3294/**3295 * @ingroup counters3296 * @brief Increment a counter by one.3297 * The first call with a given name creates a counter by that name and sets its3298 * value to zero. Successive calls increment the counter value.3299 * @param[in] domain The domain controlling the call. Counter names are not3300 * domain specific. The domain argument is used only to enable or disable the3301 * API calls.3302 * @param[in] name The name of the counter3303 */3304void ITTAPI __itt_counter_inc_v3(const __itt_domain *domain,3305 __itt_string_handle *name);3306 3307/**3308 * @ingroup counters3309 * @brief Increment a counter by the value specified in delta.3310 * @param[in] domain The domain controlling the call. Counter names are not3311 * domain specific. The domain argument is used only to enable or disable the3312 * API calls.3313 * @param[in] name The name of the counter3314 * @param[in] delta The amount by which to increment the counter3315 */3316void ITTAPI __itt_counter_inc_delta_v3(const __itt_domain *domain,3317 __itt_string_handle *name,3318 unsigned long long delta);3319 3320#ifndef INTEL_NO_MACRO_BODY3321#ifndef INTEL_NO_ITTNOTIFY_API3322ITT_STUBV(ITTAPI, void, counter_inc_v3,3323 (const __itt_domain *domain, __itt_string_handle *name))3324ITT_STUBV(ITTAPI, void, counter_inc_delta_v3,3325 (const __itt_domain *domain, __itt_string_handle *name,3326 unsigned long long delta))3327#define __itt_counter_inc_v3(d, x) ITTNOTIFY_VOID_D1(counter_inc_v3, d, x)3328#define __itt_counter_inc_v3_ptr ITTNOTIFY_NAME(counter_inc_v3)3329#define __itt_counter_inc_delta_v3(d, x, y) \3330 ITTNOTIFY_VOID_D2(counter_inc_delta_v3, d, x, y)3331#define __itt_counter_inc_delta_v3_ptr ITTNOTIFY_NAME(counter_inc_delta_v3)3332#else /* INTEL_NO_ITTNOTIFY_API */3333#define __itt_counter_inc_v3(domain, name)3334#define __itt_counter_inc_v3_ptr 03335#define __itt_counter_inc_delta_v3(domain, name, delta)3336#define __itt_counter_inc_delta_v3_ptr 03337#endif /* INTEL_NO_ITTNOTIFY_API */3338#else /* INTEL_NO_MACRO_BODY */3339#define __itt_counter_inc_v3_ptr 03340#define __itt_counter_inc_delta_v3_ptr 03341#endif /* INTEL_NO_MACRO_BODY */3342/** @endcond */3343 3344/**3345 * @ingroup counters3346 * @brief Decrement a counter by one.3347 * The first call with a given name creates a counter by that name and sets its3348 * value to zero. Successive calls decrement the counter value.3349 * @param[in] domain The domain controlling the call. Counter names are not3350 * domain specific. The domain argument is used only to enable or disable the3351 * API calls.3352 * @param[in] name The name of the counter3353 */3354void ITTAPI __itt_counter_dec_v3(const __itt_domain *domain,3355 __itt_string_handle *name);3356 3357/**3358 * @ingroup counters3359 * @brief Decrement a counter by the value specified in delta.3360 * @param[in] domain The domain controlling the call. Counter names are not3361 * domain specific. The domain argument is used only to enable or disable the3362 * API calls.3363 * @param[in] name The name of the counter3364 * @param[in] delta The amount by which to decrement the counter3365 */3366void ITTAPI __itt_counter_dec_delta_v3(const __itt_domain *domain,3367 __itt_string_handle *name,3368 unsigned long long delta);3369 3370#ifndef INTEL_NO_MACRO_BODY3371#ifndef INTEL_NO_ITTNOTIFY_API3372ITT_STUBV(ITTAPI, void, counter_dec_v3,3373 (const __itt_domain *domain, __itt_string_handle *name))3374ITT_STUBV(ITTAPI, void, counter_dec_delta_v3,3375 (const __itt_domain *domain, __itt_string_handle *name,3376 unsigned long long delta))3377#define __itt_counter_dec_v3(d, x) ITTNOTIFY_VOID_D1(counter_dec_v3, d, x)3378#define __itt_counter_dec_v3_ptr ITTNOTIFY_NAME(counter_dec_v3)3379#define __itt_counter_dec_delta_v3(d, x, y) \3380 ITTNOTIFY_VOID_D2(counter_dec_delta_v3, d, x, y)3381#define __itt_counter_dec_delta_v3_ptr ITTNOTIFY_NAME(counter_dec_delta_v3)3382#else /* INTEL_NO_ITTNOTIFY_API */3383#define __itt_counter_dec_v3(domain, name)3384#define __itt_counter_dec_v3_ptr 03385#define __itt_counter_dec_delta_v3(domain, name, delta)3386#define __itt_counter_dec_delta_v3_ptr 03387#endif /* INTEL_NO_ITTNOTIFY_API */3388#else /* INTEL_NO_MACRO_BODY */3389#define __itt_counter_dec_v3_ptr 03390#define __itt_counter_dec_delta_v3_ptr 03391#endif /* INTEL_NO_MACRO_BODY */3392/** @endcond */3393 3394/** @} counters group */3395 3396/**3397 * @brief Set the counter value3398 */3399void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr);3400 3401#ifndef INTEL_NO_MACRO_BODY3402#ifndef INTEL_NO_ITTNOTIFY_API3403ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr))3404#define __itt_counter_set_value ITTNOTIFY_VOID(counter_set_value)3405#define __itt_counter_set_value_ptr ITTNOTIFY_NAME(counter_set_value)3406#else /* INTEL_NO_ITTNOTIFY_API */3407#define __itt_counter_set_value(id, value_ptr)3408#define __itt_counter_set_value_ptr 03409#endif /* INTEL_NO_ITTNOTIFY_API */3410#else /* INTEL_NO_MACRO_BODY */3411#define __itt_counter_set_value_ptr 03412#endif /* INTEL_NO_MACRO_BODY */3413/** @endcond */3414 3415/**3416 * @brief Set the counter value3417 */3418void ITTAPI __itt_counter_set_value_ex(__itt_counter id,3419 __itt_clock_domain *clock_domain,3420 unsigned long long timestamp,3421 void *value_ptr);3422 3423/** @cond exclude_from_documentation */3424#ifndef INTEL_NO_MACRO_BODY3425#ifndef INTEL_NO_ITTNOTIFY_API3426ITT_STUBV(ITTAPI, void, counter_set_value_ex,3427 (__itt_counter id, __itt_clock_domain *clock_domain,3428 unsigned long long timestamp, void *value_ptr))3429#define __itt_counter_set_value_ex ITTNOTIFY_VOID(counter_set_value_ex)3430#define __itt_counter_set_value_ex_ptr ITTNOTIFY_NAME(counter_set_value_ex)3431#else /* INTEL_NO_ITTNOTIFY_API */3432#define __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)3433#define __itt_counter_set_value_ex_ptr 03434#endif /* INTEL_NO_ITTNOTIFY_API */3435#else /* INTEL_NO_MACRO_BODY */3436#define __itt_counter_set_value_ex_ptr 03437#endif /* INTEL_NO_MACRO_BODY */3438/** @endcond */3439 3440/**3441 * @brief Create a typed counter with given name/domain3442 *3443 * After __itt_counter_create_typed() is called, __itt_counter_inc(id),3444 * __itt_counter_inc_delta(id, delta),3445 * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id,3446 * clock_domain, timestamp, value_ptr) can be used to change the value of the3447 * counter3448 */3449#if ITT_PLATFORM == ITT_PLATFORM_WIN3450__itt_counter ITTAPI __itt_counter_create_typedA(const char *name,3451 const char *domain,3452 __itt_metadata_type type);3453__itt_counter ITTAPI __itt_counter_create_typedW(const wchar_t *name,3454 const wchar_t *domain,3455 __itt_metadata_type type);3456#if defined(UNICODE) || defined(_UNICODE)3457#define __itt_counter_create_typed __itt_counter_create_typedW3458#define __itt_counter_create_typed_ptr __itt_counter_create_typedW_ptr3459#else /* UNICODE */3460#define __itt_counter_create_typed __itt_counter_create_typedA3461#define __itt_counter_create_typed_ptr __itt_counter_create_typedA_ptr3462#endif /* UNICODE */3463#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3464__itt_counter ITTAPI __itt_counter_create_typed(const char *name,3465 const char *domain,3466 __itt_metadata_type type);3467#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3468 3469#ifndef INTEL_NO_MACRO_BODY3470#ifndef INTEL_NO_ITTNOTIFY_API3471#if ITT_PLATFORM == ITT_PLATFORM_WIN3472ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA,3473 (const char *name, const char *domain, __itt_metadata_type type))3474ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW,3475 (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type))3476#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3477ITT_STUB(ITTAPI, __itt_counter, counter_create_typed,3478 (const char *name, const char *domain, __itt_metadata_type type))3479#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3480#if ITT_PLATFORM == ITT_PLATFORM_WIN3481#define __itt_counter_create_typedA ITTNOTIFY_DATA(counter_create_typedA)3482#define __itt_counter_create_typedA_ptr ITTNOTIFY_NAME(counter_create_typedA)3483#define __itt_counter_create_typedW ITTNOTIFY_DATA(counter_create_typedW)3484#define __itt_counter_create_typedW_ptr ITTNOTIFY_NAME(counter_create_typedW)3485#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3486#define __itt_counter_create_typed ITTNOTIFY_DATA(counter_create_typed)3487#define __itt_counter_create_typed_ptr ITTNOTIFY_NAME(counter_create_typed)3488#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3489#else /* INTEL_NO_ITTNOTIFY_API */3490#if ITT_PLATFORM == ITT_PLATFORM_WIN3491#define __itt_counter_create_typedA(name, domain, type)3492#define __itt_counter_create_typedA_ptr 03493#define __itt_counter_create_typedW(name, domain, type)3494#define __itt_counter_create_typedW_ptr 03495#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3496#define __itt_counter_create_typed(name, domain, type)3497#define __itt_counter_create_typed_ptr 03498#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3499#endif /* INTEL_NO_ITTNOTIFY_API */3500#else /* INTEL_NO_MACRO_BODY */3501#if ITT_PLATFORM == ITT_PLATFORM_WIN3502#define __itt_counter_create_typedA_ptr 03503#define __itt_counter_create_typedW_ptr 03504#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3505#define __itt_counter_create_typed_ptr 03506#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3507#endif /* INTEL_NO_MACRO_BODY */3508/** @endcond */3509 3510/**3511 * @brief Destroy the counter identified by the pointer previously returned by3512 * __itt_counter_create() or3513 * __itt_counter_create_typed()3514 */3515void ITTAPI __itt_counter_destroy(__itt_counter id);3516 3517#ifndef INTEL_NO_MACRO_BODY3518#ifndef INTEL_NO_ITTNOTIFY_API3519ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id))3520#define __itt_counter_destroy ITTNOTIFY_VOID(counter_destroy)3521#define __itt_counter_destroy_ptr ITTNOTIFY_NAME(counter_destroy)3522#else /* INTEL_NO_ITTNOTIFY_API */3523#define __itt_counter_destroy(id)3524#define __itt_counter_destroy_ptr 03525#endif /* INTEL_NO_ITTNOTIFY_API */3526#else /* INTEL_NO_MACRO_BODY */3527#define __itt_counter_destroy_ptr 03528#endif /* INTEL_NO_MACRO_BODY */3529/** @endcond */3530/** @} counters group */3531 3532/**3533 * @ingroup markers3534 * @brief Create a marker instance.3535 * @param[in] domain The domain for this marker3536 * @param[in] clock_domain The clock domain controlling the execution of this3537 * call.3538 * @param[in] timestamp The user defined timestamp.3539 * @param[in] id The instance ID for this marker, or __itt_null3540 * @param[in] name The name for this marker3541 * @param[in] scope The scope for this marker3542 */3543void ITTAPI __itt_marker_ex(const __itt_domain *domain,3544 __itt_clock_domain *clock_domain,3545 unsigned long long timestamp, __itt_id id,3546 __itt_string_handle *name, __itt_scope scope);3547 3548/** @cond exclude_from_documentation */3549#ifndef INTEL_NO_MACRO_BODY3550#ifndef INTEL_NO_ITTNOTIFY_API3551ITT_STUBV(ITTAPI, void, marker_ex,3552 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3553 unsigned long long timestamp, __itt_id id, __itt_string_handle *name,3554 __itt_scope scope))3555#define __itt_marker_ex(d, x, y, z, a, b) \3556 ITTNOTIFY_VOID_D5(marker_ex, d, x, y, z, a, b)3557#define __itt_marker_ex_ptr ITTNOTIFY_NAME(marker_ex)3558#else /* INTEL_NO_ITTNOTIFY_API */3559#define __itt_marker_ex(domain, clock_domain, timestamp, id, name, scope)3560#define __itt_marker_ex_ptr 03561#endif /* INTEL_NO_ITTNOTIFY_API */3562#else /* INTEL_NO_MACRO_BODY */3563#define __itt_marker_ex_ptr 03564#endif /* INTEL_NO_MACRO_BODY */3565/** @endcond */3566 3567/**3568 * @ingroup clockdomain3569 * @brief Add a relation to the current task instance.3570 * The current task instance is the head of the relation.3571 * @param[in] domain The domain controlling this call3572 * @param[in] clock_domain The clock domain controlling the execution of this3573 * call.3574 * @param[in] timestamp The user defined timestamp.3575 * @param[in] relation The kind of relation3576 * @param[in] tail The ID for the tail of the relation3577 */3578void ITTAPI __itt_relation_add_to_current_ex(const __itt_domain *domain,3579 __itt_clock_domain *clock_domain,3580 unsigned long long timestamp,3581 __itt_relation relation,3582 __itt_id tail);3583 3584/**3585 * @ingroup clockdomain3586 * @brief Add a relation between two instance identifiers.3587 * @param[in] domain The domain controlling this call3588 * @param[in] clock_domain The clock domain controlling the execution of this3589 * call.3590 * @param[in] timestamp The user defined timestamp.3591 * @param[in] head The ID for the head of the relation3592 * @param[in] relation The kind of relation3593 * @param[in] tail The ID for the tail of the relation3594 */3595void ITTAPI __itt_relation_add_ex(const __itt_domain *domain,3596 __itt_clock_domain *clock_domain,3597 unsigned long long timestamp, __itt_id head,3598 __itt_relation relation, __itt_id tail);3599 3600/** @cond exclude_from_documentation */3601#ifndef INTEL_NO_MACRO_BODY3602#ifndef INTEL_NO_ITTNOTIFY_API3603ITT_STUBV(ITTAPI, void, relation_add_to_current_ex,3604 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3605 unsigned long long timestamp, __itt_relation relation,3606 __itt_id tail))3607ITT_STUBV(ITTAPI, void, relation_add_ex,3608 (const __itt_domain *domain, __itt_clock_domain *clock_domain,3609 unsigned long long timestamp, __itt_id head, __itt_relation relation,3610 __itt_id tail))3611#define __itt_relation_add_to_current_ex(d, x, y, z, a) \3612 ITTNOTIFY_VOID_D4(relation_add_to_current_ex, d, x, y, z, a)3613#define __itt_relation_add_to_current_ex_ptr \3614 ITTNOTIFY_NAME(relation_add_to_current_ex)3615#define __itt_relation_add_ex(d, x, y, z, a, b) \3616 ITTNOTIFY_VOID_D5(relation_add_ex, d, x, y, z, a, b)3617#define __itt_relation_add_ex_ptr ITTNOTIFY_NAME(relation_add_ex)3618#else /* INTEL_NO_ITTNOTIFY_API */3619#define __itt_relation_add_to_current_ex(domain, clock_domain, timestame, \3620 relation, tail)3621#define __itt_relation_add_to_current_ex_ptr 03622#define __itt_relation_add_ex(domain, clock_domain, timestamp, head, relation, \3623 tail)3624#define __itt_relation_add_ex_ptr 03625#endif /* INTEL_NO_ITTNOTIFY_API */3626#else /* INTEL_NO_MACRO_BODY */3627#define __itt_relation_add_to_current_ex_ptr 03628#define __itt_relation_add_ex_ptr 03629#endif /* INTEL_NO_MACRO_BODY */3630/** @endcond */3631 3632/** @cond exclude_from_documentation */3633typedef enum ___itt_track_group_type {3634 __itt_track_group_type_normal = 03635} __itt_track_group_type;3636/** @endcond */3637 3638/** @cond exclude_from_documentation */3639#pragma pack(push, 8)3640 3641typedef struct ___itt_track_group {3642 __itt_string_handle *name; /*!< Name of the track group */3643 struct ___itt_track *track; /*!< List of child tracks */3644 __itt_track_group_type tgtype; /*!< Type of the track group */3645 int extra1; /*!< Reserved. Must be zero */3646 void *extra2; /*!< Reserved. Must be zero */3647 struct ___itt_track_group *next;3648} __itt_track_group;3649 3650#pragma pack(pop)3651/** @endcond */3652 3653/**3654 * @brief Placeholder for custom track types. Currently, "normal" custom track3655 * is the only available track type.3656 */3657typedef enum ___itt_track_type {3658 __itt_track_type_normal = 03659#ifdef INTEL_ITTNOTIFY_API_PRIVATE3660 ,3661 __itt_track_type_queue3662#endif /* INTEL_ITTNOTIFY_API_PRIVATE */3663} __itt_track_type;3664 3665/** @cond exclude_from_documentation */3666#pragma pack(push, 8)3667 3668typedef struct ___itt_track {3669 __itt_string_handle *name; /*!< Name of the track group */3670 __itt_track_group *group; /*!< Parent group to a track */3671 __itt_track_type ttype; /*!< Type of the track */3672 int extra1; /*!< Reserved. Must be zero */3673 void *extra2; /*!< Reserved. Must be zero */3674 struct ___itt_track *next;3675} __itt_track;3676 3677#pragma pack(pop)3678/** @endcond */3679 3680/**3681 * @brief Create logical track group.3682 */3683__itt_track_group *ITTAPI __itt_track_group_create(3684 __itt_string_handle *name, __itt_track_group_type track_group_type);3685 3686/** @cond exclude_from_documentation */3687#ifndef INTEL_NO_MACRO_BODY3688#ifndef INTEL_NO_ITTNOTIFY_API3689ITT_STUB(ITTAPI, __itt_track_group *, track_group_create,3690 (__itt_string_handle * name, __itt_track_group_type track_group_type))3691#define __itt_track_group_create ITTNOTIFY_DATA(track_group_create)3692#define __itt_track_group_create_ptr ITTNOTIFY_NAME(track_group_create)3693#else /* INTEL_NO_ITTNOTIFY_API */3694#define __itt_track_group_create(name) (__itt_track_group *)03695#define __itt_track_group_create_ptr 03696#endif /* INTEL_NO_ITTNOTIFY_API */3697#else /* INTEL_NO_MACRO_BODY */3698#define __itt_track_group_create_ptr 03699#endif /* INTEL_NO_MACRO_BODY */3700/** @endcond */3701 3702/**3703 * @brief Create logical track.3704 */3705__itt_track *ITTAPI __itt_track_create(__itt_track_group *track_group,3706 __itt_string_handle *name,3707 __itt_track_type track_type);3708 3709/** @cond exclude_from_documentation */3710#ifndef INTEL_NO_MACRO_BODY3711#ifndef INTEL_NO_ITTNOTIFY_API3712ITT_STUB(ITTAPI, __itt_track *, track_create,3713 (__itt_track_group * track_group, __itt_string_handle *name,3714 __itt_track_type track_type))3715#define __itt_track_create ITTNOTIFY_DATA(track_create)3716#define __itt_track_create_ptr ITTNOTIFY_NAME(track_create)3717#else /* INTEL_NO_ITTNOTIFY_API */3718#define __itt_track_create(track_group, name, track_type) (__itt_track *)03719#define __itt_track_create_ptr 03720#endif /* INTEL_NO_ITTNOTIFY_API */3721#else /* INTEL_NO_MACRO_BODY */3722#define __itt_track_create_ptr 03723#endif /* INTEL_NO_MACRO_BODY */3724/** @endcond */3725 3726/**3727 * @brief Set the logical track.3728 */3729void ITTAPI __itt_set_track(__itt_track *track);3730 3731/** @cond exclude_from_documentation */3732#ifndef INTEL_NO_MACRO_BODY3733#ifndef INTEL_NO_ITTNOTIFY_API3734ITT_STUBV(ITTAPI, void, set_track, (__itt_track * track))3735#define __itt_set_track ITTNOTIFY_VOID(set_track)3736#define __itt_set_track_ptr ITTNOTIFY_NAME(set_track)3737#else /* INTEL_NO_ITTNOTIFY_API */3738#define __itt_set_track(track)3739#define __itt_set_track_ptr 03740#endif /* INTEL_NO_ITTNOTIFY_API */3741#else /* INTEL_NO_MACRO_BODY */3742#define __itt_set_track_ptr 03743#endif /* INTEL_NO_MACRO_BODY */3744/** @endcond */3745 3746/* ========================================================================== */3747/** @cond exclude_from_gpa_documentation */3748/**3749 * @defgroup events Events3750 * @ingroup public3751 * Events group3752 * @{3753 */3754/** @brief user event type */3755typedef int __itt_event;3756 3757/**3758 * @brief Create an event notification3759 * @note name or namelen being null/name and namelen not matching, user event3760 * feature not enabled3761 * @return non-zero event identifier upon success and __itt_err otherwise3762 */3763#if ITT_PLATFORM == ITT_PLATFORM_WIN3764__itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen);3765__itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen);3766#if defined(UNICODE) || defined(_UNICODE)3767#define __itt_event_create __itt_event_createW3768#define __itt_event_create_ptr __itt_event_createW_ptr3769#else3770#define __itt_event_create __itt_event_createA3771#define __itt_event_create_ptr __itt_event_createA_ptr3772#endif /* UNICODE */3773#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3774__itt_event LIBITTAPI __itt_event_create(const char *name, int namelen);3775#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3776 3777/** @cond exclude_from_documentation */3778#ifndef INTEL_NO_MACRO_BODY3779#ifndef INTEL_NO_ITTNOTIFY_API3780#if ITT_PLATFORM == ITT_PLATFORM_WIN3781ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen))3782ITT_STUB(LIBITTAPI, __itt_event, event_createW,3783 (const wchar_t *name, int namelen))3784#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3785ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen))3786#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3787#if ITT_PLATFORM == ITT_PLATFORM_WIN3788#define __itt_event_createA ITTNOTIFY_DATA(event_createA)3789#define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA)3790#define __itt_event_createW ITTNOTIFY_DATA(event_createW)3791#define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW)3792#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3793#define __itt_event_create ITTNOTIFY_DATA(event_create)3794#define __itt_event_create_ptr ITTNOTIFY_NAME(event_create)3795#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3796#else /* INTEL_NO_ITTNOTIFY_API */3797#if ITT_PLATFORM == ITT_PLATFORM_WIN3798#define __itt_event_createA(name, namelen) (__itt_event)03799#define __itt_event_createA_ptr 03800#define __itt_event_createW(name, namelen) (__itt_event)03801#define __itt_event_createW_ptr 03802#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3803#define __itt_event_create(name, namelen) (__itt_event)03804#define __itt_event_create_ptr 03805#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3806#endif /* INTEL_NO_ITTNOTIFY_API */3807#else /* INTEL_NO_MACRO_BODY */3808#if ITT_PLATFORM == ITT_PLATFORM_WIN3809#define __itt_event_createA_ptr 03810#define __itt_event_createW_ptr 03811#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3812#define __itt_event_create_ptr 03813#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3814#endif /* INTEL_NO_MACRO_BODY */3815/** @endcond */3816 3817/**3818 * @brief Record an event occurrence.3819 * @return __itt_err upon failure (invalid event id/user event feature not3820 * enabled)3821 */3822int LIBITTAPI __itt_event_start(__itt_event event);3823 3824/** @cond exclude_from_documentation */3825#ifndef INTEL_NO_MACRO_BODY3826#ifndef INTEL_NO_ITTNOTIFY_API3827ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event))3828#define __itt_event_start ITTNOTIFY_DATA(event_start)3829#define __itt_event_start_ptr ITTNOTIFY_NAME(event_start)3830#else /* INTEL_NO_ITTNOTIFY_API */3831#define __itt_event_start(event) (int)03832#define __itt_event_start_ptr 03833#endif /* INTEL_NO_ITTNOTIFY_API */3834#else /* INTEL_NO_MACRO_BODY */3835#define __itt_event_start_ptr 03836#endif /* INTEL_NO_MACRO_BODY */3837/** @endcond */3838 3839/**3840 * @brief Record an event end occurrence.3841 * @note It is optional if events do not have durations.3842 * @return __itt_err upon failure (invalid event id/user event feature not3843 * enabled)3844 */3845int LIBITTAPI __itt_event_end(__itt_event event);3846 3847/** @cond exclude_from_documentation */3848#ifndef INTEL_NO_MACRO_BODY3849#ifndef INTEL_NO_ITTNOTIFY_API3850ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event))3851#define __itt_event_end ITTNOTIFY_DATA(event_end)3852#define __itt_event_end_ptr ITTNOTIFY_NAME(event_end)3853#else /* INTEL_NO_ITTNOTIFY_API */3854#define __itt_event_end(event) (int)03855#define __itt_event_end_ptr 03856#endif /* INTEL_NO_ITTNOTIFY_API */3857#else /* INTEL_NO_MACRO_BODY */3858#define __itt_event_end_ptr 03859#endif /* INTEL_NO_MACRO_BODY */3860/** @endcond */3861/** @} events group */3862 3863/**3864 * @defgroup arrays Arrays Visualizer3865 * @ingroup public3866 * Visualize arrays3867 * @{3868 */3869 3870/**3871 * @enum __itt_av_data_type3872 * @brief Defines types of arrays data (for C/C++ intrinsic types)3873 */3874typedef enum {3875 __itt_e_first = 0,3876 __itt_e_char = 0, /* 1-byte integer */3877 __itt_e_uchar, /* 1-byte unsigned integer */3878 __itt_e_int16, /* 2-byte integer */3879 __itt_e_uint16, /* 2-byte unsigned integer */3880 __itt_e_int32, /* 4-byte integer */3881 __itt_e_uint32, /* 4-byte unsigned integer */3882 __itt_e_int64, /* 8-byte integer */3883 __itt_e_uint64, /* 8-byte unsigned integer */3884 __itt_e_float, /* 4-byte floating */3885 __itt_e_double, /* 8-byte floating */3886 __itt_e_last = __itt_e_double3887} __itt_av_data_type;3888 3889/**3890 * @brief Save an array data to a file.3891 * Output format is defined by the file extension. The csv and bmp formats are3892 * supported (bmp - for 2-dimensional array only).3893 * @param[in] data - pointer to the array data3894 * @param[in] rank - the rank of the array3895 * @param[in] dimensions - pointer to an array of integers, which specifies the3896 * array dimensions. The size of dimensions must be equal to the rank3897 * @param[in] type - the type of the array, specified as one of the3898 * __itt_av_data_type values (for intrinsic types)3899 * @param[in] filePath - the file path; the output format is defined by the file3900 * extension3901 * @param[in] columnOrder - defines how the array is stored in the linear3902 * memory. It should be 1 for column-major order (e.g. in FORTRAN) or 0 - for3903 * row-major order (e.g. in C).3904 */3905 3906#if ITT_PLATFORM == ITT_PLATFORM_WIN3907int ITTAPI __itt_av_saveA(void *data, int rank, const int *dimensions, int type,3908 const char *filePath, int columnOrder);3909int ITTAPI __itt_av_saveW(void *data, int rank, const int *dimensions, int type,3910 const wchar_t *filePath, int columnOrder);3911#if defined(UNICODE) || defined(_UNICODE)3912#define __itt_av_save __itt_av_saveW3913#define __itt_av_save_ptr __itt_av_saveW_ptr3914#else /* UNICODE */3915#define __itt_av_save __itt_av_saveA3916#define __itt_av_save_ptr __itt_av_saveA_ptr3917#endif /* UNICODE */3918#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3919int ITTAPI __itt_av_save(void *data, int rank, const int *dimensions, int type,3920 const char *filePath, int columnOrder);3921#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3922 3923/** @cond exclude_from_documentation */3924#ifndef INTEL_NO_MACRO_BODY3925#ifndef INTEL_NO_ITTNOTIFY_API3926#if ITT_PLATFORM == ITT_PLATFORM_WIN3927ITT_STUB(ITTAPI, int, av_saveA,3928 (void *data, int rank, const int *dimensions, int type,3929 const char *filePath, int columnOrder))3930ITT_STUB(ITTAPI, int, av_saveW,3931 (void *data, int rank, const int *dimensions, int type,3932 const wchar_t *filePath, int columnOrder))3933#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3934ITT_STUB(ITTAPI, int, av_save,3935 (void *data, int rank, const int *dimensions, int type,3936 const char *filePath, int columnOrder))3937#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3938#if ITT_PLATFORM == ITT_PLATFORM_WIN3939#define __itt_av_saveA ITTNOTIFY_DATA(av_saveA)3940#define __itt_av_saveA_ptr ITTNOTIFY_NAME(av_saveA)3941#define __itt_av_saveW ITTNOTIFY_DATA(av_saveW)3942#define __itt_av_saveW_ptr ITTNOTIFY_NAME(av_saveW)3943#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3944#define __itt_av_save ITTNOTIFY_DATA(av_save)3945#define __itt_av_save_ptr ITTNOTIFY_NAME(av_save)3946#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3947#else /* INTEL_NO_ITTNOTIFY_API */3948#if ITT_PLATFORM == ITT_PLATFORM_WIN3949#define __itt_av_saveA(name)3950#define __itt_av_saveA_ptr 03951#define __itt_av_saveW(name)3952#define __itt_av_saveW_ptr 03953#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3954#define __itt_av_save(name)3955#define __itt_av_save_ptr 03956#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3957#endif /* INTEL_NO_ITTNOTIFY_API */3958#else /* INTEL_NO_MACRO_BODY */3959#if ITT_PLATFORM == ITT_PLATFORM_WIN3960#define __itt_av_saveA_ptr 03961#define __itt_av_saveW_ptr 03962#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */3963#define __itt_av_save_ptr 03964#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */3965#endif /* INTEL_NO_MACRO_BODY */3966/** @endcond */3967 3968void ITTAPI __itt_enable_attach(void);3969 3970/** @cond exclude_from_documentation */3971#ifndef INTEL_NO_MACRO_BODY3972#ifndef INTEL_NO_ITTNOTIFY_API3973ITT_STUBV(ITTAPI, void, enable_attach, (void))3974#define __itt_enable_attach ITTNOTIFY_VOID(enable_attach)3975#define __itt_enable_attach_ptr ITTNOTIFY_NAME(enable_attach)3976#else /* INTEL_NO_ITTNOTIFY_API */3977#define __itt_enable_attach()3978#define __itt_enable_attach_ptr 03979#endif /* INTEL_NO_ITTNOTIFY_API */3980#else /* INTEL_NO_MACRO_BODY */3981#define __itt_enable_attach_ptr 03982#endif /* INTEL_NO_MACRO_BODY */3983/** @endcond */3984 3985/** @cond exclude_from_gpa_documentation */3986 3987/** @} arrays group */3988 3989/** @endcond */3990 3991/**3992 * @brief Module load notification3993 * This API is used to report necessary information in case of bypassing default3994 * system loader. Notification should be done immidiatelly after this module is3995 * loaded to process memory.3996 * @param[in] start_addr - module start address3997 * @param[in] end_addr - module end address3998 * @param[in] path - file system full path to the module3999 */4000#if ITT_PLATFORM == ITT_PLATFORM_WIN4001void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr,4002 const char *path);4003void ITTAPI __itt_module_loadW(void *start_addr, void *end_addr,4004 const wchar_t *path);4005#if defined(UNICODE) || defined(_UNICODE)4006#define __itt_module_load __itt_module_loadW4007#define __itt_module_load_ptr __itt_module_loadW_ptr4008#else /* UNICODE */4009#define __itt_module_load __itt_module_loadA4010#define __itt_module_load_ptr __itt_module_loadA_ptr4011#endif /* UNICODE */4012#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4013void ITTAPI __itt_module_load(void *start_addr, void *end_addr,4014 const char *path);4015#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4016 4017/** @cond exclude_from_documentation */4018#ifndef INTEL_NO_MACRO_BODY4019#ifndef INTEL_NO_ITTNOTIFY_API4020#if ITT_PLATFORM == ITT_PLATFORM_WIN4021ITT_STUB(ITTAPI, void, module_loadA,4022 (void *start_addr, void *end_addr, const char *path))4023ITT_STUB(ITTAPI, void, module_loadW,4024 (void *start_addr, void *end_addr, const wchar_t *path))4025#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4026ITT_STUB(ITTAPI, void, module_load,4027 (void *start_addr, void *end_addr, const char *path))4028#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4029#if ITT_PLATFORM == ITT_PLATFORM_WIN4030#define __itt_module_loadA ITTNOTIFY_VOID(module_loadA)4031#define __itt_module_loadA_ptr ITTNOTIFY_NAME(module_loadA)4032#define __itt_module_loadW ITTNOTIFY_VOID(module_loadW)4033#define __itt_module_loadW_ptr ITTNOTIFY_NAME(module_loadW)4034#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4035#define __itt_module_load ITTNOTIFY_VOID(module_load)4036#define __itt_module_load_ptr ITTNOTIFY_NAME(module_load)4037#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4038#else /* INTEL_NO_ITTNOTIFY_API */4039#if ITT_PLATFORM == ITT_PLATFORM_WIN4040#define __itt_module_loadA(start_addr, end_addr, path)4041#define __itt_module_loadA_ptr 04042#define __itt_module_loadW(start_addr, end_addr, path)4043#define __itt_module_loadW_ptr 04044#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4045#define __itt_module_load(start_addr, end_addr, path)4046#define __itt_module_load_ptr 04047#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4048#endif /* INTEL_NO_ITTNOTIFY_API */4049#else /* INTEL_NO_MACRO_BODY */4050#if ITT_PLATFORM == ITT_PLATFORM_WIN4051#define __itt_module_loadA_ptr 04052#define __itt_module_loadW_ptr 04053#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4054#define __itt_module_load_ptr 04055#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4056#endif /* INTEL_NO_MACRO_BODY */4057/** @endcond */4058 4059/**4060 * @brief Report module unload4061 * This API is used to report necessary information in case of bypassing default4062 * system loader. Notification should be done just before the module is unloaded4063 * from process memory.4064 * @param[in] addr - base address of loaded module4065 */4066void ITTAPI __itt_module_unload(void *addr);4067 4068/** @cond exclude_from_documentation */4069#ifndef INTEL_NO_MACRO_BODY4070#ifndef INTEL_NO_ITTNOTIFY_API4071ITT_STUBV(ITTAPI, void, module_unload, (void *addr))4072#define __itt_module_unload ITTNOTIFY_VOID(module_unload)4073#define __itt_module_unload_ptr ITTNOTIFY_NAME(module_unload)4074#else /* INTEL_NO_ITTNOTIFY_API */4075#define __itt_module_unload(addr)4076#define __itt_module_unload_ptr 04077#endif /* INTEL_NO_ITTNOTIFY_API */4078#else /* INTEL_NO_MACRO_BODY */4079#define __itt_module_unload_ptr 04080#endif /* INTEL_NO_MACRO_BODY */4081/** @endcond */4082 4083/** @cond exclude_from_documentation */4084typedef enum {4085 __itt_module_type_unknown = 0,4086 __itt_module_type_elf,4087 __itt_module_type_coff4088} __itt_module_type;4089/** @endcond */4090 4091/** @cond exclude_from_documentation */4092typedef enum {4093 itt_section_type_unknown,4094 itt_section_type_bss, /* notifies that the section contains uninitialized4095 * data. These are the relevant section types and the4096 * modules that contain them: ELF module: SHT_NOBITS4097 * section type COFF module:4098 * IMAGE_SCN_CNT_UNINITIALIZED_DATA section type4099 */4100 itt_section_type_data, /* notifies that section contains initialized data.4101 * These are the relevant section types and the modules4102 * that contain them: ELF module: SHT_PROGBITS section4103 * type COFF module: IMAGE_SCN_CNT_INITIALIZED_DATA4104 * section type4105 */4106 itt_section_type_text /* notifies that the section contains executable code.4107 * These are the relevant section types and the modules4108 * that contain them: ELF module: SHT_PROGBITS section4109 * type COFF module: IMAGE_SCN_CNT_CODE section type4110 */4111} __itt_section_type;4112/** @endcond */4113 4114/**4115 * @hideinitializer4116 * @brief bit-mask, detects a section attribute that indicates whether a section4117 * can be executed as code: These are the relevant section attributes and the4118 * modules that contain them: ELF module: PF_X section attribute COFF module:4119 * IMAGE_SCN_MEM_EXECUTE attribute4120 */4121#define __itt_section_exec 0x200000004122 4123/**4124 * @hideinitializer4125 * @brief bit-mask, detects a section attribute that indicates whether a section4126 * can be read. These are the relevant section attributes and the modules that4127 * contain them: ELF module: PF_R attribute COFF module: IMAGE_SCN_MEM_READ4128 * attribute4129 */4130#define __itt_section_read 0x400000004131 4132/**4133 * @hideinitializer4134 * @brief bit-mask, detects a section attribute that indicates whether a section4135 * can be written to. These are the relevant section attributes and the modules4136 * that contain them: ELF module: PF_W attribute COFF module:4137 * IMAGE_SCN_MEM_WRITE attribute4138 */4139#define __itt_section_write 0x800000004140 4141/** @cond exclude_from_documentation */4142#pragma pack(push, 8)4143 4144typedef struct ___itt_section_info {4145 const char *name; /*!< Section name in UTF8 */4146 __itt_section_type type; /*!< Section content and semantics description */4147 size_t flags; /*!< Section bit flags that describe attributes using bit mask4148 * Zero if disabled, non-zero if enabled4149 */4150 void *start_addr; /*!< Section load(relocated) start address */4151 size_t size; /*!< Section file offset */4152 size_t file_offset; /*!< Section size */4153} __itt_section_info;4154 4155#pragma pack(pop)4156/** @endcond */4157 4158/** @cond exclude_from_documentation */4159#pragma pack(push, 8)4160 4161typedef struct ___itt_module_object {4162 unsigned int version; /*!< API version*/4163 __itt_id module_id; /*!< Unique identifier. This is unchanged for sections4164 that belong to the same module */4165 __itt_module_type module_type; /*!< Binary module format */4166 const char *module_name; /*!< Unique module name or path to module in UTF84167 * Contains module name when module_bufer and4168 * module_size exist Contains module path when4169 * module_bufer and module_size absent module_name4170 * remains the same for the certain module_id4171 */4172 void *module_buffer; /*!< Module buffer content */4173 size_t module_size; /*!< Module buffer size */4174 /*!< If module_buffer and module_size exist, the binary module is dumped onto4175 * the system. If module_buffer and module_size do not exist, the binary4176 * module exists on the system already. The module_name parameter contains the4177 * path to the module.4178 */4179 __itt_section_info *section_array; /*!< Reference to section information */4180 size_t section_number;4181} __itt_module_object;4182 4183#pragma pack(pop)4184/** @endcond */4185 4186/**4187 * @brief Load module content and its loaded(relocated) sections.4188 * This API is useful to save a module, or specify its location on the system4189 * and report information about loaded sections. The target module is saved on4190 * the system if module buffer content and size are available. If module buffer4191 * content and size are unavailable, the module name contains the path to the4192 * existing binary module.4193 * @param[in] module_obj - provides module and section information, along with4194 * unique module identifiers (name,module ID) which bind the binary module to4195 * particular sections.4196 */4197void ITTAPI __itt_module_load_with_sections(__itt_module_object *module_obj);4198 4199/** @cond exclude_from_documentation */4200#ifndef INTEL_NO_MACRO_BODY4201#ifndef INTEL_NO_ITTNOTIFY_API4202ITT_STUBV(ITTAPI, void, module_load_with_sections,4203 (__itt_module_object * module_obj))4204#define __itt_module_load_with_sections \4205 ITTNOTIFY_VOID(module_load_with_sections)4206#define __itt_module_load_with_sections_ptr \4207 ITTNOTIFY_NAME(module_load_with_sections)4208#else /* INTEL_NO_ITTNOTIFY_API */4209#define __itt_module_load_with_sections(module_obj)4210#define __itt_module_load_with_sections_ptr 04211#endif /* INTEL_NO_ITTNOTIFY_API */4212#else /* INTEL_NO_MACRO_BODY */4213#define __itt_module_load_with_sections_ptr 04214#endif /* INTEL_NO_MACRO_BODY */4215/** @endcond */4216 4217/**4218 * @brief Unload a module and its loaded(relocated) sections.4219 * This API notifies that the module and its sections were unloaded.4220 * @param[in] module_obj - provides module and sections information, along with4221 * unique module identifiers (name,module ID) which bind the binary module to4222 * particular sections.4223 */4224void ITTAPI __itt_module_unload_with_sections(__itt_module_object *module_obj);4225 4226/** @cond exclude_from_documentation */4227#ifndef INTEL_NO_MACRO_BODY4228#ifndef INTEL_NO_ITTNOTIFY_API4229ITT_STUBV(ITTAPI, void, module_unload_with_sections,4230 (__itt_module_object * module_obj))4231#define __itt_module_unload_with_sections \4232 ITTNOTIFY_VOID(module_unload_with_sections)4233#define __itt_module_unload_with_sections_ptr \4234 ITTNOTIFY_NAME(module_unload_with_sections)4235#else /* INTEL_NO_ITTNOTIFY_API */4236#define __itt_module_unload_with_sections(module_obj)4237#define __itt_module_unload_with_sections_ptr 04238#endif /* INTEL_NO_ITTNOTIFY_API */4239#else /* INTEL_NO_MACRO_BODY */4240#define __itt_module_unload_with_sections_ptr 04241#endif /* INTEL_NO_MACRO_BODY */4242/** @endcond */4243 4244/** @cond exclude_from_documentation */4245#pragma pack(push, 8)4246 4247typedef struct ___itt_histogram {4248 const __itt_domain *domain; /*!< Domain of the histogram*/4249 const char *nameA; /*!< Name of the histogram */4250#if defined(UNICODE) || defined(_UNICODE)4251 const wchar_t *nameW;4252#else /* UNICODE || _UNICODE */4253 void *nameW;4254#endif /* UNICODE || _UNICODE */4255 __itt_metadata_type x_type; /*!< Type of the histogram X axis */4256 __itt_metadata_type y_type; /*!< Type of the histogram Y axis */4257 int extra1; /*!< Reserved to the runtime */4258 void *extra2; /*!< Reserved to the runtime */4259 struct ___itt_histogram *next;4260} __itt_histogram;4261 4262#pragma pack(pop)4263/** @endcond */4264 4265/**4266 * @brief Create a typed histogram instance with given name/domain.4267 * @param[in] domain The domain controlling the call.4268 * @param[in] name The name of the histogram.4269 * @param[in] x_type The type of the X axis in histogram (may be 0 to calculate4270 * batch statistics).4271 * @param[in] y_type The type of the Y axis in histogram.4272 */4273#if ITT_PLATFORM == ITT_PLATFORM_WIN4274__itt_histogram *ITTAPI __itt_histogram_createA(const __itt_domain *domain,4275 const char *name,4276 __itt_metadata_type x_type,4277 __itt_metadata_type y_type);4278__itt_histogram *ITTAPI __itt_histogram_createW(const __itt_domain *domain,4279 const wchar_t *name,4280 __itt_metadata_type x_type,4281 __itt_metadata_type y_type);4282#if defined(UNICODE) || defined(_UNICODE)4283#define __itt_histogram_create __itt_histogram_createW4284#define __itt_histogram_create_ptr __itt_histogram_createW_ptr4285#else /* UNICODE */4286#define __itt_histogram_create __itt_histogram_createA4287#define __itt_histogram_create_ptr __itt_histogram_createA_ptr4288#endif /* UNICODE */4289#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4290__itt_histogram *ITTAPI __itt_histogram_create(const __itt_domain *domain,4291 const char *name,4292 __itt_metadata_type x_type,4293 __itt_metadata_type y_type);4294#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4295 4296/** @cond exclude_from_documentation */4297#ifndef INTEL_NO_MACRO_BODY4298#ifndef INTEL_NO_ITTNOTIFY_API4299#if ITT_PLATFORM == ITT_PLATFORM_WIN4300ITT_STUB(ITTAPI, __itt_histogram *, histogram_createA,4301 (const __itt_domain *domain, const char *name,4302 __itt_metadata_type x_type, __itt_metadata_type y_type))4303ITT_STUB(ITTAPI, __itt_histogram *, histogram_createW,4304 (const __itt_domain *domain, const wchar_t *name,4305 __itt_metadata_type x_type, __itt_metadata_type y_type))4306#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4307ITT_STUB(ITTAPI, __itt_histogram *, histogram_create,4308 (const __itt_domain *domain, const char *name,4309 __itt_metadata_type x_type, __itt_metadata_type y_type))4310#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4311#if ITT_PLATFORM == ITT_PLATFORM_WIN4312#define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)4313#define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)4314#define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)4315#define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)4316#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4317#define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)4318#define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)4319#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4320#else /* INTEL_NO_ITTNOTIFY_API */4321#if ITT_PLATFORM == ITT_PLATFORM_WIN4322#define __itt_histogram_createA(domain, name, x_type, y_type) \4323 (__itt_histogram *)04324#define __itt_histogram_createA_ptr 04325#define __itt_histogram_createW(domain, name, x_type, y_type) \4326 (__itt_histogram *)04327#define __itt_histogram_createW_ptr 04328#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4329#define __itt_histogram_create(domain, name, x_type, y_type) \4330 (__itt_histogram *)04331#define __itt_histogram_create_ptr 04332#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4333#endif /* INTEL_NO_ITTNOTIFY_API */4334#else /* INTEL_NO_MACRO_BODY */4335#if ITT_PLATFORM == ITT_PLATFORM_WIN4336#define __itt_histogram_createA_ptr 04337#define __itt_histogram_createW_ptr 04338#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4339#define __itt_histogram_create_ptr 04340#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4341#endif /* INTEL_NO_MACRO_BODY */4342/** @endcond */4343 4344/**4345 * @brief Submit statistics for a histogram instance.4346 * @param[in] hist Pointer to the histogram instance to which the histogram4347 * statistic is to be dumped.4348 * @param[in] length The number of elements in dumped axis data array.4349 * @param[in] x_data The X axis dumped data itself (may be NULL to calculate4350 * batch statistics).4351 * @param[in] y_data The Y axis dumped data itself.4352 */4353void ITTAPI __itt_histogram_submit(__itt_histogram *hist, size_t length,4354 void *x_data, void *y_data);4355 4356/** @cond exclude_from_documentation */4357#ifndef INTEL_NO_MACRO_BODY4358#ifndef INTEL_NO_ITTNOTIFY_API4359ITT_STUBV(ITTAPI, void, histogram_submit,4360 (__itt_histogram * hist, size_t length, void *x_data, void *y_data))4361#define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)4362#define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)4363#else /* INTEL_NO_ITTNOTIFY_API */4364#define __itt_histogram_submit(hist, length, x_data, y_data)4365#define __itt_histogram_submit_ptr 04366#endif /* INTEL_NO_ITTNOTIFY_API */4367#else /* INTEL_NO_MACRO_BODY */4368#define __itt_histogram_submit_ptr 04369#endif /* INTEL_NO_MACRO_BODY */4370/** @endcond */4371 4372#ifdef __cplusplus4373}4374#endif /* __cplusplus */4375 4376#endif /* _ITTNOTIFY_H_ */4377 4378#ifdef INTEL_ITTNOTIFY_API_PRIVATE4379 4380#ifndef _ITTNOTIFY_PRIVATE_4381#define _ITTNOTIFY_PRIVATE_4382 4383#ifdef __cplusplus4384extern "C" {4385#endif /* __cplusplus */4386 4387/**4388 * @ingroup clockdomain4389 * @brief Begin an overlapped task instance.4390 * @param[in] domain The domain for this task4391 * @param[in] clock_domain The clock domain controlling the execution of this4392 * call.4393 * @param[in] timestamp The user defined timestamp.4394 * @param[in] taskid The identifier for this task instance, *cannot* be4395 * __itt_null.4396 * @param[in] parentid The parent of this task, or __itt_null.4397 * @param[in] name The name of this task.4398 */4399void ITTAPI __itt_task_begin_overlapped_ex(const __itt_domain *domain,4400 __itt_clock_domain *clock_domain,4401 unsigned long long timestamp,4402 __itt_id taskid, __itt_id parentid,4403 __itt_string_handle *name);4404 4405/**4406 * @ingroup clockdomain4407 * @brief End an overlapped task instance.4408 * @param[in] domain The domain for this task4409 * @param[in] clock_domain The clock domain controlling the execution of this4410 * call.4411 * @param[in] timestamp The user defined timestamp.4412 * @param[in] taskid Explicit ID of finished task4413 */4414void ITTAPI __itt_task_end_overlapped_ex(const __itt_domain *domain,4415 __itt_clock_domain *clock_domain,4416 unsigned long long timestamp,4417 __itt_id taskid);4418 4419/** @cond exclude_from_documentation */4420#ifndef INTEL_NO_MACRO_BODY4421#ifndef INTEL_NO_ITTNOTIFY_API4422ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex,4423 (const __itt_domain *domain, __itt_clock_domain *clock_domain,4424 unsigned long long timestamp, __itt_id taskid, __itt_id parentid,4425 __itt_string_handle *name))4426ITT_STUBV(ITTAPI, void, task_end_overlapped_ex,4427 (const __itt_domain *domain, __itt_clock_domain *clock_domain,4428 unsigned long long timestamp, __itt_id taskid))4429#define __itt_task_begin_overlapped_ex(d, x, y, z, a, b) \4430 ITTNOTIFY_VOID_D5(task_begin_overlapped_ex, d, x, y, z, a, b)4431#define __itt_task_begin_overlapped_ex_ptr \4432 ITTNOTIFY_NAME(task_begin_overlapped_ex)4433#define __itt_task_end_overlapped_ex(d, x, y, z) \4434 ITTNOTIFY_VOID_D3(task_end_overlapped_ex, d, x, y, z)4435#define __itt_task_end_overlapped_ex_ptr ITTNOTIFY_NAME(task_end_overlapped_ex)4436#else /* INTEL_NO_ITTNOTIFY_API */4437#define __itt_task_begin_overlapped_ex(domain, clock_domain, timestamp, \4438 taskid, parentid, name)4439#define __itt_task_begin_overlapped_ex_ptr 04440#define __itt_task_end_overlapped_ex(domain, clock_domain, timestamp, taskid)4441#define __itt_task_end_overlapped_ex_ptr 04442#endif /* INTEL_NO_ITTNOTIFY_API */4443#else /* INTEL_NO_MACRO_BODY */4444#define __itt_task_begin_overlapped_ex_ptr 04445#define __itt_task_end_overlapped_ptr 04446#define __itt_task_end_overlapped_ex_ptr 04447#endif /* INTEL_NO_MACRO_BODY */4448/** @endcond */4449 4450/**4451 * @defgroup makrs_internal Marks4452 * @ingroup internal4453 * Marks group4454 * @warning Internal API:4455 * - It is not shipped to outside of Intel4456 * - It is delivered to internal Intel teams using e-mail or SVN access only4457 * @{4458 */4459/** @brief user mark type */4460typedef int __itt_mark_type;4461 4462/**4463 * @brief Creates a user mark type with the specified name using char or Unicode4464 * string.4465 * @param[in] name - name of mark to create4466 * @return Returns a handle to the mark type4467 */4468#if ITT_PLATFORM == ITT_PLATFORM_WIN4469__itt_mark_type ITTAPI __itt_mark_createA(const char *name);4470__itt_mark_type ITTAPI __itt_mark_createW(const wchar_t *name);4471#if defined(UNICODE) || defined(_UNICODE)4472#define __itt_mark_create __itt_mark_createW4473#define __itt_mark_create_ptr __itt_mark_createW_ptr4474#else /* UNICODE */4475#define __itt_mark_create __itt_mark_createA4476#define __itt_mark_create_ptr __itt_mark_createA_ptr4477#endif /* UNICODE */4478#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4479__itt_mark_type ITTAPI __itt_mark_create(const char *name);4480#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4481 4482/** @cond exclude_from_documentation */4483#ifndef INTEL_NO_MACRO_BODY4484#ifndef INTEL_NO_ITTNOTIFY_API4485#if ITT_PLATFORM == ITT_PLATFORM_WIN4486ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name))4487ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name))4488#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4489ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name))4490#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4491#if ITT_PLATFORM == ITT_PLATFORM_WIN4492#define __itt_mark_createA ITTNOTIFY_DATA(mark_createA)4493#define __itt_mark_createA_ptr ITTNOTIFY_NAME(mark_createA)4494#define __itt_mark_createW ITTNOTIFY_DATA(mark_createW)4495#define __itt_mark_createW_ptr ITTNOTIFY_NAME(mark_createW)4496#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4497#define __itt_mark_create ITTNOTIFY_DATA(mark_create)4498#define __itt_mark_create_ptr ITTNOTIFY_NAME(mark_create)4499#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4500#else /* INTEL_NO_ITTNOTIFY_API */4501#if ITT_PLATFORM == ITT_PLATFORM_WIN4502#define __itt_mark_createA(name) (__itt_mark_type)04503#define __itt_mark_createA_ptr 04504#define __itt_mark_createW(name) (__itt_mark_type)04505#define __itt_mark_createW_ptr 04506#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4507#define __itt_mark_create(name) (__itt_mark_type)04508#define __itt_mark_create_ptr 04509#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4510#endif /* INTEL_NO_ITTNOTIFY_API */4511#else /* INTEL_NO_MACRO_BODY */4512#if ITT_PLATFORM == ITT_PLATFORM_WIN4513#define __itt_mark_createA_ptr 04514#define __itt_mark_createW_ptr 04515#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4516#define __itt_mark_create_ptr 04517#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4518#endif /* INTEL_NO_MACRO_BODY */4519/** @endcond */4520 4521/**4522 * @brief Creates a "discrete" user mark type of the specified type and an4523 * optional parameter using char or Unicode string.4524 *4525 * - The mark of "discrete" type is placed to collection results in case of4526 * success. It appears in overtime view(s) as a special tick sign.4527 * - The call is "synchronous" - function returns after mark is actually added4528 * to results.4529 * - This function is useful, for example, to mark different phases of4530 * application (beginning of the next mark automatically meand end of current4531 * region).4532 * - Can be used together with "continuous" marks (see below) at the same4533 * collection session4534 * @param[in] mt - mark, created by __itt_mark_create(const char* name) function4535 * @param[in] parameter - string parameter of mark4536 * @return Returns zero value in case of success, non-zero value otherwise.4537 */4538#if ITT_PLATFORM == ITT_PLATFORM_WIN4539int ITTAPI __itt_markA(__itt_mark_type mt, const char *parameter);4540int ITTAPI __itt_markW(__itt_mark_type mt, const wchar_t *parameter);4541#if defined(UNICODE) || defined(_UNICODE)4542#define __itt_mark __itt_markW4543#define __itt_mark_ptr __itt_markW_ptr4544#else /* UNICODE */4545#define __itt_mark __itt_markA4546#define __itt_mark_ptr __itt_markA_ptr4547#endif /* UNICODE */4548#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4549int ITTAPI __itt_mark(__itt_mark_type mt, const char *parameter);4550#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4551 4552/** @cond exclude_from_documentation */4553#ifndef INTEL_NO_MACRO_BODY4554#ifndef INTEL_NO_ITTNOTIFY_API4555#if ITT_PLATFORM == ITT_PLATFORM_WIN4556ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter))4557ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter))4558#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4559ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter))4560#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4561#if ITT_PLATFORM == ITT_PLATFORM_WIN4562#define __itt_markA ITTNOTIFY_DATA(markA)4563#define __itt_markA_ptr ITTNOTIFY_NAME(markA)4564#define __itt_markW ITTNOTIFY_DATA(markW)4565#define __itt_markW_ptr ITTNOTIFY_NAME(markW)4566#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4567#define __itt_mark ITTNOTIFY_DATA(mark)4568#define __itt_mark_ptr ITTNOTIFY_NAME(mark)4569#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4570#else /* INTEL_NO_ITTNOTIFY_API */4571#if ITT_PLATFORM == ITT_PLATFORM_WIN4572#define __itt_markA(mt, parameter) (int)04573#define __itt_markA_ptr 04574#define __itt_markW(mt, parameter) (int)04575#define __itt_markW_ptr 04576#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4577#define __itt_mark(mt, parameter) (int)04578#define __itt_mark_ptr 04579#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4580#endif /* INTEL_NO_ITTNOTIFY_API */4581#else /* INTEL_NO_MACRO_BODY */4582#if ITT_PLATFORM == ITT_PLATFORM_WIN4583#define __itt_markA_ptr 04584#define __itt_markW_ptr 04585#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4586#define __itt_mark_ptr 04587#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4588#endif /* INTEL_NO_MACRO_BODY */4589/** @endcond */4590 4591/**4592 * @brief Use this if necessary to create a "discrete" user event type (mark)4593 * for process rather then for one thread4594 * @see int __itt_mark(__itt_mark_type mt, const char* parameter);4595 */4596#if ITT_PLATFORM == ITT_PLATFORM_WIN4597int ITTAPI __itt_mark_globalA(__itt_mark_type mt, const char *parameter);4598int ITTAPI __itt_mark_globalW(__itt_mark_type mt, const wchar_t *parameter);4599#if defined(UNICODE) || defined(_UNICODE)4600#define __itt_mark_global __itt_mark_globalW4601#define __itt_mark_global_ptr __itt_mark_globalW_ptr4602#else /* UNICODE */4603#define __itt_mark_global __itt_mark_globalA4604#define __itt_mark_global_ptr __itt_mark_globalA_ptr4605#endif /* UNICODE */4606#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4607int ITTAPI __itt_mark_global(__itt_mark_type mt, const char *parameter);4608#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4609 4610/** @cond exclude_from_documentation */4611#ifndef INTEL_NO_MACRO_BODY4612#ifndef INTEL_NO_ITTNOTIFY_API4613#if ITT_PLATFORM == ITT_PLATFORM_WIN4614ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter))4615ITT_STUB(ITTAPI, int, mark_globalW,4616 (__itt_mark_type mt, const wchar_t *parameter))4617#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4618ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter))4619#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4620#if ITT_PLATFORM == ITT_PLATFORM_WIN4621#define __itt_mark_globalA ITTNOTIFY_DATA(mark_globalA)4622#define __itt_mark_globalA_ptr ITTNOTIFY_NAME(mark_globalA)4623#define __itt_mark_globalW ITTNOTIFY_DATA(mark_globalW)4624#define __itt_mark_globalW_ptr ITTNOTIFY_NAME(mark_globalW)4625#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4626#define __itt_mark_global ITTNOTIFY_DATA(mark_global)4627#define __itt_mark_global_ptr ITTNOTIFY_NAME(mark_global)4628#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4629#else /* INTEL_NO_ITTNOTIFY_API */4630#if ITT_PLATFORM == ITT_PLATFORM_WIN4631#define __itt_mark_globalA(mt, parameter) (int)04632#define __itt_mark_globalA_ptr 04633#define __itt_mark_globalW(mt, parameter) (int)04634#define __itt_mark_globalW_ptr 04635#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4636#define __itt_mark_global(mt, parameter) (int)04637#define __itt_mark_global_ptr 04638#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4639#endif /* INTEL_NO_ITTNOTIFY_API */4640#else /* INTEL_NO_MACRO_BODY */4641#if ITT_PLATFORM == ITT_PLATFORM_WIN4642#define __itt_mark_globalA_ptr 04643#define __itt_mark_globalW_ptr 04644#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */4645#define __itt_mark_global_ptr 04646#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */4647#endif /* INTEL_NO_MACRO_BODY */4648/** @endcond */4649 4650/**4651 * @brief Creates an "end" point for "continuous" mark with specified name.4652 *4653 * - Returns zero value in case of success, non-zero value otherwise.4654 * Also returns non-zero value when preceding "begin" point for the4655 * mark with the same name failed to be created or not created.4656 * - The mark of "continuous" type is placed to collection results in4657 * case of success. It appears in overtime view(s) as a special tick4658 * sign (different from "discrete" mark) together with line from4659 * corresponding "begin" mark to "end" mark.4660 * @note Continuous marks can overlap and be nested inside each other.4661 * Discrete mark can be nested inside marked region4662 * @param[in] mt - mark, created by __itt_mark_create(const char* name) function4663 * @return Returns zero value in case of success, non-zero value otherwise.4664 */4665int ITTAPI __itt_mark_off(__itt_mark_type mt);4666 4667/** @cond exclude_from_documentation */4668#ifndef INTEL_NO_MACRO_BODY4669#ifndef INTEL_NO_ITTNOTIFY_API4670ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt))4671#define __itt_mark_off ITTNOTIFY_DATA(mark_off)4672#define __itt_mark_off_ptr ITTNOTIFY_NAME(mark_off)4673#else /* INTEL_NO_ITTNOTIFY_API */4674#define __itt_mark_off(mt) (int)04675#define __itt_mark_off_ptr 04676#endif /* INTEL_NO_ITTNOTIFY_API */4677#else /* INTEL_NO_MACRO_BODY */4678#define __itt_mark_off_ptr 04679#endif /* INTEL_NO_MACRO_BODY */4680/** @endcond */4681 4682/**4683 * @brief Use this if necessary to create an "end" point for mark of process4684 * @see int __itt_mark_off(__itt_mark_type mt);4685 */4686int ITTAPI __itt_mark_global_off(__itt_mark_type mt);4687 4688/** @cond exclude_from_documentation */4689#ifndef INTEL_NO_MACRO_BODY4690#ifndef INTEL_NO_ITTNOTIFY_API4691ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt))4692#define __itt_mark_global_off ITTNOTIFY_DATA(mark_global_off)4693#define __itt_mark_global_off_ptr ITTNOTIFY_NAME(mark_global_off)4694#else /* INTEL_NO_ITTNOTIFY_API */4695#define __itt_mark_global_off(mt) (int)04696#define __itt_mark_global_off_ptr 04697#endif /* INTEL_NO_ITTNOTIFY_API */4698#else /* INTEL_NO_MACRO_BODY */4699#define __itt_mark_global_off_ptr 04700#endif /* INTEL_NO_MACRO_BODY */4701/** @endcond */4702/** @} marks group */4703 4704/**4705 * @defgroup counters_internal Counters4706 * @ingroup internal4707 * Counters group4708 * @{4709 */4710 4711/**4712 * @defgroup stitch Stack Stitching4713 * @ingroup internal4714 * Stack Stitching group4715 * @{4716 */4717/**4718 * @brief opaque structure for counter identification4719 */4720typedef struct ___itt_caller *__itt_caller;4721 4722/**4723 * @brief Create the stitch point e.g. a point in call stack where other stacks4724 * should be stitched to. The function returns a unique identifier which is used4725 * to match the cut points with corresponding stitch points.4726 */4727__itt_caller ITTAPI __itt_stack_caller_create(void);4728 4729/** @cond exclude_from_documentation */4730#ifndef INTEL_NO_MACRO_BODY4731#ifndef INTEL_NO_ITTNOTIFY_API4732ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))4733#define __itt_stack_caller_create ITTNOTIFY_DATA(stack_caller_create)4734#define __itt_stack_caller_create_ptr ITTNOTIFY_NAME(stack_caller_create)4735#else /* INTEL_NO_ITTNOTIFY_API */4736#define __itt_stack_caller_create() (__itt_caller)04737#define __itt_stack_caller_create_ptr 04738#endif /* INTEL_NO_ITTNOTIFY_API */4739#else /* INTEL_NO_MACRO_BODY */4740#define __itt_stack_caller_create_ptr 04741#endif /* INTEL_NO_MACRO_BODY */4742/** @endcond */4743 4744/**4745 * @brief Destroy the information about stitch point identified by the pointer4746 * previously returned by __itt_stack_caller_create()4747 */4748void ITTAPI __itt_stack_caller_destroy(__itt_caller id);4749 4750/** @cond exclude_from_documentation */4751#ifndef INTEL_NO_MACRO_BODY4752#ifndef INTEL_NO_ITTNOTIFY_API4753ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id))4754#define __itt_stack_caller_destroy ITTNOTIFY_VOID(stack_caller_destroy)4755#define __itt_stack_caller_destroy_ptr ITTNOTIFY_NAME(stack_caller_destroy)4756#else /* INTEL_NO_ITTNOTIFY_API */4757#define __itt_stack_caller_destroy(id)4758#define __itt_stack_caller_destroy_ptr 04759#endif /* INTEL_NO_ITTNOTIFY_API */4760#else /* INTEL_NO_MACRO_BODY */4761#define __itt_stack_caller_destroy_ptr 04762#endif /* INTEL_NO_MACRO_BODY */4763/** @endcond */4764 4765/**4766 * @brief Sets the cut point. Stack from each event which occurs after this call4767 * will be cut at the same stack level the function was called and stitched to4768 * the corresponding stitch point.4769 */4770void ITTAPI __itt_stack_callee_enter(__itt_caller id);4771 4772/** @cond exclude_from_documentation */4773#ifndef INTEL_NO_MACRO_BODY4774#ifndef INTEL_NO_ITTNOTIFY_API4775ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id))4776#define __itt_stack_callee_enter ITTNOTIFY_VOID(stack_callee_enter)4777#define __itt_stack_callee_enter_ptr ITTNOTIFY_NAME(stack_callee_enter)4778#else /* INTEL_NO_ITTNOTIFY_API */4779#define __itt_stack_callee_enter(id)4780#define __itt_stack_callee_enter_ptr 04781#endif /* INTEL_NO_ITTNOTIFY_API */4782#else /* INTEL_NO_MACRO_BODY */4783#define __itt_stack_callee_enter_ptr 04784#endif /* INTEL_NO_MACRO_BODY */4785/** @endcond */4786 4787/**4788 * @brief This function eliminates the cut point which was set by latest4789 * __itt_stack_callee_enter().4790 */4791void ITTAPI __itt_stack_callee_leave(__itt_caller id);4792 4793/** @cond exclude_from_documentation */4794#ifndef INTEL_NO_MACRO_BODY4795#ifndef INTEL_NO_ITTNOTIFY_API4796ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id))4797#define __itt_stack_callee_leave ITTNOTIFY_VOID(stack_callee_leave)4798#define __itt_stack_callee_leave_ptr ITTNOTIFY_NAME(stack_callee_leave)4799#else /* INTEL_NO_ITTNOTIFY_API */4800#define __itt_stack_callee_leave(id)4801#define __itt_stack_callee_leave_ptr 04802#endif /* INTEL_NO_ITTNOTIFY_API */4803#else /* INTEL_NO_MACRO_BODY */4804#define __itt_stack_callee_leave_ptr 04805#endif /* INTEL_NO_MACRO_BODY */4806/** @endcond */4807 4808/** @} stitch group */4809 4810/* *****************************************************************************************************************************4811 */4812 4813#include <stdarg.h>4814 4815/** @cond exclude_from_documentation */4816typedef enum __itt_error_code {4817 __itt_error_success = 0, /*!< no error */4818 __itt_error_no_module = 1, /*!< module can't be loaded */4819 /* %1$s -- library name; win: %2$d -- system error code; unx: %2$s -- system4820 error message. */4821 __itt_error_no_symbol = 2, /*!< symbol not found */4822 /* %1$s -- library name, %2$s -- symbol name. */4823 __itt_error_unknown_group = 3, /*!< unknown group specified */4824 /* %1$s -- env var name, %2$s -- group name. */4825 __itt_error_cant_read_env = 4, /*!< GetEnvironmentVariable() failed */4826 /* %1$s -- env var name, %2$d -- system error. */4827 __itt_error_env_too_long = 5, /*!< variable value too long */4828 /* %1$s -- env var name, %2$d -- actual length of the var, %3$d -- max allowed4829 length. */4830 __itt_error_system =4831 6 /*!< pthread_mutexattr_init or pthread_mutex_init failed */4832 /* %1$s -- function name, %2$d -- errno. */4833} __itt_error_code;4834 4835typedef void(__itt_error_handler_t)(__itt_error_code code, va_list);4836__itt_error_handler_t *__itt_set_error_handler(__itt_error_handler_t *);4837 4838const char *ITTAPI __itt_api_version(void);4839/** @endcond */4840 4841/** @cond exclude_from_documentation */4842#ifndef INTEL_NO_MACRO_BODY4843#ifndef INTEL_NO_ITTNOTIFY_API4844#define __itt_error_handler ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, error_handler)4845void __itt_error_handler(__itt_error_code code, va_list args);4846extern const int ITTNOTIFY_NAME(err);4847#define __itt_err ITTNOTIFY_NAME(err)4848ITT_STUB(ITTAPI, const char *, api_version, (void))4849#define __itt_api_version ITTNOTIFY_DATA(api_version)4850#define __itt_api_version_ptr ITTNOTIFY_NAME(api_version)4851#else /* INTEL_NO_ITTNOTIFY_API */4852#define __itt_api_version() (const char *)04853#define __itt_api_version_ptr 04854#endif /* INTEL_NO_ITTNOTIFY_API */4855#else /* INTEL_NO_MACRO_BODY */4856#define __itt_api_version_ptr 04857#endif /* INTEL_NO_MACRO_BODY */4858/** @endcond */4859 4860#ifdef __cplusplus4861}4862#endif /* __cplusplus */4863 4864#endif /* _ITTNOTIFY_PRIVATE_ */4865 4866#endif /* INTEL_ITTNOTIFY_API_PRIVATE */4867