10b57cec5SDimitry Andric 
20b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
30b57cec5SDimitry Andric //
40b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
50b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
60b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
70b57cec5SDimitry Andric //
80b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
90b57cec5SDimitry Andric 
100b57cec5SDimitry Andric #ifndef _ITTNOTIFY_H_
110b57cec5SDimitry Andric #define _ITTNOTIFY_H_
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric /**
140b57cec5SDimitry Andric @file
150b57cec5SDimitry Andric @brief Public User API functions and types
160b57cec5SDimitry Andric @mainpage
170b57cec5SDimitry Andric 
18349cc55cSDimitry Andric The Instrumentation and Tracing Technology API (ITT API) is used to
19349cc55cSDimitry Andric annotate a user's program with additional information
200b57cec5SDimitry Andric that can be used by correctness and performance tools. The user inserts
210b57cec5SDimitry Andric calls in their program. Those calls generate information that is collected
220b57cec5SDimitry Andric at runtime, and used by Intel(R) Threading Tools.
230b57cec5SDimitry Andric 
240b57cec5SDimitry Andric @section API Concepts
250b57cec5SDimitry Andric The following general concepts are used throughout the API.
260b57cec5SDimitry Andric 
270b57cec5SDimitry Andric @subsection Unicode Support
280b57cec5SDimitry Andric Many API functions take character string arguments. On Windows, there
290b57cec5SDimitry Andric are two versions of each such function. The function name is suffixed
300b57cec5SDimitry Andric by W if Unicode support is enabled, and by A otherwise. Any API function
310b57cec5SDimitry Andric that takes a character string argument adheres to this convention.
320b57cec5SDimitry Andric 
330b57cec5SDimitry Andric @subsection Conditional Compilation
340b57cec5SDimitry Andric Many users prefer having an option to modify ITT API code when linking it
350b57cec5SDimitry Andric inside their runtimes. ITT API header file provides a mechanism to replace
360b57cec5SDimitry Andric ITT API function names inside your code with empty strings. To do this,
370b57cec5SDimitry Andric define the macros INTEL_NO_ITTNOTIFY_API during compilation and remove the
380b57cec5SDimitry Andric static library from the linker script.
390b57cec5SDimitry Andric 
400b57cec5SDimitry Andric @subsection Domains
410b57cec5SDimitry Andric [see domains]
420b57cec5SDimitry Andric Domains provide a way to separate notification for different modules or
430b57cec5SDimitry Andric libraries in a program. Domains are specified by dotted character strings,
440b57cec5SDimitry Andric e.g. TBB.Internal.Control.
450b57cec5SDimitry Andric 
460b57cec5SDimitry Andric A mechanism (to be specified) is provided to enable and disable
470b57cec5SDimitry Andric domains. By default, all domains are enabled.
480b57cec5SDimitry Andric @subsection Named Entities and Instances
490b57cec5SDimitry Andric Named entities (frames, regions, tasks, and markers) communicate
500b57cec5SDimitry Andric information about the program to the analysis tools. A named entity often
510b57cec5SDimitry Andric refers to a section of program code, or to some set of logical concepts
520b57cec5SDimitry Andric that the programmer wants to group together.
530b57cec5SDimitry Andric 
540b57cec5SDimitry Andric Named entities relate to the programmer's static view of the program. When
550b57cec5SDimitry Andric the program actually executes, many instances of a given named entity
560b57cec5SDimitry Andric may be created.
570b57cec5SDimitry Andric 
580b57cec5SDimitry Andric The API annotations denote instances of named entities. The actual
590b57cec5SDimitry Andric named entities are displayed using the analysis tools. In other words,
600b57cec5SDimitry Andric the named entities come into existence when instances are created.
610b57cec5SDimitry Andric 
620b57cec5SDimitry Andric Instances of named entities may have instance identifiers (IDs). Some
630b57cec5SDimitry Andric API calls use instance identifiers to create relationships between
640b57cec5SDimitry Andric different instances of named entities. Other API calls associate data
650b57cec5SDimitry Andric with instances of named entities.
660b57cec5SDimitry Andric 
670b57cec5SDimitry Andric Some named entities must always have instance IDs. In particular, regions
680b57cec5SDimitry Andric and frames always have IDs. Task and markers need IDs only if the ID is
690b57cec5SDimitry Andric needed in another API call (such as adding a relation or metadata).
700b57cec5SDimitry Andric 
710b57cec5SDimitry Andric The lifetime of instance IDs is distinct from the lifetime of
720b57cec5SDimitry Andric instances. This allows various relationships to be specified separate
730b57cec5SDimitry Andric from the actual execution of instances. This flexibility comes at the
740b57cec5SDimitry Andric expense of extra API calls.
750b57cec5SDimitry Andric 
760b57cec5SDimitry Andric The same ID may not be reused for different instances, unless a previous
770b57cec5SDimitry Andric [ref] __itt_id_destroy call for that ID has been issued.
780b57cec5SDimitry Andric */
790b57cec5SDimitry Andric 
800b57cec5SDimitry Andric /** @cond exclude_from_documentation */
810b57cec5SDimitry Andric #ifndef ITT_OS_WIN
820b57cec5SDimitry Andric #define ITT_OS_WIN 1
830b57cec5SDimitry Andric #endif /* ITT_OS_WIN */
840b57cec5SDimitry Andric 
850b57cec5SDimitry Andric #ifndef ITT_OS_LINUX
860b57cec5SDimitry Andric #define ITT_OS_LINUX 2
870b57cec5SDimitry Andric #endif /* ITT_OS_LINUX */
880b57cec5SDimitry Andric 
890b57cec5SDimitry Andric #ifndef ITT_OS_MAC
900b57cec5SDimitry Andric #define ITT_OS_MAC 3
910b57cec5SDimitry Andric #endif /* ITT_OS_MAC */
920b57cec5SDimitry Andric 
930b57cec5SDimitry Andric #ifndef ITT_OS_FREEBSD
940b57cec5SDimitry Andric #define ITT_OS_FREEBSD 4
950b57cec5SDimitry Andric #endif /* ITT_OS_FREEBSD */
960b57cec5SDimitry Andric 
970b57cec5SDimitry Andric #ifndef ITT_OS
980b57cec5SDimitry Andric #if defined WIN32 || defined _WIN32
990b57cec5SDimitry Andric #define ITT_OS ITT_OS_WIN
1000b57cec5SDimitry Andric #elif defined(__APPLE__) && defined(__MACH__)
1010b57cec5SDimitry Andric #define ITT_OS ITT_OS_MAC
1020b57cec5SDimitry Andric #elif defined(__FreeBSD__)
1030b57cec5SDimitry Andric #define ITT_OS ITT_OS_FREEBSD
1040b57cec5SDimitry Andric #else
1050b57cec5SDimitry Andric #define ITT_OS ITT_OS_LINUX
1060b57cec5SDimitry Andric #endif
1070b57cec5SDimitry Andric #endif /* ITT_OS */
1080b57cec5SDimitry Andric 
1090b57cec5SDimitry Andric #ifndef ITT_PLATFORM_WIN
1100b57cec5SDimitry Andric #define ITT_PLATFORM_WIN 1
1110b57cec5SDimitry Andric #endif /* ITT_PLATFORM_WIN */
1120b57cec5SDimitry Andric 
1130b57cec5SDimitry Andric #ifndef ITT_PLATFORM_POSIX
1140b57cec5SDimitry Andric #define ITT_PLATFORM_POSIX 2
1150b57cec5SDimitry Andric #endif /* ITT_PLATFORM_POSIX */
1160b57cec5SDimitry Andric 
1170b57cec5SDimitry Andric #ifndef ITT_PLATFORM_MAC
1180b57cec5SDimitry Andric #define ITT_PLATFORM_MAC 3
1190b57cec5SDimitry Andric #endif /* ITT_PLATFORM_MAC */
1200b57cec5SDimitry Andric 
1210b57cec5SDimitry Andric #ifndef ITT_PLATFORM_FREEBSD
1220b57cec5SDimitry Andric #define ITT_PLATFORM_FREEBSD 4
1230b57cec5SDimitry Andric #endif /* ITT_PLATFORM_FREEBSD */
1240b57cec5SDimitry Andric 
1250b57cec5SDimitry Andric #ifndef ITT_PLATFORM
1260b57cec5SDimitry Andric #if ITT_OS == ITT_OS_WIN
1270b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_WIN
1280b57cec5SDimitry Andric #elif ITT_OS == ITT_OS_MAC
1290b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_MAC
1300b57cec5SDimitry Andric #elif ITT_OS == ITT_OS_FREEBSD
1310b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_FREEBSD
1320b57cec5SDimitry Andric #else
1330b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_POSIX
1340b57cec5SDimitry Andric #endif
1350b57cec5SDimitry Andric #endif /* ITT_PLATFORM */
1360b57cec5SDimitry Andric 
1370b57cec5SDimitry Andric #if defined(_UNICODE) && !defined(UNICODE)
1380b57cec5SDimitry Andric #define UNICODE
1390b57cec5SDimitry Andric #endif
1400b57cec5SDimitry Andric 
1410b57cec5SDimitry Andric #include <stddef.h>
1420b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
1430b57cec5SDimitry Andric #include <tchar.h>
1440b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1450b57cec5SDimitry Andric #include <stdint.h>
1460b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
1470b57cec5SDimitry Andric #include <wchar.h>
1480b57cec5SDimitry Andric #endif /* UNICODE || _UNICODE */
1490b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1500b57cec5SDimitry Andric 
1510b57cec5SDimitry Andric #ifndef ITTAPI_CDECL
1520b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
1530b57cec5SDimitry Andric #define ITTAPI_CDECL __cdecl
1540b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1550b57cec5SDimitry Andric #if defined _M_IX86 || defined __i386__
1560b57cec5SDimitry Andric #define ITTAPI_CDECL __attribute__((cdecl))
1570b57cec5SDimitry Andric #else /* _M_IX86 || __i386__ */
1580b57cec5SDimitry Andric #define ITTAPI_CDECL /* actual only on x86 platform */
1590b57cec5SDimitry Andric #endif /* _M_IX86 || __i386__ */
1600b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1610b57cec5SDimitry Andric #endif /* ITTAPI_CDECL */
1620b57cec5SDimitry Andric 
1630b57cec5SDimitry Andric #ifndef STDCALL
1640b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
1650b57cec5SDimitry Andric #define STDCALL __stdcall
1660b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1670b57cec5SDimitry Andric #if defined _M_IX86 || defined __i386__
1680b57cec5SDimitry Andric #define STDCALL __attribute__((stdcall))
1690b57cec5SDimitry Andric #else /* _M_IX86 || __i386__ */
1700b57cec5SDimitry Andric #define STDCALL /* supported only on x86 platform */
1710b57cec5SDimitry Andric #endif /* _M_IX86 || __i386__ */
1720b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1730b57cec5SDimitry Andric #endif /* STDCALL */
1740b57cec5SDimitry Andric 
1750b57cec5SDimitry Andric #define ITTAPI ITTAPI_CDECL
1760b57cec5SDimitry Andric #define LIBITTAPI ITTAPI_CDECL
1770b57cec5SDimitry Andric 
1780b57cec5SDimitry Andric /* TODO: Temporary for compatibility! */
1790b57cec5SDimitry Andric #define ITTAPI_CALL ITTAPI_CDECL
1800b57cec5SDimitry Andric #define LIBITTAPI_CALL ITTAPI_CDECL
1810b57cec5SDimitry Andric 
1820b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
1830b57cec5SDimitry Andric /* use __forceinline (VC++ specific) */
184349cc55cSDimitry Andric #if defined(__MINGW32__) && !defined(__cplusplus)
185349cc55cSDimitry Andric #define ITT_INLINE                                                             \
186349cc55cSDimitry Andric   static __inline__ __attribute__((__always_inline__, __gnu_inline__))
187349cc55cSDimitry Andric #else
188349cc55cSDimitry Andric #define ITT_INLINE static __forceinline
189349cc55cSDimitry Andric #endif /* __MINGW32__ */
190349cc55cSDimitry Andric 
1910b57cec5SDimitry Andric #define ITT_INLINE_ATTRIBUTE /* nothing */
1920b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1930b57cec5SDimitry Andric /*
1940b57cec5SDimitry Andric  * Generally, functions are not inlined unless optimization is specified.
1950b57cec5SDimitry Andric  * For functions declared inline, this attribute inlines the function even
1960b57cec5SDimitry Andric  * if no optimization level was specified.
1970b57cec5SDimitry Andric  */
1980b57cec5SDimitry Andric #ifdef __STRICT_ANSI__
1990b57cec5SDimitry Andric #define ITT_INLINE static
2000b57cec5SDimitry Andric #define ITT_INLINE_ATTRIBUTE __attribute__((unused))
2010b57cec5SDimitry Andric #else /* __STRICT_ANSI__ */
2020b57cec5SDimitry Andric #define ITT_INLINE static inline
2030b57cec5SDimitry Andric #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
2040b57cec5SDimitry Andric #endif /* __STRICT_ANSI__ */
2050b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2060b57cec5SDimitry Andric /** @endcond */
2070b57cec5SDimitry Andric 
2080b57cec5SDimitry Andric #ifdef INTEL_ITTNOTIFY_ENABLE_LEGACY
2090b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
210fe6060f1SDimitry Andric #pragma message(                                                               \
211fe6060f1SDimitry Andric     "WARNING!!! Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro")
2120b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
213fe6060f1SDimitry Andric #warning                                                                       \
214fe6060f1SDimitry Andric     "Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro"
2150b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2160b57cec5SDimitry Andric #include "legacy/ittnotify.h"
2170b57cec5SDimitry Andric #endif /* INTEL_ITTNOTIFY_ENABLE_LEGACY */
2180b57cec5SDimitry Andric 
2190b57cec5SDimitry Andric /** @cond exclude_from_documentation */
2200b57cec5SDimitry Andric /* Helper macro for joining tokens */
2210b57cec5SDimitry Andric #define ITT_JOIN_AUX(p, n) p##n
2220b57cec5SDimitry Andric #define ITT_JOIN(p, n) ITT_JOIN_AUX(p, n)
2230b57cec5SDimitry Andric 
2240b57cec5SDimitry Andric #ifdef ITT_MAJOR
2250b57cec5SDimitry Andric #undef ITT_MAJOR
2260b57cec5SDimitry Andric #endif
2270b57cec5SDimitry Andric #ifdef ITT_MINOR
2280b57cec5SDimitry Andric #undef ITT_MINOR
2290b57cec5SDimitry Andric #endif
2300b57cec5SDimitry Andric #define ITT_MAJOR 3
2310b57cec5SDimitry Andric #define ITT_MINOR 0
2320b57cec5SDimitry Andric 
2330b57cec5SDimitry Andric /* Standard versioning of a token with major and minor version numbers */
2340b57cec5SDimitry Andric #define ITT_VERSIONIZE(x)                                                      \
235fe6060f1SDimitry Andric   ITT_JOIN(x, ITT_JOIN(_, ITT_JOIN(ITT_MAJOR, ITT_JOIN(_, ITT_MINOR))))
2360b57cec5SDimitry Andric 
2370b57cec5SDimitry Andric #ifndef INTEL_ITTNOTIFY_PREFIX
2380b57cec5SDimitry Andric #define INTEL_ITTNOTIFY_PREFIX __itt_
2390b57cec5SDimitry Andric #endif /* INTEL_ITTNOTIFY_PREFIX */
2400b57cec5SDimitry Andric #ifndef INTEL_ITTNOTIFY_POSTFIX
2410b57cec5SDimitry Andric #define INTEL_ITTNOTIFY_POSTFIX _ptr_
2420b57cec5SDimitry Andric #endif /* INTEL_ITTNOTIFY_POSTFIX */
2430b57cec5SDimitry Andric 
2440b57cec5SDimitry Andric #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, n)
245fe6060f1SDimitry Andric #define ITTNOTIFY_NAME(n)                                                      \
246fe6060f1SDimitry Andric   ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n, INTEL_ITTNOTIFY_POSTFIX)))
2470b57cec5SDimitry Andric 
2480b57cec5SDimitry Andric #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
2490b57cec5SDimitry Andric #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
2500b57cec5SDimitry Andric 
251fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D0(n, d)                                                \
252fe6060f1SDimitry Andric   (!(d)->flags)          ? (void)0                                             \
253fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
254fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d)
255fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D1(n, d, x)                                             \
256fe6060f1SDimitry Andric   (!(d)->flags)          ? (void)0                                             \
257fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
258fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x)
259fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D2(n, d, x, y)                                          \
260fe6060f1SDimitry Andric   (!(d)->flags)          ? (void)0                                             \
261fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
262fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y)
263fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D3(n, d, x, y, z)                                       \
264fe6060f1SDimitry Andric   (!(d)->flags)          ? (void)0                                             \
265fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
266fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y, z)
267fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D4(n, d, x, y, z, a)                                    \
268fe6060f1SDimitry Andric   (!(d)->flags)          ? (void)0                                             \
269fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
270fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y, z, a)
271fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D5(n, d, x, y, z, a, b)                                 \
272fe6060f1SDimitry Andric   (!(d)->flags)          ? (void)0                                             \
273fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
274fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b)
275fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D6(n, d, x, y, z, a, b, c)                              \
276fe6060f1SDimitry Andric   (!(d)->flags)          ? (void)0                                             \
277fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
278fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c)
279fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D0(n, d)                                                \
280fe6060f1SDimitry Andric   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
281fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D1(n, d, x)                                             \
282fe6060f1SDimitry Andric   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x)
283fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D2(n, d, x, y)                                          \
284fe6060f1SDimitry Andric   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y)
285fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D3(n, d, x, y, z)                                       \
286fe6060f1SDimitry Andric   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y, z)
287fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D4(n, d, x, y, z, a)                                    \
288fe6060f1SDimitry Andric   (!(d)->flags)          ? 0                                                   \
289fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? 0                                                   \
290fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y, z, a)
291fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D5(n, d, x, y, z, a, b)                                 \
292fe6060f1SDimitry Andric   (!(d)->flags)          ? 0                                                   \
293fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? 0                                                   \
294fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b)
295fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D6(n, d, x, y, z, a, b, c)                              \
296fe6060f1SDimitry Andric   (!(d)->flags)          ? 0                                                   \
297fe6060f1SDimitry Andric   : (!ITTNOTIFY_NAME(n)) ? 0                                                   \
298fe6060f1SDimitry Andric                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c)
2990b57cec5SDimitry Andric 
3000b57cec5SDimitry Andric #ifdef ITT_STUB
3010b57cec5SDimitry Andric #undef ITT_STUB
3020b57cec5SDimitry Andric #endif
3030b57cec5SDimitry Andric #ifdef ITT_STUBV
3040b57cec5SDimitry Andric #undef ITT_STUBV
3050b57cec5SDimitry Andric #endif
3060b57cec5SDimitry Andric #define ITT_STUBV(api, type, name, args)                                       \
3070b57cec5SDimitry Andric   typedef type(api *ITT_JOIN(ITTNOTIFY_NAME(name), _t)) args;                  \
3080b57cec5SDimitry Andric   extern ITT_JOIN(ITTNOTIFY_NAME(name), _t) ITTNOTIFY_NAME(name);
3090b57cec5SDimitry Andric #define ITT_STUB ITT_STUBV
3100b57cec5SDimitry Andric /** @endcond */
3110b57cec5SDimitry Andric 
3120b57cec5SDimitry Andric #ifdef __cplusplus
3130b57cec5SDimitry Andric extern "C" {
3140b57cec5SDimitry Andric #endif /* __cplusplus */
3150b57cec5SDimitry Andric 
3160b57cec5SDimitry Andric /** @cond exclude_from_gpa_documentation */
3170b57cec5SDimitry Andric /**
3180b57cec5SDimitry Andric  * @defgroup public Public API
3190b57cec5SDimitry Andric  * @{
3200b57cec5SDimitry Andric  * @}
3210b57cec5SDimitry Andric  */
3220b57cec5SDimitry Andric 
3230b57cec5SDimitry Andric /**
3240b57cec5SDimitry Andric  * @defgroup control Collection Control
3250b57cec5SDimitry Andric  * @ingroup public
326fe6060f1SDimitry Andric  * General behavior: application continues to run, but no profiling information
327fe6060f1SDimitry Andric  * is being collected
3280b57cec5SDimitry Andric  *
329fe6060f1SDimitry Andric  * Pausing occurs not only for the current thread but for all process as well as
330fe6060f1SDimitry Andric  * spawned processes
3310b57cec5SDimitry Andric  * - Intel(R) Parallel Inspector and Intel(R) Inspector XE:
3320b57cec5SDimitry Andric  *   - Does not analyze or report errors that involve memory access.
3330b57cec5SDimitry Andric  *   - Other errors are reported as usual. Pausing data collection in
3340b57cec5SDimitry Andric  *     Intel(R) Parallel Inspector and Intel(R) Inspector XE
3350b57cec5SDimitry Andric  *     only pauses tracing and analyzing memory access.
3360b57cec5SDimitry Andric  *     It does not pause tracing or analyzing threading APIs.
3370b57cec5SDimitry Andric  *   .
3380b57cec5SDimitry Andric  * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
3390b57cec5SDimitry Andric  *   - Does continue to record when new threads are started.
3400b57cec5SDimitry Andric  *   .
3410b57cec5SDimitry Andric  * - Other effects:
3420b57cec5SDimitry Andric  *   - Possible reduction of runtime overhead.
3430b57cec5SDimitry Andric  *   .
3440b57cec5SDimitry Andric  * @{
3450b57cec5SDimitry Andric  */
3460b57cec5SDimitry Andric /** @brief Pause collection */
3470b57cec5SDimitry Andric void ITTAPI __itt_pause(void);
3480b57cec5SDimitry Andric /** @brief Resume collection */
3490b57cec5SDimitry Andric void ITTAPI __itt_resume(void);
3500b57cec5SDimitry Andric /** @brief Detach collection */
3510b57cec5SDimitry Andric void ITTAPI __itt_detach(void);
3520b57cec5SDimitry Andric 
3530b57cec5SDimitry Andric /** @cond exclude_from_documentation */
3540b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
3550b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3560b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, pause, (void))
3570b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, resume, (void))
3580b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, detach, (void))
3590b57cec5SDimitry Andric #define __itt_pause ITTNOTIFY_VOID(pause)
3600b57cec5SDimitry Andric #define __itt_pause_ptr ITTNOTIFY_NAME(pause)
3610b57cec5SDimitry Andric #define __itt_resume ITTNOTIFY_VOID(resume)
3620b57cec5SDimitry Andric #define __itt_resume_ptr ITTNOTIFY_NAME(resume)
3630b57cec5SDimitry Andric #define __itt_detach ITTNOTIFY_VOID(detach)
3640b57cec5SDimitry Andric #define __itt_detach_ptr ITTNOTIFY_NAME(detach)
3650b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
3660b57cec5SDimitry Andric #define __itt_pause()
3670b57cec5SDimitry Andric #define __itt_pause_ptr 0
3680b57cec5SDimitry Andric #define __itt_resume()
3690b57cec5SDimitry Andric #define __itt_resume_ptr 0
3700b57cec5SDimitry Andric #define __itt_detach()
3710b57cec5SDimitry Andric #define __itt_detach_ptr 0
3720b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
3730b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
3740b57cec5SDimitry Andric #define __itt_pause_ptr 0
3750b57cec5SDimitry Andric #define __itt_resume_ptr 0
3760b57cec5SDimitry Andric #define __itt_detach_ptr 0
3770b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
3780b57cec5SDimitry Andric /** @endcond */
3790b57cec5SDimitry Andric /** @} control group */
3800b57cec5SDimitry Andric /** @endcond */
3810b57cec5SDimitry Andric 
3820b57cec5SDimitry Andric /**
383349cc55cSDimitry Andric  * @defgroup Intel Processor Trace control
384349cc55cSDimitry Andric  * API from this group provides control over collection and analysis of Intel
385349cc55cSDimitry Andric  * Processor Trace (Intel PT) data Information about Intel Processor Trace
386349cc55cSDimitry Andric  * technology can be found here (Volume 3 chapter 35):
387349cc55cSDimitry Andric  * https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf
388349cc55cSDimitry Andric  * Use this API to mark particular code regions for loading detailed performance
389349cc55cSDimitry Andric  * statistics. This mode makes your analysis faster and more accurate.
390349cc55cSDimitry Andric  * @{
391349cc55cSDimitry Andric  */
392349cc55cSDimitry Andric typedef unsigned char __itt_pt_region;
393349cc55cSDimitry Andric 
394349cc55cSDimitry Andric /**
395349cc55cSDimitry Andric  * @brief function saves a region name marked with Intel PT API and returns a
396349cc55cSDimitry Andric  * region id. Only 7 names can be registered. Attempts to register more names
397349cc55cSDimitry Andric  * will be ignored and a region id with auto names will be returned. For
398349cc55cSDimitry Andric  * automatic naming of regions pass NULL as function parameter
399349cc55cSDimitry Andric  */
400349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
401349cc55cSDimitry Andric __itt_pt_region ITTAPI __itt_pt_region_createA(const char *name);
402349cc55cSDimitry Andric __itt_pt_region ITTAPI __itt_pt_region_createW(const wchar_t *name);
403349cc55cSDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
404349cc55cSDimitry Andric #define __itt_pt_region_create __itt_pt_region_createW
405349cc55cSDimitry Andric #else /* UNICODE */
406349cc55cSDimitry Andric #define __itt_pt_region_create __itt_pt_region_createA
407349cc55cSDimitry Andric #endif /* UNICODE */
408349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
409349cc55cSDimitry Andric __itt_pt_region ITTAPI __itt_pt_region_create(const char *name);
410349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
411349cc55cSDimitry Andric 
412349cc55cSDimitry Andric /** @cond exclude_from_documentation */
413349cc55cSDimitry Andric #ifndef INTEL_NO_MACRO_BODY
414349cc55cSDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
415349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
416349cc55cSDimitry Andric ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name))
417349cc55cSDimitry Andric ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name))
418349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
419349cc55cSDimitry Andric ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name))
420349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
421349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
422349cc55cSDimitry Andric #define __itt_pt_region_createA ITTNOTIFY_DATA(pt_region_createA)
423349cc55cSDimitry Andric #define __itt_pt_region_createA_ptr ITTNOTIFY_NAME(pt_region_createA)
424349cc55cSDimitry Andric #define __itt_pt_region_createW ITTNOTIFY_DATA(pt_region_createW)
425349cc55cSDimitry Andric #define __itt_pt_region_createW_ptr ITTNOTIFY_NAME(pt_region_createW)
426349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
427349cc55cSDimitry Andric #define __itt_pt_region_create ITTNOTIFY_DATA(pt_region_create)
428349cc55cSDimitry Andric #define __itt_pt_region_create_ptr ITTNOTIFY_NAME(pt_region_create)
429349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
430349cc55cSDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
431349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
432349cc55cSDimitry Andric #define __itt_pt_region_createA(name) (__itt_pt_region)0
433349cc55cSDimitry Andric #define __itt_pt_region_createA_ptr 0
434349cc55cSDimitry Andric #define __itt_pt_region_createW(name) (__itt_pt_region)0
435349cc55cSDimitry Andric #define __itt_pt_region_createW_ptr 0
436349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
437349cc55cSDimitry Andric #define __itt_pt_region_create(name) (__itt_pt_region)0
438349cc55cSDimitry Andric #define __itt_pt_region_create_ptr 0
439349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
440349cc55cSDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
441349cc55cSDimitry Andric #else /* INTEL_NO_MACRO_BODY */
442349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
443349cc55cSDimitry Andric #define __itt_pt_region_createA_ptr 0
444349cc55cSDimitry Andric #define __itt_pt_region_createW_ptr 0
445349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
446349cc55cSDimitry Andric #define __itt_pt_region_create_ptr 0
447349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
448349cc55cSDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
449349cc55cSDimitry Andric /** @endcond */
450349cc55cSDimitry Andric 
451349cc55cSDimitry Andric /**
452349cc55cSDimitry Andric  * @brief function contains a special code pattern identified on the
453349cc55cSDimitry Andric  * post-processing stage and marks the beginning of a code region targeted for
454349cc55cSDimitry Andric  * Intel PT analysis
455349cc55cSDimitry Andric  * @param[in] region - region id, 0 <= region < 8
456349cc55cSDimitry Andric  */
457349cc55cSDimitry Andric void __itt_mark_pt_region_begin(__itt_pt_region region);
458349cc55cSDimitry Andric /**
459349cc55cSDimitry Andric  * @brief function contains a special code pattern identified on the
460349cc55cSDimitry Andric  * post-processing stage and marks the end of a code region targeted for Intel
461349cc55cSDimitry Andric  * PT analysis
462349cc55cSDimitry Andric  * @param[in] region - region id, 0 <= region < 8
463349cc55cSDimitry Andric  */
464349cc55cSDimitry Andric void __itt_mark_pt_region_end(__itt_pt_region region);
465349cc55cSDimitry Andric /** @} Intel PT control group*/
466349cc55cSDimitry Andric 
467349cc55cSDimitry Andric /**
4680b57cec5SDimitry Andric  * @defgroup threads Threads
4690b57cec5SDimitry Andric  * @ingroup public
4700b57cec5SDimitry Andric  * Give names to threads
4710b57cec5SDimitry Andric  * @{
4720b57cec5SDimitry Andric  */
4730b57cec5SDimitry Andric /**
4740b57cec5SDimitry Andric  * @brief Sets thread name of calling thread
4750b57cec5SDimitry Andric  * @param[in] name - name of thread
4760b57cec5SDimitry Andric  */
4770b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4780b57cec5SDimitry Andric void ITTAPI __itt_thread_set_nameA(const char *name);
4790b57cec5SDimitry Andric void ITTAPI __itt_thread_set_nameW(const wchar_t *name);
4800b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
4810b57cec5SDimitry Andric #define __itt_thread_set_name __itt_thread_set_nameW
4820b57cec5SDimitry Andric #define __itt_thread_set_name_ptr __itt_thread_set_nameW_ptr
4830b57cec5SDimitry Andric #else /* UNICODE */
4840b57cec5SDimitry Andric #define __itt_thread_set_name __itt_thread_set_nameA
4850b57cec5SDimitry Andric #define __itt_thread_set_name_ptr __itt_thread_set_nameA_ptr
4860b57cec5SDimitry Andric #endif /* UNICODE */
4870b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4880b57cec5SDimitry Andric void ITTAPI __itt_thread_set_name(const char *name);
4890b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4900b57cec5SDimitry Andric 
4910b57cec5SDimitry Andric /** @cond exclude_from_documentation */
4920b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
4930b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
4940b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4950b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name))
4960b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name))
4970b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4980b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name))
4990b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
5000b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
5010b57cec5SDimitry Andric #define __itt_thread_set_nameA ITTNOTIFY_VOID(thread_set_nameA)
5020b57cec5SDimitry Andric #define __itt_thread_set_nameA_ptr ITTNOTIFY_NAME(thread_set_nameA)
5030b57cec5SDimitry Andric #define __itt_thread_set_nameW ITTNOTIFY_VOID(thread_set_nameW)
5040b57cec5SDimitry Andric #define __itt_thread_set_nameW_ptr ITTNOTIFY_NAME(thread_set_nameW)
5050b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
5060b57cec5SDimitry Andric #define __itt_thread_set_name ITTNOTIFY_VOID(thread_set_name)
5070b57cec5SDimitry Andric #define __itt_thread_set_name_ptr ITTNOTIFY_NAME(thread_set_name)
5080b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
5090b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
5100b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
5110b57cec5SDimitry Andric #define __itt_thread_set_nameA(name)
5120b57cec5SDimitry Andric #define __itt_thread_set_nameA_ptr 0
5130b57cec5SDimitry Andric #define __itt_thread_set_nameW(name)
5140b57cec5SDimitry Andric #define __itt_thread_set_nameW_ptr 0
5150b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
5160b57cec5SDimitry Andric #define __itt_thread_set_name(name)
5170b57cec5SDimitry Andric #define __itt_thread_set_name_ptr 0
5180b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
5190b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
5200b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
5210b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
5220b57cec5SDimitry Andric #define __itt_thread_set_nameA_ptr 0
5230b57cec5SDimitry Andric #define __itt_thread_set_nameW_ptr 0
5240b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
5250b57cec5SDimitry Andric #define __itt_thread_set_name_ptr 0
5260b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
5270b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
5280b57cec5SDimitry Andric /** @endcond */
5290b57cec5SDimitry Andric 
5300b57cec5SDimitry Andric /** @cond exclude_from_gpa_documentation */
5310b57cec5SDimitry Andric 
5320b57cec5SDimitry Andric /**
533fe6060f1SDimitry Andric  * @brief Mark current thread as ignored from this point on, for the duration of
534fe6060f1SDimitry Andric  * its existence.
5350b57cec5SDimitry Andric  */
5360b57cec5SDimitry Andric void ITTAPI __itt_thread_ignore(void);
5370b57cec5SDimitry Andric 
5380b57cec5SDimitry Andric /** @cond exclude_from_documentation */
5390b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
5400b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
5410b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, thread_ignore, (void))
5420b57cec5SDimitry Andric #define __itt_thread_ignore ITTNOTIFY_VOID(thread_ignore)
5430b57cec5SDimitry Andric #define __itt_thread_ignore_ptr ITTNOTIFY_NAME(thread_ignore)
5440b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
5450b57cec5SDimitry Andric #define __itt_thread_ignore()
5460b57cec5SDimitry Andric #define __itt_thread_ignore_ptr 0
5470b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
5480b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
5490b57cec5SDimitry Andric #define __itt_thread_ignore_ptr 0
5500b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
5510b57cec5SDimitry Andric /** @endcond */
5520b57cec5SDimitry Andric /** @} threads group */
5530b57cec5SDimitry Andric 
5540b57cec5SDimitry Andric /**
5550b57cec5SDimitry Andric  * @defgroup suppress Error suppression
5560b57cec5SDimitry Andric  * @ingroup public
5570b57cec5SDimitry Andric  * General behavior: application continues to run, but errors are suppressed
5580b57cec5SDimitry Andric  *
5590b57cec5SDimitry Andric  * @{
5600b57cec5SDimitry Andric  */
5610b57cec5SDimitry Andric 
562349cc55cSDimitry Andric /*********************************************************************
5630b57cec5SDimitry Andric  * @name group of functions used for error suppression in correctness tools
5640b57cec5SDimitry Andric  *********************************************************************/
5650b57cec5SDimitry Andric /** @{ */
5660b57cec5SDimitry Andric /**
5670b57cec5SDimitry Andric  * @hideinitializer
5680b57cec5SDimitry Andric  * @brief possible value for suppression mask
5690b57cec5SDimitry Andric  */
5700b57cec5SDimitry Andric #define __itt_suppress_all_errors 0x7fffffff
5710b57cec5SDimitry Andric 
5720b57cec5SDimitry Andric /**
5730b57cec5SDimitry Andric  * @hideinitializer
574fe6060f1SDimitry Andric  * @brief possible value for suppression mask (suppresses errors from threading
575fe6060f1SDimitry Andric  * analysis)
5760b57cec5SDimitry Andric  */
5770b57cec5SDimitry Andric #define __itt_suppress_threading_errors 0x000000ff
5780b57cec5SDimitry Andric 
5790b57cec5SDimitry Andric /**
5800b57cec5SDimitry Andric  * @hideinitializer
581fe6060f1SDimitry Andric  * @brief possible value for suppression mask (suppresses errors from memory
582fe6060f1SDimitry Andric  * analysis)
5830b57cec5SDimitry Andric  */
5840b57cec5SDimitry Andric #define __itt_suppress_memory_errors 0x0000ff00
5850b57cec5SDimitry Andric 
5860b57cec5SDimitry Andric /**
5870b57cec5SDimitry Andric  * @brief Start suppressing errors identified in mask on this thread
5880b57cec5SDimitry Andric  */
5890b57cec5SDimitry Andric void ITTAPI __itt_suppress_push(unsigned int mask);
5900b57cec5SDimitry Andric 
5910b57cec5SDimitry Andric /** @cond exclude_from_documentation */
5920b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
5930b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
5940b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask))
5950b57cec5SDimitry Andric #define __itt_suppress_push ITTNOTIFY_VOID(suppress_push)
5960b57cec5SDimitry Andric #define __itt_suppress_push_ptr ITTNOTIFY_NAME(suppress_push)
5970b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
5980b57cec5SDimitry Andric #define __itt_suppress_push(mask)
5990b57cec5SDimitry Andric #define __itt_suppress_push_ptr 0
6000b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
6010b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
6020b57cec5SDimitry Andric #define __itt_suppress_push_ptr 0
6030b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
6040b57cec5SDimitry Andric /** @endcond */
6050b57cec5SDimitry Andric 
6060b57cec5SDimitry Andric /**
6070b57cec5SDimitry Andric  * @brief Undo the effects of the matching call to __itt_suppress_push
6080b57cec5SDimitry Andric  */
6090b57cec5SDimitry Andric void ITTAPI __itt_suppress_pop(void);
6100b57cec5SDimitry Andric 
6110b57cec5SDimitry Andric /** @cond exclude_from_documentation */
6120b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
6130b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
6140b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, suppress_pop, (void))
6150b57cec5SDimitry Andric #define __itt_suppress_pop ITTNOTIFY_VOID(suppress_pop)
6160b57cec5SDimitry Andric #define __itt_suppress_pop_ptr ITTNOTIFY_NAME(suppress_pop)
6170b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
6180b57cec5SDimitry Andric #define __itt_suppress_pop()
6190b57cec5SDimitry Andric #define __itt_suppress_pop_ptr 0
6200b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
6210b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
6220b57cec5SDimitry Andric #define __itt_suppress_pop_ptr 0
6230b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
6240b57cec5SDimitry Andric /** @endcond */
6250b57cec5SDimitry Andric 
6260b57cec5SDimitry Andric /**
6270b57cec5SDimitry Andric  * @enum __itt_model_disable
6280b57cec5SDimitry Andric  * @brief Enumerator for the disable methods
6290b57cec5SDimitry Andric  */
6300b57cec5SDimitry Andric typedef enum __itt_suppress_mode {
6310b57cec5SDimitry Andric   __itt_unsuppress_range,
6320b57cec5SDimitry Andric   __itt_suppress_range
6330b57cec5SDimitry Andric } __itt_suppress_mode_t;
6340b57cec5SDimitry Andric 
6350b57cec5SDimitry Andric /**
636fe6060f1SDimitry Andric  * @brief Mark a range of memory for error suppression or unsuppression for
637fe6060f1SDimitry Andric  * error types included in mask
6380b57cec5SDimitry Andric  */
639fe6060f1SDimitry Andric void ITTAPI __itt_suppress_mark_range(__itt_suppress_mode_t mode,
640fe6060f1SDimitry Andric                                       unsigned int mask, void *address,
641fe6060f1SDimitry Andric                                       size_t size);
6420b57cec5SDimitry Andric 
6430b57cec5SDimitry Andric /** @cond exclude_from_documentation */
6440b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
6450b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
646fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, suppress_mark_range,
647fe6060f1SDimitry Andric           (__itt_suppress_mode_t mode, unsigned int mask, void *address,
648fe6060f1SDimitry Andric            size_t size))
6490b57cec5SDimitry Andric #define __itt_suppress_mark_range ITTNOTIFY_VOID(suppress_mark_range)
6500b57cec5SDimitry Andric #define __itt_suppress_mark_range_ptr ITTNOTIFY_NAME(suppress_mark_range)
6510b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
6520b57cec5SDimitry Andric #define __itt_suppress_mark_range(mask)
6530b57cec5SDimitry Andric #define __itt_suppress_mark_range_ptr 0
6540b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
6550b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
6560b57cec5SDimitry Andric #define __itt_suppress_mark_range_ptr 0
6570b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
6580b57cec5SDimitry Andric /** @endcond */
6590b57cec5SDimitry Andric 
6600b57cec5SDimitry Andric /**
661fe6060f1SDimitry Andric  * @brief Undo the effect of a matching call to __itt_suppress_mark_range.   If
662fe6060f1SDimitry Andric  * not matching call is found, nothing is changed.
6630b57cec5SDimitry Andric  */
664fe6060f1SDimitry Andric void ITTAPI __itt_suppress_clear_range(__itt_suppress_mode_t mode,
665fe6060f1SDimitry Andric                                        unsigned int mask, void *address,
666fe6060f1SDimitry Andric                                        size_t size);
6670b57cec5SDimitry Andric 
6680b57cec5SDimitry Andric /** @cond exclude_from_documentation */
6690b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
6700b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
671fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, suppress_clear_range,
672fe6060f1SDimitry Andric           (__itt_suppress_mode_t mode, unsigned int mask, void *address,
673fe6060f1SDimitry Andric            size_t size))
6740b57cec5SDimitry Andric #define __itt_suppress_clear_range ITTNOTIFY_VOID(suppress_clear_range)
6750b57cec5SDimitry Andric #define __itt_suppress_clear_range_ptr ITTNOTIFY_NAME(suppress_clear_range)
6760b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
6770b57cec5SDimitry Andric #define __itt_suppress_clear_range(mask)
6780b57cec5SDimitry Andric #define __itt_suppress_clear_range_ptr 0
6790b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
6800b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
6810b57cec5SDimitry Andric #define __itt_suppress_clear_range_ptr 0
6820b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
6830b57cec5SDimitry Andric /** @endcond */
6840b57cec5SDimitry Andric /** @} */
6850b57cec5SDimitry Andric /** @} suppress group */
6860b57cec5SDimitry Andric 
6870b57cec5SDimitry Andric /**
6880b57cec5SDimitry Andric  * @defgroup sync Synchronization
6890b57cec5SDimitry Andric  * @ingroup public
6900b57cec5SDimitry Andric  * Indicate user-written synchronization code
6910b57cec5SDimitry Andric  * @{
6920b57cec5SDimitry Andric  */
6930b57cec5SDimitry Andric /**
6940b57cec5SDimitry Andric  * @hideinitializer
6950b57cec5SDimitry Andric  * @brief possible value of attribute argument for sync object type
6960b57cec5SDimitry Andric  */
6970b57cec5SDimitry Andric #define __itt_attr_barrier 1
6980b57cec5SDimitry Andric 
6990b57cec5SDimitry Andric /**
7000b57cec5SDimitry Andric  * @hideinitializer
7010b57cec5SDimitry Andric  * @brief possible value of attribute argument for sync object type
7020b57cec5SDimitry Andric  */
7030b57cec5SDimitry Andric #define __itt_attr_mutex 2
7040b57cec5SDimitry Andric 
7050b57cec5SDimitry Andric /**
7060b57cec5SDimitry Andric @brief Name a synchronization object
7070b57cec5SDimitry Andric @param[in] addr       Handle for the synchronization object. You should
7080b57cec5SDimitry Andric use a real address to uniquely identify the synchronization object.
7090b57cec5SDimitry Andric @param[in] objtype    null-terminated object type string. If NULL is
7100b57cec5SDimitry Andric passed, the name will be "User Synchronization".
7110b57cec5SDimitry Andric @param[in] objname    null-terminated object name string. If NULL,
7120b57cec5SDimitry Andric no name will be assigned to the object.
7130b57cec5SDimitry Andric @param[in] attribute  one of [#__itt_attr_barrier, #__itt_attr_mutex]
7140b57cec5SDimitry Andric  */
7150b57cec5SDimitry Andric 
7160b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
717fe6060f1SDimitry Andric void ITTAPI __itt_sync_createA(void *addr, const char *objtype,
718fe6060f1SDimitry Andric                                const char *objname, int attribute);
719fe6060f1SDimitry Andric void ITTAPI __itt_sync_createW(void *addr, const wchar_t *objtype,
720fe6060f1SDimitry Andric                                const wchar_t *objname, int attribute);
7210b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
7220b57cec5SDimitry Andric #define __itt_sync_create __itt_sync_createW
7230b57cec5SDimitry Andric #define __itt_sync_create_ptr __itt_sync_createW_ptr
7240b57cec5SDimitry Andric #else /* UNICODE */
7250b57cec5SDimitry Andric #define __itt_sync_create __itt_sync_createA
7260b57cec5SDimitry Andric #define __itt_sync_create_ptr __itt_sync_createA_ptr
7270b57cec5SDimitry Andric #endif /* UNICODE */
7280b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
729fe6060f1SDimitry Andric void ITTAPI __itt_sync_create(void *addr, const char *objtype,
730fe6060f1SDimitry Andric                               const char *objname, int attribute);
7310b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7320b57cec5SDimitry Andric 
7330b57cec5SDimitry Andric /** @cond exclude_from_documentation */
7340b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
7350b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
7360b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
737fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, sync_createA,
738fe6060f1SDimitry Andric           (void *addr, const char *objtype, const char *objname, int attribute))
739fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, sync_createW,
740fe6060f1SDimitry Andric           (void *addr, const wchar_t *objtype, const wchar_t *objname,
741fe6060f1SDimitry Andric            int attribute))
7420b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
743fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, sync_create,
744fe6060f1SDimitry Andric           (void *addr, const char *objtype, const char *objname, int attribute))
7450b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7460b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
7470b57cec5SDimitry Andric #define __itt_sync_createA ITTNOTIFY_VOID(sync_createA)
7480b57cec5SDimitry Andric #define __itt_sync_createA_ptr ITTNOTIFY_NAME(sync_createA)
7490b57cec5SDimitry Andric #define __itt_sync_createW ITTNOTIFY_VOID(sync_createW)
7500b57cec5SDimitry Andric #define __itt_sync_createW_ptr ITTNOTIFY_NAME(sync_createW)
7510b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7520b57cec5SDimitry Andric #define __itt_sync_create ITTNOTIFY_VOID(sync_create)
7530b57cec5SDimitry Andric #define __itt_sync_create_ptr ITTNOTIFY_NAME(sync_create)
7540b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7550b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
7560b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
7570b57cec5SDimitry Andric #define __itt_sync_createA(addr, objtype, objname, attribute)
7580b57cec5SDimitry Andric #define __itt_sync_createA_ptr 0
7590b57cec5SDimitry Andric #define __itt_sync_createW(addr, objtype, objname, attribute)
7600b57cec5SDimitry Andric #define __itt_sync_createW_ptr 0
7610b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7620b57cec5SDimitry Andric #define __itt_sync_create(addr, objtype, objname, attribute)
7630b57cec5SDimitry Andric #define __itt_sync_create_ptr 0
7640b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7650b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
7660b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
7670b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
7680b57cec5SDimitry Andric #define __itt_sync_createA_ptr 0
7690b57cec5SDimitry Andric #define __itt_sync_createW_ptr 0
7700b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7710b57cec5SDimitry Andric #define __itt_sync_create_ptr 0
7720b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7730b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
7740b57cec5SDimitry Andric /** @endcond */
7750b57cec5SDimitry Andric 
7760b57cec5SDimitry Andric /**
7770b57cec5SDimitry Andric @brief Rename a synchronization object
7780b57cec5SDimitry Andric 
7790b57cec5SDimitry Andric You can use the rename call to assign or reassign a name to a given
7800b57cec5SDimitry Andric synchronization object.
7810b57cec5SDimitry Andric @param[in] addr  handle for the synchronization object.
7820b57cec5SDimitry Andric @param[in] name  null-terminated object name string.
7830b57cec5SDimitry Andric */
7840b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
7850b57cec5SDimitry Andric void ITTAPI __itt_sync_renameA(void *addr, const char *name);
7860b57cec5SDimitry Andric void ITTAPI __itt_sync_renameW(void *addr, const wchar_t *name);
7870b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
7880b57cec5SDimitry Andric #define __itt_sync_rename __itt_sync_renameW
7890b57cec5SDimitry Andric #define __itt_sync_rename_ptr __itt_sync_renameW_ptr
7900b57cec5SDimitry Andric #else /* UNICODE */
7910b57cec5SDimitry Andric #define __itt_sync_rename __itt_sync_renameA
7920b57cec5SDimitry Andric #define __itt_sync_rename_ptr __itt_sync_renameA_ptr
7930b57cec5SDimitry Andric #endif /* UNICODE */
7940b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7950b57cec5SDimitry Andric void ITTAPI __itt_sync_rename(void *addr, const char *name);
7960b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
7970b57cec5SDimitry Andric 
7980b57cec5SDimitry Andric /** @cond exclude_from_documentation */
7990b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
8000b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
8010b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
8020b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name))
8030b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name))
8040b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8050b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name))
8060b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8070b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
8080b57cec5SDimitry Andric #define __itt_sync_renameA ITTNOTIFY_VOID(sync_renameA)
8090b57cec5SDimitry Andric #define __itt_sync_renameA_ptr ITTNOTIFY_NAME(sync_renameA)
8100b57cec5SDimitry Andric #define __itt_sync_renameW ITTNOTIFY_VOID(sync_renameW)
8110b57cec5SDimitry Andric #define __itt_sync_renameW_ptr ITTNOTIFY_NAME(sync_renameW)
8120b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8130b57cec5SDimitry Andric #define __itt_sync_rename ITTNOTIFY_VOID(sync_rename)
8140b57cec5SDimitry Andric #define __itt_sync_rename_ptr ITTNOTIFY_NAME(sync_rename)
8150b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8160b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
8170b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
8180b57cec5SDimitry Andric #define __itt_sync_renameA(addr, name)
8190b57cec5SDimitry Andric #define __itt_sync_renameA_ptr 0
8200b57cec5SDimitry Andric #define __itt_sync_renameW(addr, name)
8210b57cec5SDimitry Andric #define __itt_sync_renameW_ptr 0
8220b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8230b57cec5SDimitry Andric #define __itt_sync_rename(addr, name)
8240b57cec5SDimitry Andric #define __itt_sync_rename_ptr 0
8250b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8260b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
8270b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
8280b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
8290b57cec5SDimitry Andric #define __itt_sync_renameA_ptr 0
8300b57cec5SDimitry Andric #define __itt_sync_renameW_ptr 0
8310b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8320b57cec5SDimitry Andric #define __itt_sync_rename_ptr 0
8330b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
8340b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
8350b57cec5SDimitry Andric /** @endcond */
8360b57cec5SDimitry Andric 
8370b57cec5SDimitry Andric /**
8380b57cec5SDimitry Andric  @brief Destroy a synchronization object.
8390b57cec5SDimitry Andric  @param addr Handle for the synchronization object.
8400b57cec5SDimitry Andric  */
8410b57cec5SDimitry Andric void ITTAPI __itt_sync_destroy(void *addr);
8420b57cec5SDimitry Andric 
8430b57cec5SDimitry Andric /** @cond exclude_from_documentation */
8440b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
8450b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
8460b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr))
8470b57cec5SDimitry Andric #define __itt_sync_destroy ITTNOTIFY_VOID(sync_destroy)
8480b57cec5SDimitry Andric #define __itt_sync_destroy_ptr ITTNOTIFY_NAME(sync_destroy)
8490b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
8500b57cec5SDimitry Andric #define __itt_sync_destroy(addr)
8510b57cec5SDimitry Andric #define __itt_sync_destroy_ptr 0
8520b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
8530b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
8540b57cec5SDimitry Andric #define __itt_sync_destroy_ptr 0
8550b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
8560b57cec5SDimitry Andric /** @endcond */
8570b57cec5SDimitry Andric 
858349cc55cSDimitry Andric /*********************************************************************
8590b57cec5SDimitry Andric  * @name group of functions is used for performance measurement tools
8600b57cec5SDimitry Andric  *********************************************************************/
8610b57cec5SDimitry Andric /** @{ */
8620b57cec5SDimitry Andric /**
8630b57cec5SDimitry Andric  * @brief Enter spin loop on user-defined sync object
8640b57cec5SDimitry Andric  */
8650b57cec5SDimitry Andric void ITTAPI __itt_sync_prepare(void *addr);
8660b57cec5SDimitry Andric 
8670b57cec5SDimitry Andric /** @cond exclude_from_documentation */
8680b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
8690b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
8700b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_prepare, (void *addr))
8710b57cec5SDimitry Andric #define __itt_sync_prepare ITTNOTIFY_VOID(sync_prepare)
8720b57cec5SDimitry Andric #define __itt_sync_prepare_ptr ITTNOTIFY_NAME(sync_prepare)
8730b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
8740b57cec5SDimitry Andric #define __itt_sync_prepare(addr)
8750b57cec5SDimitry Andric #define __itt_sync_prepare_ptr 0
8760b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
8770b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
8780b57cec5SDimitry Andric #define __itt_sync_prepare_ptr 0
8790b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
8800b57cec5SDimitry Andric /** @endcond */
8810b57cec5SDimitry Andric 
8820b57cec5SDimitry Andric /**
8830b57cec5SDimitry Andric  * @brief Quit spin loop without acquiring spin object
8840b57cec5SDimitry Andric  */
8850b57cec5SDimitry Andric void ITTAPI __itt_sync_cancel(void *addr);
8860b57cec5SDimitry Andric 
8870b57cec5SDimitry Andric /** @cond exclude_from_documentation */
8880b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
8890b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
8900b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr))
8910b57cec5SDimitry Andric #define __itt_sync_cancel ITTNOTIFY_VOID(sync_cancel)
8920b57cec5SDimitry Andric #define __itt_sync_cancel_ptr ITTNOTIFY_NAME(sync_cancel)
8930b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
8940b57cec5SDimitry Andric #define __itt_sync_cancel(addr)
8950b57cec5SDimitry Andric #define __itt_sync_cancel_ptr 0
8960b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
8970b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
8980b57cec5SDimitry Andric #define __itt_sync_cancel_ptr 0
8990b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
9000b57cec5SDimitry Andric /** @endcond */
9010b57cec5SDimitry Andric 
9020b57cec5SDimitry Andric /**
9030b57cec5SDimitry Andric  * @brief Successful spin loop completion (sync object acquired)
9040b57cec5SDimitry Andric  */
9050b57cec5SDimitry Andric void ITTAPI __itt_sync_acquired(void *addr);
9060b57cec5SDimitry Andric 
9070b57cec5SDimitry Andric /** @cond exclude_from_documentation */
9080b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
9090b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
9100b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr))
9110b57cec5SDimitry Andric #define __itt_sync_acquired ITTNOTIFY_VOID(sync_acquired)
9120b57cec5SDimitry Andric #define __itt_sync_acquired_ptr ITTNOTIFY_NAME(sync_acquired)
9130b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
9140b57cec5SDimitry Andric #define __itt_sync_acquired(addr)
9150b57cec5SDimitry Andric #define __itt_sync_acquired_ptr 0
9160b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
9170b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
9180b57cec5SDimitry Andric #define __itt_sync_acquired_ptr 0
9190b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
9200b57cec5SDimitry Andric /** @endcond */
9210b57cec5SDimitry Andric 
9220b57cec5SDimitry Andric /**
923fe6060f1SDimitry Andric  * @brief Start sync object releasing code. Is called before the lock release
924fe6060f1SDimitry Andric  * call.
9250b57cec5SDimitry Andric  */
9260b57cec5SDimitry Andric void ITTAPI __itt_sync_releasing(void *addr);
9270b57cec5SDimitry Andric 
9280b57cec5SDimitry Andric /** @cond exclude_from_documentation */
9290b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
9300b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
9310b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, sync_releasing, (void *addr))
9320b57cec5SDimitry Andric #define __itt_sync_releasing ITTNOTIFY_VOID(sync_releasing)
9330b57cec5SDimitry Andric #define __itt_sync_releasing_ptr ITTNOTIFY_NAME(sync_releasing)
9340b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
9350b57cec5SDimitry Andric #define __itt_sync_releasing(addr)
9360b57cec5SDimitry Andric #define __itt_sync_releasing_ptr 0
9370b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
9380b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
9390b57cec5SDimitry Andric #define __itt_sync_releasing_ptr 0
9400b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
9410b57cec5SDimitry Andric /** @endcond */
9420b57cec5SDimitry Andric /** @} */
9430b57cec5SDimitry Andric 
9440b57cec5SDimitry Andric /** @} sync group */
9450b57cec5SDimitry Andric 
946349cc55cSDimitry Andric /******************************************************************
9470b57cec5SDimitry Andric  * @name group of functions is used for correctness checking tools
9480b57cec5SDimitry Andric  ******************************************************************/
9490b57cec5SDimitry Andric /** @{ */
9500b57cec5SDimitry Andric /**
9510b57cec5SDimitry Andric  * @ingroup legacy
9520b57cec5SDimitry Andric  * @deprecated Legacy API
9530b57cec5SDimitry Andric  * @brief Fast synchronization which does no require spinning.
954fe6060f1SDimitry Andric  * - This special function is to be used by TBB and OpenMP libraries only when
955fe6060f1SDimitry Andric  * they know there is no spin but they need to suppress TC warnings about shared
956fe6060f1SDimitry Andric  * variable modifications.
957fe6060f1SDimitry Andric  * - It only has corresponding pointers in static library and does not have
958fe6060f1SDimitry Andric  * corresponding function in dynamic library.
9590b57cec5SDimitry Andric  * @see void __itt_sync_prepare(void* addr);
9600b57cec5SDimitry Andric  */
9610b57cec5SDimitry Andric void ITTAPI __itt_fsync_prepare(void *addr);
9620b57cec5SDimitry Andric 
9630b57cec5SDimitry Andric /** @cond exclude_from_documentation */
9640b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
9650b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
9660b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, fsync_prepare, (void *addr))
9670b57cec5SDimitry Andric #define __itt_fsync_prepare ITTNOTIFY_VOID(fsync_prepare)
9680b57cec5SDimitry Andric #define __itt_fsync_prepare_ptr ITTNOTIFY_NAME(fsync_prepare)
9690b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
9700b57cec5SDimitry Andric #define __itt_fsync_prepare(addr)
9710b57cec5SDimitry Andric #define __itt_fsync_prepare_ptr 0
9720b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
9730b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
9740b57cec5SDimitry Andric #define __itt_fsync_prepare_ptr 0
9750b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
9760b57cec5SDimitry Andric /** @endcond */
9770b57cec5SDimitry Andric 
9780b57cec5SDimitry Andric /**
9790b57cec5SDimitry Andric  * @ingroup legacy
9800b57cec5SDimitry Andric  * @deprecated Legacy API
9810b57cec5SDimitry Andric  * @brief Fast synchronization which does no require spinning.
982fe6060f1SDimitry Andric  * - This special function is to be used by TBB and OpenMP libraries only when
983fe6060f1SDimitry Andric  * they know there is no spin but they need to suppress TC warnings about shared
984fe6060f1SDimitry Andric  * variable modifications.
985fe6060f1SDimitry Andric  * - It only has corresponding pointers in static library and does not have
986fe6060f1SDimitry Andric  * corresponding function in dynamic library.
9870b57cec5SDimitry Andric  * @see void __itt_sync_cancel(void *addr);
9880b57cec5SDimitry Andric  */
9890b57cec5SDimitry Andric void ITTAPI __itt_fsync_cancel(void *addr);
9900b57cec5SDimitry Andric 
9910b57cec5SDimitry Andric /** @cond exclude_from_documentation */
9920b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
9930b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
9940b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr))
9950b57cec5SDimitry Andric #define __itt_fsync_cancel ITTNOTIFY_VOID(fsync_cancel)
9960b57cec5SDimitry Andric #define __itt_fsync_cancel_ptr ITTNOTIFY_NAME(fsync_cancel)
9970b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
9980b57cec5SDimitry Andric #define __itt_fsync_cancel(addr)
9990b57cec5SDimitry Andric #define __itt_fsync_cancel_ptr 0
10000b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
10010b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
10020b57cec5SDimitry Andric #define __itt_fsync_cancel_ptr 0
10030b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
10040b57cec5SDimitry Andric /** @endcond */
10050b57cec5SDimitry Andric 
10060b57cec5SDimitry Andric /**
10070b57cec5SDimitry Andric  * @ingroup legacy
10080b57cec5SDimitry Andric  * @deprecated Legacy API
10090b57cec5SDimitry Andric  * @brief Fast synchronization which does no require spinning.
1010fe6060f1SDimitry Andric  * - This special function is to be used by TBB and OpenMP libraries only when
1011fe6060f1SDimitry Andric  * they know there is no spin but they need to suppress TC warnings about shared
1012fe6060f1SDimitry Andric  * variable modifications.
1013fe6060f1SDimitry Andric  * - It only has corresponding pointers in static library and does not have
1014fe6060f1SDimitry Andric  * corresponding function in dynamic library.
10150b57cec5SDimitry Andric  * @see void __itt_sync_acquired(void *addr);
10160b57cec5SDimitry Andric  */
10170b57cec5SDimitry Andric void ITTAPI __itt_fsync_acquired(void *addr);
10180b57cec5SDimitry Andric 
10190b57cec5SDimitry Andric /** @cond exclude_from_documentation */
10200b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
10210b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
10220b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr))
10230b57cec5SDimitry Andric #define __itt_fsync_acquired ITTNOTIFY_VOID(fsync_acquired)
10240b57cec5SDimitry Andric #define __itt_fsync_acquired_ptr ITTNOTIFY_NAME(fsync_acquired)
10250b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
10260b57cec5SDimitry Andric #define __itt_fsync_acquired(addr)
10270b57cec5SDimitry Andric #define __itt_fsync_acquired_ptr 0
10280b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
10290b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
10300b57cec5SDimitry Andric #define __itt_fsync_acquired_ptr 0
10310b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
10320b57cec5SDimitry Andric /** @endcond */
10330b57cec5SDimitry Andric 
10340b57cec5SDimitry Andric /**
10350b57cec5SDimitry Andric  * @ingroup legacy
10360b57cec5SDimitry Andric  * @deprecated Legacy API
10370b57cec5SDimitry Andric  * @brief Fast synchronization which does no require spinning.
1038fe6060f1SDimitry Andric  * - This special function is to be used by TBB and OpenMP libraries only when
1039fe6060f1SDimitry Andric  * they know there is no spin but they need to suppress TC warnings about shared
1040fe6060f1SDimitry Andric  * variable modifications.
1041fe6060f1SDimitry Andric  * - It only has corresponding pointers in static library and does not have
1042fe6060f1SDimitry Andric  * corresponding function in dynamic library.
10430b57cec5SDimitry Andric  * @see void __itt_sync_releasing(void* addr);
10440b57cec5SDimitry Andric  */
10450b57cec5SDimitry Andric void ITTAPI __itt_fsync_releasing(void *addr);
10460b57cec5SDimitry Andric 
10470b57cec5SDimitry Andric /** @cond exclude_from_documentation */
10480b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
10490b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
10500b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, fsync_releasing, (void *addr))
10510b57cec5SDimitry Andric #define __itt_fsync_releasing ITTNOTIFY_VOID(fsync_releasing)
10520b57cec5SDimitry Andric #define __itt_fsync_releasing_ptr ITTNOTIFY_NAME(fsync_releasing)
10530b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
10540b57cec5SDimitry Andric #define __itt_fsync_releasing(addr)
10550b57cec5SDimitry Andric #define __itt_fsync_releasing_ptr 0
10560b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
10570b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
10580b57cec5SDimitry Andric #define __itt_fsync_releasing_ptr 0
10590b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
10600b57cec5SDimitry Andric /** @endcond */
10610b57cec5SDimitry Andric /** @} */
10620b57cec5SDimitry Andric 
10630b57cec5SDimitry Andric /**
10640b57cec5SDimitry Andric  * @defgroup model Modeling by Intel(R) Parallel Advisor
10650b57cec5SDimitry Andric  * @ingroup public
10660b57cec5SDimitry Andric  * This is the subset of itt used for modeling by Intel(R) Parallel Advisor.
10670b57cec5SDimitry Andric  * This API is called ONLY using annotate.h, by "Annotation" macros
10680b57cec5SDimitry Andric  * the user places in their sources during the parallelism modeling steps.
10690b57cec5SDimitry Andric  *
10700b57cec5SDimitry Andric  * site_begin/end and task_begin/end take the address of handle variables,
10710b57cec5SDimitry Andric  * which are writeable by the API.  Handles must be 0 initialized prior
10720b57cec5SDimitry Andric  * to the first call to begin, or may cause a run-time failure.
10730b57cec5SDimitry Andric  * The handles are initialized in a multi-thread safe way by the API if
10740b57cec5SDimitry Andric  * the handle is 0.  The commonly expected idiom is one static handle to
10750b57cec5SDimitry Andric  * identify a site or task.  If a site or task of the same name has already
10760b57cec5SDimitry Andric  * been started during this collection, the same handle MAY be returned,
10770b57cec5SDimitry Andric  * but is not required to be - it is unspecified if data merging is done
10780b57cec5SDimitry Andric  * based on name.  These routines also take an instance variable.  Like
10790b57cec5SDimitry Andric  * the lexical instance, these must be 0 initialized.  Unlike the lexical
10800b57cec5SDimitry Andric  * instance, this is used to track a single dynamic instance.
10810b57cec5SDimitry Andric  *
10820b57cec5SDimitry Andric  * API used by the Intel(R) Parallel Advisor to describe potential concurrency
10830b57cec5SDimitry Andric  * and related activities. User-added source annotations expand to calls
10840b57cec5SDimitry Andric  * to these procedures to enable modeling of a hypothetical concurrent
10850b57cec5SDimitry Andric  * execution serially.
10860b57cec5SDimitry Andric  * @{
10870b57cec5SDimitry Andric  */
10880b57cec5SDimitry Andric #if !defined(_ADVISOR_ANNOTATE_H_) || defined(ANNOTATE_EXPAND_NULL)
10890b57cec5SDimitry Andric 
10900b57cec5SDimitry Andric typedef void *__itt_model_site; /*!< @brief handle for lexical site     */
1091fe6060f1SDimitry Andric typedef void
1092fe6060f1SDimitry Andric     *__itt_model_site_instance; /*!< @brief handle for dynamic instance */
10930b57cec5SDimitry Andric typedef void *__itt_model_task; /*!< @brief handle for lexical site     */
1094fe6060f1SDimitry Andric typedef void
1095fe6060f1SDimitry Andric     *__itt_model_task_instance; /*!< @brief handle for dynamic instance */
10960b57cec5SDimitry Andric 
10970b57cec5SDimitry Andric /**
10980b57cec5SDimitry Andric  * @enum __itt_model_disable
10990b57cec5SDimitry Andric  * @brief Enumerator for the disable methods
11000b57cec5SDimitry Andric  */
11010b57cec5SDimitry Andric typedef enum {
11020b57cec5SDimitry Andric   __itt_model_disable_observation,
11030b57cec5SDimitry Andric   __itt_model_disable_collection
11040b57cec5SDimitry Andric } __itt_model_disable;
11050b57cec5SDimitry Andric 
11060b57cec5SDimitry Andric #endif /* !_ADVISOR_ANNOTATE_H_ || ANNOTATE_EXPAND_NULL */
11070b57cec5SDimitry Andric 
11080b57cec5SDimitry Andric /**
11090b57cec5SDimitry Andric  * @brief ANNOTATE_SITE_BEGIN/ANNOTATE_SITE_END support.
11100b57cec5SDimitry Andric  *
11110b57cec5SDimitry Andric  * site_begin/end model a potential concurrency site.
11120b57cec5SDimitry Andric  * site instances may be recursively nested with themselves.
11130b57cec5SDimitry Andric  * site_end exits the most recently started but unended site for the current
11140b57cec5SDimitry Andric  * thread.  The handle passed to end may be used to validate structure.
11150b57cec5SDimitry Andric  * Instances of a site encountered on different threads concurrently
11160b57cec5SDimitry Andric  * are considered completely distinct. If the site name for two different
11170b57cec5SDimitry Andric  * lexical sites match, it is unspecified whether they are treated as the
11180b57cec5SDimitry Andric  * same or different for data presentation.
11190b57cec5SDimitry Andric  */
1120fe6060f1SDimitry Andric void ITTAPI __itt_model_site_begin(__itt_model_site *site,
1121fe6060f1SDimitry Andric                                    __itt_model_site_instance *instance,
1122fe6060f1SDimitry Andric                                    const char *name);
11230b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
11240b57cec5SDimitry Andric void ITTAPI __itt_model_site_beginW(const wchar_t *name);
11250b57cec5SDimitry Andric #endif
11260b57cec5SDimitry Andric void ITTAPI __itt_model_site_beginA(const char *name);
11270b57cec5SDimitry Andric void ITTAPI __itt_model_site_beginAL(const char *name, size_t siteNameLen);
1128fe6060f1SDimitry Andric void ITTAPI __itt_model_site_end(__itt_model_site *site,
1129fe6060f1SDimitry Andric                                  __itt_model_site_instance *instance);
11300b57cec5SDimitry Andric void ITTAPI __itt_model_site_end_2(void);
11310b57cec5SDimitry Andric 
11320b57cec5SDimitry Andric /** @cond exclude_from_documentation */
11330b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
11340b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
1135fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, model_site_begin,
1136fe6060f1SDimitry Andric           (__itt_model_site * site, __itt_model_site_instance *instance,
1137fe6060f1SDimitry Andric            const char *name))
11380b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
11390b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name))
11400b57cec5SDimitry Andric #endif
11410b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name))
1142fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, model_site_beginAL,
1143fe6060f1SDimitry Andric           (const char *name, size_t siteNameLen))
1144fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, model_site_end,
1145fe6060f1SDimitry Andric           (__itt_model_site * site, __itt_model_site_instance *instance))
11460b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_site_end_2, (void))
11470b57cec5SDimitry Andric #define __itt_model_site_begin ITTNOTIFY_VOID(model_site_begin)
11480b57cec5SDimitry Andric #define __itt_model_site_begin_ptr ITTNOTIFY_NAME(model_site_begin)
11490b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
11500b57cec5SDimitry Andric #define __itt_model_site_beginW ITTNOTIFY_VOID(model_site_beginW)
11510b57cec5SDimitry Andric #define __itt_model_site_beginW_ptr ITTNOTIFY_NAME(model_site_beginW)
11520b57cec5SDimitry Andric #endif
11530b57cec5SDimitry Andric #define __itt_model_site_beginA ITTNOTIFY_VOID(model_site_beginA)
11540b57cec5SDimitry Andric #define __itt_model_site_beginA_ptr ITTNOTIFY_NAME(model_site_beginA)
11550b57cec5SDimitry Andric #define __itt_model_site_beginAL ITTNOTIFY_VOID(model_site_beginAL)
11560b57cec5SDimitry Andric #define __itt_model_site_beginAL_ptr ITTNOTIFY_NAME(model_site_beginAL)
11570b57cec5SDimitry Andric #define __itt_model_site_end ITTNOTIFY_VOID(model_site_end)
11580b57cec5SDimitry Andric #define __itt_model_site_end_ptr ITTNOTIFY_NAME(model_site_end)
11590b57cec5SDimitry Andric #define __itt_model_site_end_2 ITTNOTIFY_VOID(model_site_end_2)
11600b57cec5SDimitry Andric #define __itt_model_site_end_2_ptr ITTNOTIFY_NAME(model_site_end_2)
11610b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
11620b57cec5SDimitry Andric #define __itt_model_site_begin(site, instance, name)
11630b57cec5SDimitry Andric #define __itt_model_site_begin_ptr 0
11640b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
11650b57cec5SDimitry Andric #define __itt_model_site_beginW(name)
11660b57cec5SDimitry Andric #define __itt_model_site_beginW_ptr 0
11670b57cec5SDimitry Andric #endif
11680b57cec5SDimitry Andric #define __itt_model_site_beginA(name)
11690b57cec5SDimitry Andric #define __itt_model_site_beginA_ptr 0
11700b57cec5SDimitry Andric #define __itt_model_site_beginAL(name, siteNameLen)
11710b57cec5SDimitry Andric #define __itt_model_site_beginAL_ptr 0
11720b57cec5SDimitry Andric #define __itt_model_site_end(site, instance)
11730b57cec5SDimitry Andric #define __itt_model_site_end_ptr 0
11740b57cec5SDimitry Andric #define __itt_model_site_end_2()
11750b57cec5SDimitry Andric #define __itt_model_site_end_2_ptr 0
11760b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
11770b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
11780b57cec5SDimitry Andric #define __itt_model_site_begin_ptr 0
11790b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
11800b57cec5SDimitry Andric #define __itt_model_site_beginW_ptr 0
11810b57cec5SDimitry Andric #endif
11820b57cec5SDimitry Andric #define __itt_model_site_beginA_ptr 0
11830b57cec5SDimitry Andric #define __itt_model_site_beginAL_ptr 0
11840b57cec5SDimitry Andric #define __itt_model_site_end_ptr 0
11850b57cec5SDimitry Andric #define __itt_model_site_end_2_ptr 0
11860b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
11870b57cec5SDimitry Andric /** @endcond */
11880b57cec5SDimitry Andric 
11890b57cec5SDimitry Andric /**
11900b57cec5SDimitry Andric  * @brief ANNOTATE_TASK_BEGIN/ANNOTATE_TASK_END support
11910b57cec5SDimitry Andric  *
11920b57cec5SDimitry Andric  * task_begin/end model a potential task, which is contained within the most
11930b57cec5SDimitry Andric  * closely enclosing dynamic site.  task_end exits the most recently started
11940b57cec5SDimitry Andric  * but unended task.  The handle passed to end may be used to validate
11950b57cec5SDimitry Andric  * structure.  It is unspecified if bad dynamic nesting is detected.  If it
11960b57cec5SDimitry Andric  * is, it should be encoded in the resulting data collection.  The collector
11970b57cec5SDimitry Andric  * should not fail due to construct nesting issues, nor attempt to directly
11980b57cec5SDimitry Andric  * indicate the problem.
11990b57cec5SDimitry Andric  */
1200fe6060f1SDimitry Andric void ITTAPI __itt_model_task_begin(__itt_model_task *task,
1201fe6060f1SDimitry Andric                                    __itt_model_task_instance *instance,
1202fe6060f1SDimitry Andric                                    const char *name);
12030b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
12040b57cec5SDimitry Andric void ITTAPI __itt_model_task_beginW(const wchar_t *name);
12050b57cec5SDimitry Andric void ITTAPI __itt_model_iteration_taskW(const wchar_t *name);
12060b57cec5SDimitry Andric #endif
12070b57cec5SDimitry Andric void ITTAPI __itt_model_task_beginA(const char *name);
12080b57cec5SDimitry Andric void ITTAPI __itt_model_task_beginAL(const char *name, size_t taskNameLen);
12090b57cec5SDimitry Andric void ITTAPI __itt_model_iteration_taskA(const char *name);
12100b57cec5SDimitry Andric void ITTAPI __itt_model_iteration_taskAL(const char *name, size_t taskNameLen);
1211fe6060f1SDimitry Andric void ITTAPI __itt_model_task_end(__itt_model_task *task,
1212fe6060f1SDimitry Andric                                  __itt_model_task_instance *instance);
12130b57cec5SDimitry Andric void ITTAPI __itt_model_task_end_2(void);
12140b57cec5SDimitry Andric 
12150b57cec5SDimitry Andric /** @cond exclude_from_documentation */
12160b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
12170b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
1218fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, model_task_begin,
1219fe6060f1SDimitry Andric           (__itt_model_task * task, __itt_model_task_instance *instance,
1220fe6060f1SDimitry Andric            const char *name))
12210b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
12220b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name))
12230b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name))
12240b57cec5SDimitry Andric #endif
12250b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name))
1226fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, model_task_beginAL,
1227fe6060f1SDimitry Andric           (const char *name, size_t taskNameLen))
12280b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name))
1229fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, model_iteration_taskAL,
1230fe6060f1SDimitry Andric           (const char *name, size_t taskNameLen))
1231fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, model_task_end,
1232fe6060f1SDimitry Andric           (__itt_model_task * task, __itt_model_task_instance *instance))
12330b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_task_end_2, (void))
12340b57cec5SDimitry Andric #define __itt_model_task_begin ITTNOTIFY_VOID(model_task_begin)
12350b57cec5SDimitry Andric #define __itt_model_task_begin_ptr ITTNOTIFY_NAME(model_task_begin)
12360b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
12370b57cec5SDimitry Andric #define __itt_model_task_beginW ITTNOTIFY_VOID(model_task_beginW)
12380b57cec5SDimitry Andric #define __itt_model_task_beginW_ptr ITTNOTIFY_NAME(model_task_beginW)
12390b57cec5SDimitry Andric #define __itt_model_iteration_taskW ITTNOTIFY_VOID(model_iteration_taskW)
12400b57cec5SDimitry Andric #define __itt_model_iteration_taskW_ptr ITTNOTIFY_NAME(model_iteration_taskW)
12410b57cec5SDimitry Andric #endif
12420b57cec5SDimitry Andric #define __itt_model_task_beginA ITTNOTIFY_VOID(model_task_beginA)
12430b57cec5SDimitry Andric #define __itt_model_task_beginA_ptr ITTNOTIFY_NAME(model_task_beginA)
12440b57cec5SDimitry Andric #define __itt_model_task_beginAL ITTNOTIFY_VOID(model_task_beginAL)
12450b57cec5SDimitry Andric #define __itt_model_task_beginAL_ptr ITTNOTIFY_NAME(model_task_beginAL)
12460b57cec5SDimitry Andric #define __itt_model_iteration_taskA ITTNOTIFY_VOID(model_iteration_taskA)
12470b57cec5SDimitry Andric #define __itt_model_iteration_taskA_ptr ITTNOTIFY_NAME(model_iteration_taskA)
12480b57cec5SDimitry Andric #define __itt_model_iteration_taskAL ITTNOTIFY_VOID(model_iteration_taskAL)
12490b57cec5SDimitry Andric #define __itt_model_iteration_taskAL_ptr ITTNOTIFY_NAME(model_iteration_taskAL)
12500b57cec5SDimitry Andric #define __itt_model_task_end ITTNOTIFY_VOID(model_task_end)
12510b57cec5SDimitry Andric #define __itt_model_task_end_ptr ITTNOTIFY_NAME(model_task_end)
12520b57cec5SDimitry Andric #define __itt_model_task_end_2 ITTNOTIFY_VOID(model_task_end_2)
12530b57cec5SDimitry Andric #define __itt_model_task_end_2_ptr ITTNOTIFY_NAME(model_task_end_2)
12540b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
12550b57cec5SDimitry Andric #define __itt_model_task_begin(task, instance, name)
12560b57cec5SDimitry Andric #define __itt_model_task_begin_ptr 0
12570b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
12580b57cec5SDimitry Andric #define __itt_model_task_beginW(name)
12590b57cec5SDimitry Andric #define __itt_model_task_beginW_ptr 0
12600b57cec5SDimitry Andric #endif
12610b57cec5SDimitry Andric #define __itt_model_task_beginA(name)
12620b57cec5SDimitry Andric #define __itt_model_task_beginA_ptr 0
12630b57cec5SDimitry Andric #define __itt_model_task_beginAL(name, siteNameLen)
12640b57cec5SDimitry Andric #define __itt_model_task_beginAL_ptr 0
12650b57cec5SDimitry Andric #define __itt_model_iteration_taskA(name)
12660b57cec5SDimitry Andric #define __itt_model_iteration_taskA_ptr 0
12670b57cec5SDimitry Andric #define __itt_model_iteration_taskAL(name, siteNameLen)
12680b57cec5SDimitry Andric #define __itt_model_iteration_taskAL_ptr 0
12690b57cec5SDimitry Andric #define __itt_model_task_end(task, instance)
12700b57cec5SDimitry Andric #define __itt_model_task_end_ptr 0
12710b57cec5SDimitry Andric #define __itt_model_task_end_2()
12720b57cec5SDimitry Andric #define __itt_model_task_end_2_ptr 0
12730b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
12740b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
12750b57cec5SDimitry Andric #define __itt_model_task_begin_ptr 0
12760b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
12770b57cec5SDimitry Andric #define __itt_model_task_beginW_ptr 0
12780b57cec5SDimitry Andric #endif
12790b57cec5SDimitry Andric #define __itt_model_task_beginA_ptr 0
12800b57cec5SDimitry Andric #define __itt_model_task_beginAL_ptr 0
12810b57cec5SDimitry Andric #define __itt_model_iteration_taskA_ptr 0
12820b57cec5SDimitry Andric #define __itt_model_iteration_taskAL_ptr 0
12830b57cec5SDimitry Andric #define __itt_model_task_end_ptr 0
12840b57cec5SDimitry Andric #define __itt_model_task_end_2_ptr 0
12850b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
12860b57cec5SDimitry Andric /** @endcond */
12870b57cec5SDimitry Andric 
12880b57cec5SDimitry Andric /**
12890b57cec5SDimitry Andric  * @brief ANNOTATE_LOCK_ACQUIRE/ANNOTATE_LOCK_RELEASE support
12900b57cec5SDimitry Andric  *
12910b57cec5SDimitry Andric  * lock_acquire/release model a potential lock for both lockset and
12920b57cec5SDimitry Andric  * performance modeling.  Each unique address is modeled as a separate
12930b57cec5SDimitry Andric  * lock, with invalid addresses being valid lock IDs.  Specifically:
12940b57cec5SDimitry Andric  * no storage is accessed by the API at the specified address - it is only
12950b57cec5SDimitry Andric  * used for lock identification.  Lock acquires may be self-nested and are
12960b57cec5SDimitry Andric  * unlocked by a corresponding number of releases.
12970b57cec5SDimitry Andric  * (These closely correspond to __itt_sync_acquired/__itt_sync_releasing,
12980b57cec5SDimitry Andric  * but may not have identical semantics.)
12990b57cec5SDimitry Andric  */
13000b57cec5SDimitry Andric void ITTAPI __itt_model_lock_acquire(void *lock);
13010b57cec5SDimitry Andric void ITTAPI __itt_model_lock_acquire_2(void *lock);
13020b57cec5SDimitry Andric void ITTAPI __itt_model_lock_release(void *lock);
13030b57cec5SDimitry Andric void ITTAPI __itt_model_lock_release_2(void *lock);
13040b57cec5SDimitry Andric 
13050b57cec5SDimitry Andric /** @cond exclude_from_documentation */
13060b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
13070b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
13080b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock))
13090b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock))
13100b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock))
13110b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock))
13120b57cec5SDimitry Andric #define __itt_model_lock_acquire ITTNOTIFY_VOID(model_lock_acquire)
13130b57cec5SDimitry Andric #define __itt_model_lock_acquire_ptr ITTNOTIFY_NAME(model_lock_acquire)
13140b57cec5SDimitry Andric #define __itt_model_lock_acquire_2 ITTNOTIFY_VOID(model_lock_acquire_2)
13150b57cec5SDimitry Andric #define __itt_model_lock_acquire_2_ptr ITTNOTIFY_NAME(model_lock_acquire_2)
13160b57cec5SDimitry Andric #define __itt_model_lock_release ITTNOTIFY_VOID(model_lock_release)
13170b57cec5SDimitry Andric #define __itt_model_lock_release_ptr ITTNOTIFY_NAME(model_lock_release)
13180b57cec5SDimitry Andric #define __itt_model_lock_release_2 ITTNOTIFY_VOID(model_lock_release_2)
13190b57cec5SDimitry Andric #define __itt_model_lock_release_2_ptr ITTNOTIFY_NAME(model_lock_release_2)
13200b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
13210b57cec5SDimitry Andric #define __itt_model_lock_acquire(lock)
13220b57cec5SDimitry Andric #define __itt_model_lock_acquire_ptr 0
13230b57cec5SDimitry Andric #define __itt_model_lock_acquire_2(lock)
13240b57cec5SDimitry Andric #define __itt_model_lock_acquire_2_ptr 0
13250b57cec5SDimitry Andric #define __itt_model_lock_release(lock)
13260b57cec5SDimitry Andric #define __itt_model_lock_release_ptr 0
13270b57cec5SDimitry Andric #define __itt_model_lock_release_2(lock)
13280b57cec5SDimitry Andric #define __itt_model_lock_release_2_ptr 0
13290b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
13300b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
13310b57cec5SDimitry Andric #define __itt_model_lock_acquire_ptr 0
13320b57cec5SDimitry Andric #define __itt_model_lock_acquire_2_ptr 0
13330b57cec5SDimitry Andric #define __itt_model_lock_release_ptr 0
13340b57cec5SDimitry Andric #define __itt_model_lock_release_2_ptr 0
13350b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
13360b57cec5SDimitry Andric /** @endcond */
13370b57cec5SDimitry Andric 
13380b57cec5SDimitry Andric /**
13390b57cec5SDimitry Andric  * @brief ANNOTATE_RECORD_ALLOCATION/ANNOTATE_RECORD_DEALLOCATION support
13400b57cec5SDimitry Andric  *
13410b57cec5SDimitry Andric  * record_allocation/deallocation describe user-defined memory allocator
13420b57cec5SDimitry Andric  * behavior, which may be required for correctness modeling to understand
13430b57cec5SDimitry Andric  * when storage is not expected to be actually reused across threads.
13440b57cec5SDimitry Andric  */
13450b57cec5SDimitry Andric void ITTAPI __itt_model_record_allocation(void *addr, size_t size);
13460b57cec5SDimitry Andric void ITTAPI __itt_model_record_deallocation(void *addr);
13470b57cec5SDimitry Andric 
13480b57cec5SDimitry Andric /** @cond exclude_from_documentation */
13490b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
13500b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
13510b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size))
13520b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr))
13530b57cec5SDimitry Andric #define __itt_model_record_allocation ITTNOTIFY_VOID(model_record_allocation)
1354fe6060f1SDimitry Andric #define __itt_model_record_allocation_ptr                                      \
1355fe6060f1SDimitry Andric   ITTNOTIFY_NAME(model_record_allocation)
1356fe6060f1SDimitry Andric #define __itt_model_record_deallocation                                        \
1357fe6060f1SDimitry Andric   ITTNOTIFY_VOID(model_record_deallocation)
1358fe6060f1SDimitry Andric #define __itt_model_record_deallocation_ptr                                    \
1359fe6060f1SDimitry Andric   ITTNOTIFY_NAME(model_record_deallocation)
13600b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
13610b57cec5SDimitry Andric #define __itt_model_record_allocation(addr, size)
13620b57cec5SDimitry Andric #define __itt_model_record_allocation_ptr 0
13630b57cec5SDimitry Andric #define __itt_model_record_deallocation(addr)
13640b57cec5SDimitry Andric #define __itt_model_record_deallocation_ptr 0
13650b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
13660b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
13670b57cec5SDimitry Andric #define __itt_model_record_allocation_ptr 0
13680b57cec5SDimitry Andric #define __itt_model_record_deallocation_ptr 0
13690b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
13700b57cec5SDimitry Andric /** @endcond */
13710b57cec5SDimitry Andric 
13720b57cec5SDimitry Andric /**
13730b57cec5SDimitry Andric  * @brief ANNOTATE_INDUCTION_USES support
13740b57cec5SDimitry Andric  *
13750b57cec5SDimitry Andric  * Note particular storage is inductive through the end of the current site
13760b57cec5SDimitry Andric  */
13770b57cec5SDimitry Andric void ITTAPI __itt_model_induction_uses(void *addr, size_t size);
13780b57cec5SDimitry Andric 
13790b57cec5SDimitry Andric /** @cond exclude_from_documentation */
13800b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
13810b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
13820b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_induction_uses, (void *addr, size_t size))
13830b57cec5SDimitry Andric #define __itt_model_induction_uses ITTNOTIFY_VOID(model_induction_uses)
13840b57cec5SDimitry Andric #define __itt_model_induction_uses_ptr ITTNOTIFY_NAME(model_induction_uses)
13850b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
13860b57cec5SDimitry Andric #define __itt_model_induction_uses(addr, size)
13870b57cec5SDimitry Andric #define __itt_model_induction_uses_ptr 0
13880b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
13890b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
13900b57cec5SDimitry Andric #define __itt_model_induction_uses_ptr 0
13910b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
13920b57cec5SDimitry Andric /** @endcond */
13930b57cec5SDimitry Andric 
13940b57cec5SDimitry Andric /**
13950b57cec5SDimitry Andric  * @brief ANNOTATE_REDUCTION_USES support
13960b57cec5SDimitry Andric  *
13970b57cec5SDimitry Andric  * Note particular storage is used for reduction through the end
13980b57cec5SDimitry Andric  * of the current site
13990b57cec5SDimitry Andric  */
14000b57cec5SDimitry Andric void ITTAPI __itt_model_reduction_uses(void *addr, size_t size);
14010b57cec5SDimitry Andric 
14020b57cec5SDimitry Andric /** @cond exclude_from_documentation */
14030b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
14040b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
14050b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_reduction_uses, (void *addr, size_t size))
14060b57cec5SDimitry Andric #define __itt_model_reduction_uses ITTNOTIFY_VOID(model_reduction_uses)
14070b57cec5SDimitry Andric #define __itt_model_reduction_uses_ptr ITTNOTIFY_NAME(model_reduction_uses)
14080b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
14090b57cec5SDimitry Andric #define __itt_model_reduction_uses(addr, size)
14100b57cec5SDimitry Andric #define __itt_model_reduction_uses_ptr 0
14110b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
14120b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
14130b57cec5SDimitry Andric #define __itt_model_reduction_uses_ptr 0
14140b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
14150b57cec5SDimitry Andric /** @endcond */
14160b57cec5SDimitry Andric 
14170b57cec5SDimitry Andric /**
14180b57cec5SDimitry Andric  * @brief ANNOTATE_OBSERVE_USES support
14190b57cec5SDimitry Andric  *
14200b57cec5SDimitry Andric  * Have correctness modeling record observations about uses of storage
14210b57cec5SDimitry Andric  * through the end of the current site
14220b57cec5SDimitry Andric  */
14230b57cec5SDimitry Andric void ITTAPI __itt_model_observe_uses(void *addr, size_t size);
14240b57cec5SDimitry Andric 
14250b57cec5SDimitry Andric /** @cond exclude_from_documentation */
14260b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
14270b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
14280b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_observe_uses, (void *addr, size_t size))
14290b57cec5SDimitry Andric #define __itt_model_observe_uses ITTNOTIFY_VOID(model_observe_uses)
14300b57cec5SDimitry Andric #define __itt_model_observe_uses_ptr ITTNOTIFY_NAME(model_observe_uses)
14310b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
14320b57cec5SDimitry Andric #define __itt_model_observe_uses(addr, size)
14330b57cec5SDimitry Andric #define __itt_model_observe_uses_ptr 0
14340b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
14350b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
14360b57cec5SDimitry Andric #define __itt_model_observe_uses_ptr 0
14370b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
14380b57cec5SDimitry Andric /** @endcond */
14390b57cec5SDimitry Andric 
14400b57cec5SDimitry Andric /**
14410b57cec5SDimitry Andric  * @brief ANNOTATE_CLEAR_USES support
14420b57cec5SDimitry Andric  *
14430b57cec5SDimitry Andric  * Clear the special handling of a piece of storage related to induction,
14440b57cec5SDimitry Andric  * reduction or observe_uses
14450b57cec5SDimitry Andric  */
14460b57cec5SDimitry Andric void ITTAPI __itt_model_clear_uses(void *addr);
14470b57cec5SDimitry Andric 
14480b57cec5SDimitry Andric /** @cond exclude_from_documentation */
14490b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
14500b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
14510b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_clear_uses, (void *addr))
14520b57cec5SDimitry Andric #define __itt_model_clear_uses ITTNOTIFY_VOID(model_clear_uses)
14530b57cec5SDimitry Andric #define __itt_model_clear_uses_ptr ITTNOTIFY_NAME(model_clear_uses)
14540b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
14550b57cec5SDimitry Andric #define __itt_model_clear_uses(addr)
14560b57cec5SDimitry Andric #define __itt_model_clear_uses_ptr 0
14570b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
14580b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
14590b57cec5SDimitry Andric #define __itt_model_clear_uses_ptr 0
14600b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
14610b57cec5SDimitry Andric /** @endcond */
14620b57cec5SDimitry Andric 
14630b57cec5SDimitry Andric /**
14640b57cec5SDimitry Andric  * @brief ANNOTATE_DISABLE_*_PUSH/ANNOTATE_DISABLE_*_POP support
14650b57cec5SDimitry Andric  *
14660b57cec5SDimitry Andric  * disable_push/disable_pop push and pop disabling based on a parameter.
14670b57cec5SDimitry Andric  * Disabling observations stops processing of memory references during
14680b57cec5SDimitry Andric  * correctness modeling, and all annotations that occur in the disabled
14690b57cec5SDimitry Andric  * region.  This allows description of code that is expected to be handled
14700b57cec5SDimitry Andric  * specially during conversion to parallelism or that is not recognized
14710b57cec5SDimitry Andric  * by tools (e.g. some kinds of synchronization operations.)
14720b57cec5SDimitry Andric  * This mechanism causes all annotations in the disabled region, other
14730b57cec5SDimitry Andric  * than disable_push and disable_pop, to be ignored.  (For example, this
14740b57cec5SDimitry Andric  * might validly be used to disable an entire parallel site and the contained
14750b57cec5SDimitry Andric  * tasks and locking in it for data collection purposes.)
14760b57cec5SDimitry Andric  * The disable for collection is a more expensive operation, but reduces
14770b57cec5SDimitry Andric  * collector overhead significantly.  This applies to BOTH correctness data
14780b57cec5SDimitry Andric  * collection and performance data collection.  For example, a site
14790b57cec5SDimitry Andric  * containing a task might only enable data collection for the first 10
14800b57cec5SDimitry Andric  * iterations.  Both performance and correctness data should reflect this,
14810b57cec5SDimitry Andric  * and the program should run as close to full speed as possible when
14820b57cec5SDimitry Andric  * collection is disabled.
14830b57cec5SDimitry Andric  */
14840b57cec5SDimitry Andric void ITTAPI __itt_model_disable_push(__itt_model_disable x);
14850b57cec5SDimitry Andric void ITTAPI __itt_model_disable_pop(void);
14860b57cec5SDimitry Andric void ITTAPI __itt_model_aggregate_task(size_t x);
14870b57cec5SDimitry Andric 
14880b57cec5SDimitry Andric /** @cond exclude_from_documentation */
14890b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
14900b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
14910b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x))
14920b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_disable_pop, (void))
14930b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t x))
14940b57cec5SDimitry Andric #define __itt_model_disable_push ITTNOTIFY_VOID(model_disable_push)
14950b57cec5SDimitry Andric #define __itt_model_disable_push_ptr ITTNOTIFY_NAME(model_disable_push)
14960b57cec5SDimitry Andric #define __itt_model_disable_pop ITTNOTIFY_VOID(model_disable_pop)
14970b57cec5SDimitry Andric #define __itt_model_disable_pop_ptr ITTNOTIFY_NAME(model_disable_pop)
14980b57cec5SDimitry Andric #define __itt_model_aggregate_task ITTNOTIFY_VOID(model_aggregate_task)
14990b57cec5SDimitry Andric #define __itt_model_aggregate_task_ptr ITTNOTIFY_NAME(model_aggregate_task)
15000b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
15010b57cec5SDimitry Andric #define __itt_model_disable_push(x)
15020b57cec5SDimitry Andric #define __itt_model_disable_push_ptr 0
15030b57cec5SDimitry Andric #define __itt_model_disable_pop()
15040b57cec5SDimitry Andric #define __itt_model_disable_pop_ptr 0
15050b57cec5SDimitry Andric #define __itt_model_aggregate_task(x)
15060b57cec5SDimitry Andric #define __itt_model_aggregate_task_ptr 0
15070b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
15080b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
15090b57cec5SDimitry Andric #define __itt_model_disable_push_ptr 0
15100b57cec5SDimitry Andric #define __itt_model_disable_pop_ptr 0
15110b57cec5SDimitry Andric #define __itt_model_aggregate_task_ptr 0
15120b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
15130b57cec5SDimitry Andric /** @endcond */
15140b57cec5SDimitry Andric /** @} model group */
15150b57cec5SDimitry Andric 
15160b57cec5SDimitry Andric /**
15170b57cec5SDimitry Andric  * @defgroup heap Heap
15180b57cec5SDimitry Andric  * @ingroup public
15190b57cec5SDimitry Andric  * Heap group
15200b57cec5SDimitry Andric  * @{
15210b57cec5SDimitry Andric  */
15220b57cec5SDimitry Andric 
15230b57cec5SDimitry Andric typedef void *__itt_heap_function;
15240b57cec5SDimitry Andric 
15250b57cec5SDimitry Andric /**
15260b57cec5SDimitry Andric  * @brief Create an identification for heap function
15270b57cec5SDimitry Andric  * @return non-zero identifier or NULL
15280b57cec5SDimitry Andric  */
15290b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
1530fe6060f1SDimitry Andric __itt_heap_function ITTAPI __itt_heap_function_createA(const char *name,
1531fe6060f1SDimitry Andric                                                        const char *domain);
1532fe6060f1SDimitry Andric __itt_heap_function ITTAPI __itt_heap_function_createW(const wchar_t *name,
1533fe6060f1SDimitry Andric                                                        const wchar_t *domain);
15340b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
15350b57cec5SDimitry Andric #define __itt_heap_function_create __itt_heap_function_createW
15360b57cec5SDimitry Andric #define __itt_heap_function_create_ptr __itt_heap_function_createW_ptr
15370b57cec5SDimitry Andric #else
15380b57cec5SDimitry Andric #define __itt_heap_function_create __itt_heap_function_createA
15390b57cec5SDimitry Andric #define __itt_heap_function_create_ptr __itt_heap_function_createA_ptr
15400b57cec5SDimitry Andric #endif /* UNICODE */
15410b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1542fe6060f1SDimitry Andric __itt_heap_function ITTAPI __itt_heap_function_create(const char *name,
1543fe6060f1SDimitry Andric                                                       const char *domain);
15440b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15450b57cec5SDimitry Andric 
15460b57cec5SDimitry Andric /** @cond exclude_from_documentation */
15470b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
15480b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
15490b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
1550fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA,
1551fe6060f1SDimitry Andric          (const char *name, const char *domain))
1552fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW,
1553fe6060f1SDimitry Andric          (const wchar_t *name, const wchar_t *domain))
15540b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1555fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create,
1556fe6060f1SDimitry Andric          (const char *name, const char *domain))
15570b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15580b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
15590b57cec5SDimitry Andric #define __itt_heap_function_createA ITTNOTIFY_DATA(heap_function_createA)
15600b57cec5SDimitry Andric #define __itt_heap_function_createA_ptr ITTNOTIFY_NAME(heap_function_createA)
15610b57cec5SDimitry Andric #define __itt_heap_function_createW ITTNOTIFY_DATA(heap_function_createW)
15620b57cec5SDimitry Andric #define __itt_heap_function_createW_ptr ITTNOTIFY_NAME(heap_function_createW)
15630b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15640b57cec5SDimitry Andric #define __itt_heap_function_create ITTNOTIFY_DATA(heap_function_create)
15650b57cec5SDimitry Andric #define __itt_heap_function_create_ptr ITTNOTIFY_NAME(heap_function_create)
15660b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15670b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
15680b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
15690b57cec5SDimitry Andric #define __itt_heap_function_createA(name, domain) (__itt_heap_function)0
15700b57cec5SDimitry Andric #define __itt_heap_function_createA_ptr 0
15710b57cec5SDimitry Andric #define __itt_heap_function_createW(name, domain) (__itt_heap_function)0
15720b57cec5SDimitry Andric #define __itt_heap_function_createW_ptr 0
15730b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15740b57cec5SDimitry Andric #define __itt_heap_function_create(name, domain) (__itt_heap_function)0
15750b57cec5SDimitry Andric #define __itt_heap_function_create_ptr 0
15760b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15770b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
15780b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
15790b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
15800b57cec5SDimitry Andric #define __itt_heap_function_createA_ptr 0
15810b57cec5SDimitry Andric #define __itt_heap_function_createW_ptr 0
15820b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15830b57cec5SDimitry Andric #define __itt_heap_function_create_ptr 0
15840b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
15850b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
15860b57cec5SDimitry Andric /** @endcond */
15870b57cec5SDimitry Andric 
15880b57cec5SDimitry Andric /**
15890b57cec5SDimitry Andric  * @brief Record an allocation begin occurrence.
15900b57cec5SDimitry Andric  */
1591fe6060f1SDimitry Andric void ITTAPI __itt_heap_allocate_begin(__itt_heap_function h, size_t size,
1592fe6060f1SDimitry Andric                                       int initialized);
15930b57cec5SDimitry Andric 
15940b57cec5SDimitry Andric /** @cond exclude_from_documentation */
15950b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
15960b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
1597fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, heap_allocate_begin,
1598fe6060f1SDimitry Andric           (__itt_heap_function h, size_t size, int initialized))
15990b57cec5SDimitry Andric #define __itt_heap_allocate_begin ITTNOTIFY_VOID(heap_allocate_begin)
16000b57cec5SDimitry Andric #define __itt_heap_allocate_begin_ptr ITTNOTIFY_NAME(heap_allocate_begin)
16010b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
16020b57cec5SDimitry Andric #define __itt_heap_allocate_begin(h, size, initialized)
16030b57cec5SDimitry Andric #define __itt_heap_allocate_begin_ptr 0
16040b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
16050b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
16060b57cec5SDimitry Andric #define __itt_heap_allocate_begin_ptr 0
16070b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
16080b57cec5SDimitry Andric /** @endcond */
16090b57cec5SDimitry Andric 
16100b57cec5SDimitry Andric /**
16110b57cec5SDimitry Andric  * @brief Record an allocation end occurrence.
16120b57cec5SDimitry Andric  */
1613fe6060f1SDimitry Andric void ITTAPI __itt_heap_allocate_end(__itt_heap_function h, void **addr,
1614fe6060f1SDimitry Andric                                     size_t size, int initialized);
16150b57cec5SDimitry Andric 
16160b57cec5SDimitry Andric /** @cond exclude_from_documentation */
16170b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
16180b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
1619fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, heap_allocate_end,
1620fe6060f1SDimitry Andric           (__itt_heap_function h, void **addr, size_t size, int initialized))
16210b57cec5SDimitry Andric #define __itt_heap_allocate_end ITTNOTIFY_VOID(heap_allocate_end)
16220b57cec5SDimitry Andric #define __itt_heap_allocate_end_ptr ITTNOTIFY_NAME(heap_allocate_end)
16230b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
16240b57cec5SDimitry Andric #define __itt_heap_allocate_end(h, addr, size, initialized)
16250b57cec5SDimitry Andric #define __itt_heap_allocate_end_ptr 0
16260b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
16270b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
16280b57cec5SDimitry Andric #define __itt_heap_allocate_end_ptr 0
16290b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
16300b57cec5SDimitry Andric /** @endcond */
16310b57cec5SDimitry Andric 
16320b57cec5SDimitry Andric /**
1633480093f4SDimitry Andric  * @brief Record a free begin occurrence.
16340b57cec5SDimitry Andric  */
16350b57cec5SDimitry Andric void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void *addr);
16360b57cec5SDimitry Andric 
16370b57cec5SDimitry Andric /** @cond exclude_from_documentation */
16380b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
16390b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
16400b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void *addr))
16410b57cec5SDimitry Andric #define __itt_heap_free_begin ITTNOTIFY_VOID(heap_free_begin)
16420b57cec5SDimitry Andric #define __itt_heap_free_begin_ptr ITTNOTIFY_NAME(heap_free_begin)
16430b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
16440b57cec5SDimitry Andric #define __itt_heap_free_begin(h, addr)
16450b57cec5SDimitry Andric #define __itt_heap_free_begin_ptr 0
16460b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
16470b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
16480b57cec5SDimitry Andric #define __itt_heap_free_begin_ptr 0
16490b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
16500b57cec5SDimitry Andric /** @endcond */
16510b57cec5SDimitry Andric 
16520b57cec5SDimitry Andric /**
1653480093f4SDimitry Andric  * @brief Record a free end occurrence.
16540b57cec5SDimitry Andric  */
16550b57cec5SDimitry Andric void ITTAPI __itt_heap_free_end(__itt_heap_function h, void *addr);
16560b57cec5SDimitry Andric 
16570b57cec5SDimitry Andric /** @cond exclude_from_documentation */
16580b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
16590b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
16600b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void *addr))
16610b57cec5SDimitry Andric #define __itt_heap_free_end ITTNOTIFY_VOID(heap_free_end)
16620b57cec5SDimitry Andric #define __itt_heap_free_end_ptr ITTNOTIFY_NAME(heap_free_end)
16630b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
16640b57cec5SDimitry Andric #define __itt_heap_free_end(h, addr)
16650b57cec5SDimitry Andric #define __itt_heap_free_end_ptr 0
16660b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
16670b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
16680b57cec5SDimitry Andric #define __itt_heap_free_end_ptr 0
16690b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
16700b57cec5SDimitry Andric /** @endcond */
16710b57cec5SDimitry Andric 
16720b57cec5SDimitry Andric /**
1673480093f4SDimitry Andric  * @brief Record a reallocation begin occurrence.
16740b57cec5SDimitry Andric  */
1675fe6060f1SDimitry Andric void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void *addr,
1676fe6060f1SDimitry Andric                                         size_t new_size, int initialized);
16770b57cec5SDimitry Andric 
16780b57cec5SDimitry Andric /** @cond exclude_from_documentation */
16790b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
16800b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
1681fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, heap_reallocate_begin,
1682fe6060f1SDimitry Andric           (__itt_heap_function h, void *addr, size_t new_size, int initialized))
16830b57cec5SDimitry Andric #define __itt_heap_reallocate_begin ITTNOTIFY_VOID(heap_reallocate_begin)
16840b57cec5SDimitry Andric #define __itt_heap_reallocate_begin_ptr ITTNOTIFY_NAME(heap_reallocate_begin)
16850b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
16860b57cec5SDimitry Andric #define __itt_heap_reallocate_begin(h, addr, new_size, initialized)
16870b57cec5SDimitry Andric #define __itt_heap_reallocate_begin_ptr 0
16880b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
16890b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
16900b57cec5SDimitry Andric #define __itt_heap_reallocate_begin_ptr 0
16910b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
16920b57cec5SDimitry Andric /** @endcond */
16930b57cec5SDimitry Andric 
16940b57cec5SDimitry Andric /**
1695480093f4SDimitry Andric  * @brief Record a reallocation end occurrence.
16960b57cec5SDimitry Andric  */
1697fe6060f1SDimitry Andric void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void *addr,
1698fe6060f1SDimitry Andric                                       void **new_addr, size_t new_size,
1699fe6060f1SDimitry Andric                                       int initialized);
17000b57cec5SDimitry Andric 
17010b57cec5SDimitry Andric /** @cond exclude_from_documentation */
17020b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
17030b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
1704fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, heap_reallocate_end,
1705fe6060f1SDimitry Andric           (__itt_heap_function h, void *addr, void **new_addr, size_t new_size,
1706fe6060f1SDimitry Andric            int initialized))
17070b57cec5SDimitry Andric #define __itt_heap_reallocate_end ITTNOTIFY_VOID(heap_reallocate_end)
17080b57cec5SDimitry Andric #define __itt_heap_reallocate_end_ptr ITTNOTIFY_NAME(heap_reallocate_end)
17090b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
17100b57cec5SDimitry Andric #define __itt_heap_reallocate_end(h, addr, new_addr, new_size, initialized)
17110b57cec5SDimitry Andric #define __itt_heap_reallocate_end_ptr 0
17120b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
17130b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
17140b57cec5SDimitry Andric #define __itt_heap_reallocate_end_ptr 0
17150b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
17160b57cec5SDimitry Andric /** @endcond */
17170b57cec5SDimitry Andric 
17180b57cec5SDimitry Andric /** @brief internal access begin */
17190b57cec5SDimitry Andric void ITTAPI __itt_heap_internal_access_begin(void);
17200b57cec5SDimitry Andric 
17210b57cec5SDimitry Andric /** @cond exclude_from_documentation */
17220b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
17230b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
17240b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void))
1725fe6060f1SDimitry Andric #define __itt_heap_internal_access_begin                                       \
1726fe6060f1SDimitry Andric   ITTNOTIFY_VOID(heap_internal_access_begin)
1727fe6060f1SDimitry Andric #define __itt_heap_internal_access_begin_ptr                                   \
1728fe6060f1SDimitry Andric   ITTNOTIFY_NAME(heap_internal_access_begin)
17290b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
17300b57cec5SDimitry Andric #define __itt_heap_internal_access_begin()
17310b57cec5SDimitry Andric #define __itt_heap_internal_access_begin_ptr 0
17320b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
17330b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
17340b57cec5SDimitry Andric #define __itt_heap_internal_access_begin_ptr 0
17350b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
17360b57cec5SDimitry Andric /** @endcond */
17370b57cec5SDimitry Andric 
17380b57cec5SDimitry Andric /** @brief internal access end */
17390b57cec5SDimitry Andric void ITTAPI __itt_heap_internal_access_end(void);
17400b57cec5SDimitry Andric 
17410b57cec5SDimitry Andric /** @cond exclude_from_documentation */
17420b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
17430b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
17440b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void))
17450b57cec5SDimitry Andric #define __itt_heap_internal_access_end ITTNOTIFY_VOID(heap_internal_access_end)
1746fe6060f1SDimitry Andric #define __itt_heap_internal_access_end_ptr                                     \
1747fe6060f1SDimitry Andric   ITTNOTIFY_NAME(heap_internal_access_end)
17480b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
17490b57cec5SDimitry Andric #define __itt_heap_internal_access_end()
17500b57cec5SDimitry Andric #define __itt_heap_internal_access_end_ptr 0
17510b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
17520b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
17530b57cec5SDimitry Andric #define __itt_heap_internal_access_end_ptr 0
17540b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
17550b57cec5SDimitry Andric /** @endcond */
17560b57cec5SDimitry Andric 
17570b57cec5SDimitry Andric /** @brief record memory growth begin */
17580b57cec5SDimitry Andric void ITTAPI __itt_heap_record_memory_growth_begin(void);
17590b57cec5SDimitry Andric 
17600b57cec5SDimitry Andric /** @cond exclude_from_documentation */
17610b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
17620b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
17630b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void))
1764fe6060f1SDimitry Andric #define __itt_heap_record_memory_growth_begin                                  \
1765fe6060f1SDimitry Andric   ITTNOTIFY_VOID(heap_record_memory_growth_begin)
1766fe6060f1SDimitry Andric #define __itt_heap_record_memory_growth_begin_ptr                              \
1767fe6060f1SDimitry Andric   ITTNOTIFY_NAME(heap_record_memory_growth_begin)
17680b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
17690b57cec5SDimitry Andric #define __itt_heap_record_memory_growth_begin()
17700b57cec5SDimitry Andric #define __itt_heap_record_memory_growth_begin_ptr 0
17710b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
17720b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
17730b57cec5SDimitry Andric #define __itt_heap_record_memory_growth_begin_ptr 0
17740b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
17750b57cec5SDimitry Andric /** @endcond */
17760b57cec5SDimitry Andric 
17770b57cec5SDimitry Andric /** @brief record memory growth end */
17780b57cec5SDimitry Andric void ITTAPI __itt_heap_record_memory_growth_end(void);
17790b57cec5SDimitry Andric 
17800b57cec5SDimitry Andric /** @cond exclude_from_documentation */
17810b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
17820b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
17830b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void))
1784fe6060f1SDimitry Andric #define __itt_heap_record_memory_growth_end                                    \
1785fe6060f1SDimitry Andric   ITTNOTIFY_VOID(heap_record_memory_growth_end)
1786fe6060f1SDimitry Andric #define __itt_heap_record_memory_growth_end_ptr                                \
1787fe6060f1SDimitry Andric   ITTNOTIFY_NAME(heap_record_memory_growth_end)
17880b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
17890b57cec5SDimitry Andric #define __itt_heap_record_memory_growth_end()
17900b57cec5SDimitry Andric #define __itt_heap_record_memory_growth_end_ptr 0
17910b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
17920b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
17930b57cec5SDimitry Andric #define __itt_heap_record_memory_growth_end_ptr 0
17940b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
17950b57cec5SDimitry Andric /** @endcond */
17960b57cec5SDimitry Andric 
17970b57cec5SDimitry Andric /**
17980b57cec5SDimitry Andric  * @brief Specify the type of heap detection/reporting to modify.
17990b57cec5SDimitry Andric  */
18000b57cec5SDimitry Andric /**
18010b57cec5SDimitry Andric  * @hideinitializer
18020b57cec5SDimitry Andric  * @brief Report on memory leaks.
18030b57cec5SDimitry Andric  */
18040b57cec5SDimitry Andric #define __itt_heap_leaks 0x00000001
18050b57cec5SDimitry Andric 
18060b57cec5SDimitry Andric /**
18070b57cec5SDimitry Andric  * @hideinitializer
18080b57cec5SDimitry Andric  * @brief Report on memory growth.
18090b57cec5SDimitry Andric  */
18100b57cec5SDimitry Andric #define __itt_heap_growth 0x00000002
18110b57cec5SDimitry Andric 
18120b57cec5SDimitry Andric /** @brief heap reset detection */
18130b57cec5SDimitry Andric void ITTAPI __itt_heap_reset_detection(unsigned int reset_mask);
18140b57cec5SDimitry Andric 
18150b57cec5SDimitry Andric /** @cond exclude_from_documentation */
18160b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
18170b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
18180b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask))
18190b57cec5SDimitry Andric #define __itt_heap_reset_detection ITTNOTIFY_VOID(heap_reset_detection)
18200b57cec5SDimitry Andric #define __itt_heap_reset_detection_ptr ITTNOTIFY_NAME(heap_reset_detection)
18210b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
18220b57cec5SDimitry Andric #define __itt_heap_reset_detection()
18230b57cec5SDimitry Andric #define __itt_heap_reset_detection_ptr 0
18240b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
18250b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
18260b57cec5SDimitry Andric #define __itt_heap_reset_detection_ptr 0
18270b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
18280b57cec5SDimitry Andric /** @endcond */
18290b57cec5SDimitry Andric 
18300b57cec5SDimitry Andric /** @brief report */
18310b57cec5SDimitry Andric void ITTAPI __itt_heap_record(unsigned int record_mask);
18320b57cec5SDimitry Andric 
18330b57cec5SDimitry Andric /** @cond exclude_from_documentation */
18340b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
18350b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
18360b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask))
18370b57cec5SDimitry Andric #define __itt_heap_record ITTNOTIFY_VOID(heap_record)
18380b57cec5SDimitry Andric #define __itt_heap_record_ptr ITTNOTIFY_NAME(heap_record)
18390b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
18400b57cec5SDimitry Andric #define __itt_heap_record()
18410b57cec5SDimitry Andric #define __itt_heap_record_ptr 0
18420b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
18430b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
18440b57cec5SDimitry Andric #define __itt_heap_record_ptr 0
18450b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
18460b57cec5SDimitry Andric /** @endcond */
18470b57cec5SDimitry Andric 
18480b57cec5SDimitry Andric /** @} heap group */
18490b57cec5SDimitry Andric /** @endcond */
18500b57cec5SDimitry Andric /* ========================================================================== */
18510b57cec5SDimitry Andric 
18520b57cec5SDimitry Andric /**
18530b57cec5SDimitry Andric  * @defgroup domains Domains
18540b57cec5SDimitry Andric  * @ingroup public
18550b57cec5SDimitry Andric  * Domains group
18560b57cec5SDimitry Andric  * @{
18570b57cec5SDimitry Andric  */
18580b57cec5SDimitry Andric 
18590b57cec5SDimitry Andric /** @cond exclude_from_documentation */
18600b57cec5SDimitry Andric #pragma pack(push, 8)
18610b57cec5SDimitry Andric 
1862fe6060f1SDimitry Andric typedef struct ___itt_domain {
1863fe6060f1SDimitry Andric   volatile int flags; /*!< Zero if disabled, non-zero if enabled. The meaning of
1864fe6060f1SDimitry Andric                          different non-zero values is reserved to the runtime */
18650b57cec5SDimitry Andric   const char *nameA; /*!< Copy of original name in ASCII. */
18660b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
18670b57cec5SDimitry Andric   const wchar_t *nameW; /*!< Copy of original name in UNICODE. */
18680b57cec5SDimitry Andric #else /* UNICODE || _UNICODE */
18690b57cec5SDimitry Andric   void *nameW;
18700b57cec5SDimitry Andric #endif /* UNICODE || _UNICODE */
18710b57cec5SDimitry Andric   int extra1; /*!< Reserved to the runtime */
18720b57cec5SDimitry Andric   void *extra2; /*!< Reserved to the runtime */
18730b57cec5SDimitry Andric   struct ___itt_domain *next;
18740b57cec5SDimitry Andric } __itt_domain;
18750b57cec5SDimitry Andric 
18760b57cec5SDimitry Andric #pragma pack(pop)
18770b57cec5SDimitry Andric /** @endcond */
18780b57cec5SDimitry Andric 
18790b57cec5SDimitry Andric /**
18800b57cec5SDimitry Andric  * @ingroup domains
18810b57cec5SDimitry Andric  * @brief Create a domain.
18820b57cec5SDimitry Andric  * Create domain using some domain name: the URI naming style is recommended.
18830b57cec5SDimitry Andric  * Because the set of domains is expected to be static over the application's
18840b57cec5SDimitry Andric  * execution time, there is no mechanism to destroy a domain.
18850b57cec5SDimitry Andric  * Any domain can be accessed by any thread in the process, regardless of
18860b57cec5SDimitry Andric  * which thread created the domain. This call is thread-safe.
18870b57cec5SDimitry Andric  * @param[in] name name of domain
18880b57cec5SDimitry Andric  */
18890b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
18900b57cec5SDimitry Andric __itt_domain *ITTAPI __itt_domain_createA(const char *name);
18910b57cec5SDimitry Andric __itt_domain *ITTAPI __itt_domain_createW(const wchar_t *name);
18920b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
18930b57cec5SDimitry Andric #define __itt_domain_create __itt_domain_createW
18940b57cec5SDimitry Andric #define __itt_domain_create_ptr __itt_domain_createW_ptr
18950b57cec5SDimitry Andric #else /* UNICODE */
18960b57cec5SDimitry Andric #define __itt_domain_create __itt_domain_createA
18970b57cec5SDimitry Andric #define __itt_domain_create_ptr __itt_domain_createA_ptr
18980b57cec5SDimitry Andric #endif /* UNICODE */
18990b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19000b57cec5SDimitry Andric __itt_domain *ITTAPI __itt_domain_create(const char *name);
19010b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19020b57cec5SDimitry Andric 
19030b57cec5SDimitry Andric /** @cond exclude_from_documentation */
19040b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
19050b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
19060b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
19070b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_domain *, domain_createA, (const char *name))
19080b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_domain *, domain_createW, (const wchar_t *name))
19090b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19100b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_domain *, domain_create, (const char *name))
19110b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19120b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
19130b57cec5SDimitry Andric #define __itt_domain_createA ITTNOTIFY_DATA(domain_createA)
19140b57cec5SDimitry Andric #define __itt_domain_createA_ptr ITTNOTIFY_NAME(domain_createA)
19150b57cec5SDimitry Andric #define __itt_domain_createW ITTNOTIFY_DATA(domain_createW)
19160b57cec5SDimitry Andric #define __itt_domain_createW_ptr ITTNOTIFY_NAME(domain_createW)
19170b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19180b57cec5SDimitry Andric #define __itt_domain_create ITTNOTIFY_DATA(domain_create)
19190b57cec5SDimitry Andric #define __itt_domain_create_ptr ITTNOTIFY_NAME(domain_create)
19200b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19210b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
19220b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
19230b57cec5SDimitry Andric #define __itt_domain_createA(name) (__itt_domain *)0
19240b57cec5SDimitry Andric #define __itt_domain_createA_ptr 0
19250b57cec5SDimitry Andric #define __itt_domain_createW(name) (__itt_domain *)0
19260b57cec5SDimitry Andric #define __itt_domain_createW_ptr 0
19270b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19280b57cec5SDimitry Andric #define __itt_domain_create(name) (__itt_domain *)0
19290b57cec5SDimitry Andric #define __itt_domain_create_ptr 0
19300b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19310b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
19320b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
19330b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
19340b57cec5SDimitry Andric #define __itt_domain_createA_ptr 0
19350b57cec5SDimitry Andric #define __itt_domain_createW_ptr 0
19360b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19370b57cec5SDimitry Andric #define __itt_domain_create_ptr 0
19380b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
19390b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
19400b57cec5SDimitry Andric /** @endcond */
19410b57cec5SDimitry Andric /** @} domains group */
19420b57cec5SDimitry Andric 
19430b57cec5SDimitry Andric /**
19440b57cec5SDimitry Andric  * @defgroup ids IDs
19450b57cec5SDimitry Andric  * @ingroup public
19460b57cec5SDimitry Andric  * IDs group
19470b57cec5SDimitry Andric  * @{
19480b57cec5SDimitry Andric  */
19490b57cec5SDimitry Andric 
19500b57cec5SDimitry Andric /** @cond exclude_from_documentation */
19510b57cec5SDimitry Andric #pragma pack(push, 8)
19520b57cec5SDimitry Andric 
1953fe6060f1SDimitry Andric typedef struct ___itt_id {
19540b57cec5SDimitry Andric   unsigned long long d1, d2, d3;
19550b57cec5SDimitry Andric } __itt_id;
19560b57cec5SDimitry Andric 
19570b57cec5SDimitry Andric #pragma pack(pop)
19580b57cec5SDimitry Andric /** @endcond */
19590b57cec5SDimitry Andric 
19600b57cec5SDimitry Andric static const __itt_id __itt_null = {0, 0, 0};
19610b57cec5SDimitry Andric 
19620b57cec5SDimitry Andric /**
19630b57cec5SDimitry Andric  * @ingroup ids
1964fe6060f1SDimitry Andric  * @brief A convenience function is provided to create an ID without domain
1965fe6060f1SDimitry Andric  * control.
1966fe6060f1SDimitry Andric  * @brief This is a convenience function to initialize an __itt_id structure.
1967fe6060f1SDimitry Andric  * This function does not affect the collector runtime in any way. After you
1968fe6060f1SDimitry Andric  * make the ID with this function, you still must create it with the
1969fe6060f1SDimitry Andric  * __itt_id_create function before using the ID to identify a named entity.
19700b57cec5SDimitry Andric  * @param[in] addr The address of object; high QWORD of the ID value.
1971fe6060f1SDimitry Andric  * @param[in] extra The extra data to unique identify object; low QWORD of the
1972fe6060f1SDimitry Andric  * ID value.
19730b57cec5SDimitry Andric  */
19740b57cec5SDimitry Andric 
19750b57cec5SDimitry Andric ITT_INLINE __itt_id ITTAPI __itt_id_make(void *addr, unsigned long long extra)
1976fe6060f1SDimitry Andric     ITT_INLINE_ATTRIBUTE;
__itt_id_make(void * addr,unsigned long long extra)1977fe6060f1SDimitry Andric ITT_INLINE __itt_id ITTAPI __itt_id_make(void *addr, unsigned long long extra) {
19780b57cec5SDimitry Andric   __itt_id id = __itt_null;
19790b57cec5SDimitry Andric   id.d1 = (unsigned long long)((uintptr_t)addr);
19800b57cec5SDimitry Andric   id.d2 = (unsigned long long)extra;
19810b57cec5SDimitry Andric   id.d3 = (unsigned long long)0; /* Reserved. Must be zero */
19820b57cec5SDimitry Andric   return id;
19830b57cec5SDimitry Andric }
19840b57cec5SDimitry Andric 
19850b57cec5SDimitry Andric /**
19860b57cec5SDimitry Andric  * @ingroup ids
19870b57cec5SDimitry Andric  * @brief Create an instance of identifier.
19880b57cec5SDimitry Andric  * This establishes the beginning of the lifetime of an instance of
19890b57cec5SDimitry Andric  * the given ID in the trace. Once this lifetime starts, the ID
19900b57cec5SDimitry Andric  * can be used to tag named entity instances in calls such as
19910b57cec5SDimitry Andric  * __itt_task_begin, and to specify relationships among
19920b57cec5SDimitry Andric  * identified named entity instances, using the \ref relations APIs.
19930b57cec5SDimitry Andric  * Instance IDs are not domain specific!
19940b57cec5SDimitry Andric  * @param[in] domain The domain controlling the execution of this call.
19950b57cec5SDimitry Andric  * @param[in] id The ID to create.
19960b57cec5SDimitry Andric  */
19970b57cec5SDimitry Andric void ITTAPI __itt_id_create(const __itt_domain *domain, __itt_id id);
19980b57cec5SDimitry Andric 
19990b57cec5SDimitry Andric /** @cond exclude_from_documentation */
20000b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
20010b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
20020b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id))
20030b57cec5SDimitry Andric #define __itt_id_create(d, x) ITTNOTIFY_VOID_D1(id_create, d, x)
20040b57cec5SDimitry Andric #define __itt_id_create_ptr ITTNOTIFY_NAME(id_create)
20050b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
20060b57cec5SDimitry Andric #define __itt_id_create(domain, id)
20070b57cec5SDimitry Andric #define __itt_id_create_ptr 0
20080b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
20090b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
20100b57cec5SDimitry Andric #define __itt_id_create_ptr 0
20110b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
20120b57cec5SDimitry Andric /** @endcond */
20130b57cec5SDimitry Andric 
20140b57cec5SDimitry Andric /**
20150b57cec5SDimitry Andric  * @ingroup ids
20160b57cec5SDimitry Andric  * @brief Destroy an instance of identifier.
2017fe6060f1SDimitry Andric  * This ends the lifetime of the current instance of the given ID value in the
2018fe6060f1SDimitry Andric  * trace. Any relationships that are established after this lifetime ends are
2019fe6060f1SDimitry Andric  * invalid. This call must be performed before the given ID value can be reused
2020fe6060f1SDimitry Andric  * for a different named entity instance.
20210b57cec5SDimitry Andric  * @param[in] domain The domain controlling the execution of this call.
20220b57cec5SDimitry Andric  * @param[in] id The ID to destroy.
20230b57cec5SDimitry Andric  */
20240b57cec5SDimitry Andric void ITTAPI __itt_id_destroy(const __itt_domain *domain, __itt_id id);
20250b57cec5SDimitry Andric 
20260b57cec5SDimitry Andric /** @cond exclude_from_documentation */
20270b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
20280b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
20290b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id))
20300b57cec5SDimitry Andric #define __itt_id_destroy(d, x) ITTNOTIFY_VOID_D1(id_destroy, d, x)
20310b57cec5SDimitry Andric #define __itt_id_destroy_ptr ITTNOTIFY_NAME(id_destroy)
20320b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
20330b57cec5SDimitry Andric #define __itt_id_destroy(domain, id)
20340b57cec5SDimitry Andric #define __itt_id_destroy_ptr 0
20350b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
20360b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
20370b57cec5SDimitry Andric #define __itt_id_destroy_ptr 0
20380b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
20390b57cec5SDimitry Andric /** @endcond */
20400b57cec5SDimitry Andric /** @} ids group */
20410b57cec5SDimitry Andric 
20420b57cec5SDimitry Andric /**
20430b57cec5SDimitry Andric  * @defgroup handless String Handles
20440b57cec5SDimitry Andric  * @ingroup public
20450b57cec5SDimitry Andric  * String Handles group
20460b57cec5SDimitry Andric  * @{
20470b57cec5SDimitry Andric  */
20480b57cec5SDimitry Andric 
20490b57cec5SDimitry Andric /** @cond exclude_from_documentation */
20500b57cec5SDimitry Andric #pragma pack(push, 8)
20510b57cec5SDimitry Andric 
2052fe6060f1SDimitry Andric typedef struct ___itt_string_handle {
20530b57cec5SDimitry Andric   const char *strA; /*!< Copy of original string in ASCII. */
20540b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
20550b57cec5SDimitry Andric   const wchar_t *strW; /*!< Copy of original string in UNICODE. */
20560b57cec5SDimitry Andric #else /* UNICODE || _UNICODE */
20570b57cec5SDimitry Andric   void *strW;
20580b57cec5SDimitry Andric #endif /* UNICODE || _UNICODE */
20590b57cec5SDimitry Andric   int extra1; /*!< Reserved. Must be zero   */
20600b57cec5SDimitry Andric   void *extra2; /*!< Reserved. Must be zero   */
20610b57cec5SDimitry Andric   struct ___itt_string_handle *next;
20620b57cec5SDimitry Andric } __itt_string_handle;
20630b57cec5SDimitry Andric 
20640b57cec5SDimitry Andric #pragma pack(pop)
20650b57cec5SDimitry Andric /** @endcond */
20660b57cec5SDimitry Andric 
20670b57cec5SDimitry Andric /**
20680b57cec5SDimitry Andric  * @ingroup handles
20690b57cec5SDimitry Andric  * @brief Create a string handle.
20700b57cec5SDimitry Andric  * Create and return handle value that can be associated with a string.
20710b57cec5SDimitry Andric  * Consecutive calls to __itt_string_handle_create with the same name
2072fe6060f1SDimitry Andric  * return the same value. Because the set of string handles is expected to
2073fe6060f1SDimitry Andric  * remain static during the application's execution time, there is no mechanism
2074fe6060f1SDimitry Andric  * to destroy a string handle. Any string handle can be accessed by any thread
2075fe6060f1SDimitry Andric  * in the process, regardless of which thread created the string handle. This
2076fe6060f1SDimitry Andric  * call is thread-safe.
20770b57cec5SDimitry Andric  * @param[in] name The input string
20780b57cec5SDimitry Andric  */
20790b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
20800b57cec5SDimitry Andric __itt_string_handle *ITTAPI __itt_string_handle_createA(const char *name);
20810b57cec5SDimitry Andric __itt_string_handle *ITTAPI __itt_string_handle_createW(const wchar_t *name);
20820b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
20830b57cec5SDimitry Andric #define __itt_string_handle_create __itt_string_handle_createW
20840b57cec5SDimitry Andric #define __itt_string_handle_create_ptr __itt_string_handle_createW_ptr
20850b57cec5SDimitry Andric #else /* UNICODE */
20860b57cec5SDimitry Andric #define __itt_string_handle_create __itt_string_handle_createA
20870b57cec5SDimitry Andric #define __itt_string_handle_create_ptr __itt_string_handle_createA_ptr
20880b57cec5SDimitry Andric #endif /* UNICODE */
20890b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
20900b57cec5SDimitry Andric __itt_string_handle *ITTAPI __itt_string_handle_create(const char *name);
20910b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
20920b57cec5SDimitry Andric 
20930b57cec5SDimitry Andric /** @cond exclude_from_documentation */
20940b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
20950b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
20960b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
2097fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_createA,
2098fe6060f1SDimitry Andric          (const char *name))
2099fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_createW,
2100fe6060f1SDimitry Andric          (const wchar_t *name))
21010b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2102fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_create,
2103fe6060f1SDimitry Andric          (const char *name))
21040b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
21050b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
21060b57cec5SDimitry Andric #define __itt_string_handle_createA ITTNOTIFY_DATA(string_handle_createA)
21070b57cec5SDimitry Andric #define __itt_string_handle_createA_ptr ITTNOTIFY_NAME(string_handle_createA)
21080b57cec5SDimitry Andric #define __itt_string_handle_createW ITTNOTIFY_DATA(string_handle_createW)
21090b57cec5SDimitry Andric #define __itt_string_handle_createW_ptr ITTNOTIFY_NAME(string_handle_createW)
21100b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
21110b57cec5SDimitry Andric #define __itt_string_handle_create ITTNOTIFY_DATA(string_handle_create)
21120b57cec5SDimitry Andric #define __itt_string_handle_create_ptr ITTNOTIFY_NAME(string_handle_create)
21130b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
21140b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
21150b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
21160b57cec5SDimitry Andric #define __itt_string_handle_createA(name) (__itt_string_handle *)0
21170b57cec5SDimitry Andric #define __itt_string_handle_createA_ptr 0
21180b57cec5SDimitry Andric #define __itt_string_handle_createW(name) (__itt_string_handle *)0
21190b57cec5SDimitry Andric #define __itt_string_handle_createW_ptr 0
21200b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
21210b57cec5SDimitry Andric #define __itt_string_handle_create(name) (__itt_string_handle *)0
21220b57cec5SDimitry Andric #define __itt_string_handle_create_ptr 0
21230b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
21240b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
21250b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
21260b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
21270b57cec5SDimitry Andric #define __itt_string_handle_createA_ptr 0
21280b57cec5SDimitry Andric #define __itt_string_handle_createW_ptr 0
21290b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
21300b57cec5SDimitry Andric #define __itt_string_handle_create_ptr 0
21310b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
21320b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
21330b57cec5SDimitry Andric /** @endcond */
21340b57cec5SDimitry Andric /** @} handles group */
21350b57cec5SDimitry Andric 
21360b57cec5SDimitry Andric /** @cond exclude_from_documentation */
21370b57cec5SDimitry Andric typedef unsigned long long __itt_timestamp;
21380b57cec5SDimitry Andric /** @endcond */
21390b57cec5SDimitry Andric 
21400b57cec5SDimitry Andric #define __itt_timestamp_none ((__itt_timestamp)-1LL)
21410b57cec5SDimitry Andric 
21420b57cec5SDimitry Andric /** @cond exclude_from_gpa_documentation */
21430b57cec5SDimitry Andric 
21440b57cec5SDimitry Andric /**
21450b57cec5SDimitry Andric  * @ingroup timestamps
21460b57cec5SDimitry Andric  * @brief Return timestamp corresponding to the current moment.
2147fe6060f1SDimitry Andric  * This returns the timestamp in the format that is the most relevant for the
2148fe6060f1SDimitry Andric  * current host or platform (RDTSC, QPC, and others). You can use the "<"
2149fe6060f1SDimitry Andric  * operator to compare __itt_timestamp values.
21500b57cec5SDimitry Andric  */
21510b57cec5SDimitry Andric __itt_timestamp ITTAPI __itt_get_timestamp(void);
21520b57cec5SDimitry Andric 
21530b57cec5SDimitry Andric /** @cond exclude_from_documentation */
21540b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
21550b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
21560b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void))
21570b57cec5SDimitry Andric #define __itt_get_timestamp ITTNOTIFY_DATA(get_timestamp)
21580b57cec5SDimitry Andric #define __itt_get_timestamp_ptr ITTNOTIFY_NAME(get_timestamp)
21590b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
21600b57cec5SDimitry Andric #define __itt_get_timestamp()
21610b57cec5SDimitry Andric #define __itt_get_timestamp_ptr 0
21620b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
21630b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
21640b57cec5SDimitry Andric #define __itt_get_timestamp_ptr 0
21650b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
21660b57cec5SDimitry Andric /** @endcond */
21670b57cec5SDimitry Andric /** @} timestamps */
21680b57cec5SDimitry Andric /** @endcond */
21690b57cec5SDimitry Andric 
21700b57cec5SDimitry Andric /** @cond exclude_from_gpa_documentation */
21710b57cec5SDimitry Andric 
21720b57cec5SDimitry Andric /**
21730b57cec5SDimitry Andric  * @defgroup regions Regions
21740b57cec5SDimitry Andric  * @ingroup public
21750b57cec5SDimitry Andric  * Regions group
21760b57cec5SDimitry Andric  * @{
21770b57cec5SDimitry Andric  */
21780b57cec5SDimitry Andric /**
21790b57cec5SDimitry Andric  * @ingroup regions
21800b57cec5SDimitry Andric  * @brief Begin of region instance.
21810b57cec5SDimitry Andric  * Successive calls to __itt_region_begin with the same ID are ignored
21820b57cec5SDimitry Andric  * until a call to __itt_region_end with the same ID
21830b57cec5SDimitry Andric  * @param[in] domain The domain for this region instance
2184fe6060f1SDimitry Andric  * @param[in] id The instance ID for this region instance. Must not be
2185fe6060f1SDimitry Andric  * __itt_null
2186fe6060f1SDimitry Andric  * @param[in] parentid The instance ID for the parent of this region instance,
2187fe6060f1SDimitry Andric  * or __itt_null
21880b57cec5SDimitry Andric  * @param[in] name The name of this region
21890b57cec5SDimitry Andric  */
2190fe6060f1SDimitry Andric void ITTAPI __itt_region_begin(const __itt_domain *domain, __itt_id id,
2191fe6060f1SDimitry Andric                                __itt_id parentid, __itt_string_handle *name);
21920b57cec5SDimitry Andric 
21930b57cec5SDimitry Andric /**
21940b57cec5SDimitry Andric  * @ingroup regions
21950b57cec5SDimitry Andric  * @brief End of region instance.
21960b57cec5SDimitry Andric  * The first call to __itt_region_end with a given ID ends the
21970b57cec5SDimitry Andric  * region. Successive calls with the same ID are ignored, as are
21980b57cec5SDimitry Andric  * calls that do not have a matching __itt_region_begin call.
21990b57cec5SDimitry Andric  * @param[in] domain The domain for this region instance
22000b57cec5SDimitry Andric  * @param[in] id The instance ID for this region instance
22010b57cec5SDimitry Andric  */
22020b57cec5SDimitry Andric void ITTAPI __itt_region_end(const __itt_domain *domain, __itt_id id);
22030b57cec5SDimitry Andric 
22040b57cec5SDimitry Andric /** @cond exclude_from_documentation */
22050b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
22060b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2207fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, region_begin,
2208fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2209fe6060f1SDimitry Andric            __itt_string_handle *name))
22100b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id))
2211fe6060f1SDimitry Andric #define __itt_region_begin(d, x, y, z)                                         \
2212fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(region_begin, d, x, y, z)
22130b57cec5SDimitry Andric #define __itt_region_begin_ptr ITTNOTIFY_NAME(region_begin)
22140b57cec5SDimitry Andric #define __itt_region_end(d, x) ITTNOTIFY_VOID_D1(region_end, d, x)
22150b57cec5SDimitry Andric #define __itt_region_end_ptr ITTNOTIFY_NAME(region_end)
22160b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
22170b57cec5SDimitry Andric #define __itt_region_begin(d, x, y, z)
22180b57cec5SDimitry Andric #define __itt_region_begin_ptr 0
22190b57cec5SDimitry Andric #define __itt_region_end(d, x)
22200b57cec5SDimitry Andric #define __itt_region_end_ptr 0
22210b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
22220b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
22230b57cec5SDimitry Andric #define __itt_region_begin_ptr 0
22240b57cec5SDimitry Andric #define __itt_region_end_ptr 0
22250b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
22260b57cec5SDimitry Andric /** @endcond */
22270b57cec5SDimitry Andric /** @} regions group */
22280b57cec5SDimitry Andric 
22290b57cec5SDimitry Andric /**
22300b57cec5SDimitry Andric  * @defgroup frames Frames
22310b57cec5SDimitry Andric  * @ingroup public
2232fe6060f1SDimitry Andric  * Frames are similar to regions, but are intended to be easier to use and to
2233fe6060f1SDimitry Andric  * implement. In particular:
22340b57cec5SDimitry Andric  * - Frames always represent periods of elapsed time
22350b57cec5SDimitry Andric  * - By default, frames have no nesting relationships
22360b57cec5SDimitry Andric  * @{
22370b57cec5SDimitry Andric  */
22380b57cec5SDimitry Andric 
22390b57cec5SDimitry Andric /**
22400b57cec5SDimitry Andric  * @ingroup frames
22410b57cec5SDimitry Andric  * @brief Begin a frame instance.
22420b57cec5SDimitry Andric  * Successive calls to __itt_frame_begin with the
22430b57cec5SDimitry Andric  * same ID are ignored until a call to __itt_frame_end with the same ID.
22440b57cec5SDimitry Andric  * @param[in] domain The domain for this frame instance
22450b57cec5SDimitry Andric  * @param[in] id The instance ID for this frame instance or NULL
22460b57cec5SDimitry Andric  */
22470b57cec5SDimitry Andric void ITTAPI __itt_frame_begin_v3(const __itt_domain *domain, __itt_id *id);
22480b57cec5SDimitry Andric 
22490b57cec5SDimitry Andric /**
22500b57cec5SDimitry Andric  * @ingroup frames
22510b57cec5SDimitry Andric  * @brief End a frame instance.
22520b57cec5SDimitry Andric  * The first call to __itt_frame_end with a given ID
22530b57cec5SDimitry Andric  * ends the frame. Successive calls with the same ID are ignored, as are
22540b57cec5SDimitry Andric  * calls that do not have a matching __itt_frame_begin call.
22550b57cec5SDimitry Andric  * @param[in] domain The domain for this frame instance
22560b57cec5SDimitry Andric  * @param[in] id The instance ID for this frame instance or NULL for current
22570b57cec5SDimitry Andric  */
22580b57cec5SDimitry Andric void ITTAPI __itt_frame_end_v3(const __itt_domain *domain, __itt_id *id);
22590b57cec5SDimitry Andric 
22600b57cec5SDimitry Andric /**
22610b57cec5SDimitry Andric  * @ingroup frames
22620b57cec5SDimitry Andric  * @brief Submits a frame instance.
22630b57cec5SDimitry Andric  * Successive calls to __itt_frame_begin or __itt_frame_submit with the
22640b57cec5SDimitry Andric  * same ID are ignored until a call to __itt_frame_end or __itt_frame_submit
22650b57cec5SDimitry Andric  * with the same ID.
22660b57cec5SDimitry Andric  * Passing special __itt_timestamp_none value as "end" argument means
22670b57cec5SDimitry Andric  * take the current timestamp as the end timestamp.
22680b57cec5SDimitry Andric  * @param[in] domain The domain for this frame instance
22690b57cec5SDimitry Andric  * @param[in] id The instance ID for this frame instance or NULL
22700b57cec5SDimitry Andric  * @param[in] begin Timestamp of the beginning of the frame
22710b57cec5SDimitry Andric  * @param[in] end Timestamp of the end of the frame
22720b57cec5SDimitry Andric  */
22730b57cec5SDimitry Andric void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id,
22740b57cec5SDimitry Andric                                   __itt_timestamp begin, __itt_timestamp end);
22750b57cec5SDimitry Andric 
22760b57cec5SDimitry Andric /** @cond exclude_from_documentation */
22770b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
22780b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2279fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, frame_begin_v3,
2280fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id *id))
2281fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, frame_end_v3,
2282fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id *id))
2283fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, frame_submit_v3,
2284fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin,
2285fe6060f1SDimitry Andric            __itt_timestamp end))
22860b57cec5SDimitry Andric #define __itt_frame_begin_v3(d, x) ITTNOTIFY_VOID_D1(frame_begin_v3, d, x)
22870b57cec5SDimitry Andric #define __itt_frame_begin_v3_ptr ITTNOTIFY_NAME(frame_begin_v3)
22880b57cec5SDimitry Andric #define __itt_frame_end_v3(d, x) ITTNOTIFY_VOID_D1(frame_end_v3, d, x)
22890b57cec5SDimitry Andric #define __itt_frame_end_v3_ptr ITTNOTIFY_NAME(frame_end_v3)
2290fe6060f1SDimitry Andric #define __itt_frame_submit_v3(d, x, b, e)                                      \
2291fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(frame_submit_v3, d, x, b, e)
22920b57cec5SDimitry Andric #define __itt_frame_submit_v3_ptr ITTNOTIFY_NAME(frame_submit_v3)
22930b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
22940b57cec5SDimitry Andric #define __itt_frame_begin_v3(domain, id)
22950b57cec5SDimitry Andric #define __itt_frame_begin_v3_ptr 0
22960b57cec5SDimitry Andric #define __itt_frame_end_v3(domain, id)
22970b57cec5SDimitry Andric #define __itt_frame_end_v3_ptr 0
22980b57cec5SDimitry Andric #define __itt_frame_submit_v3(domain, id, begin, end)
22990b57cec5SDimitry Andric #define __itt_frame_submit_v3_ptr 0
23000b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
23010b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
23020b57cec5SDimitry Andric #define __itt_frame_begin_v3_ptr 0
23030b57cec5SDimitry Andric #define __itt_frame_end_v3_ptr 0
23040b57cec5SDimitry Andric #define __itt_frame_submit_v3_ptr 0
23050b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
23060b57cec5SDimitry Andric /** @endcond */
23070b57cec5SDimitry Andric /** @} frames group */
23080b57cec5SDimitry Andric /** @endcond */
23090b57cec5SDimitry Andric 
23100b57cec5SDimitry Andric /**
23110b57cec5SDimitry Andric  * @defgroup taskgroup Task Group
23120b57cec5SDimitry Andric  * @ingroup public
23130b57cec5SDimitry Andric  * Task Group
23140b57cec5SDimitry Andric  * @{
23150b57cec5SDimitry Andric  */
23160b57cec5SDimitry Andric /**
23170b57cec5SDimitry Andric  * @ingroup task_groups
23180b57cec5SDimitry Andric  * @brief Denotes a task_group instance.
23190b57cec5SDimitry Andric  * Successive calls to __itt_task_group with the same ID are ignored.
23200b57cec5SDimitry Andric  * @param[in] domain The domain for this task_group instance
2321fe6060f1SDimitry Andric  * @param[in] id The instance ID for this task_group instance. Must not be
2322fe6060f1SDimitry Andric  * __itt_null.
2323fe6060f1SDimitry Andric  * @param[in] parentid The instance ID for the parent of this task_group
2324fe6060f1SDimitry Andric  * instance, or __itt_null.
23250b57cec5SDimitry Andric  * @param[in] name The name of this task_group
23260b57cec5SDimitry Andric  */
2327fe6060f1SDimitry Andric void ITTAPI __itt_task_group(const __itt_domain *domain, __itt_id id,
2328fe6060f1SDimitry Andric                              __itt_id parentid, __itt_string_handle *name);
23290b57cec5SDimitry Andric 
23300b57cec5SDimitry Andric /** @cond exclude_from_documentation */
23310b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
23320b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2333fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_group,
2334fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2335fe6060f1SDimitry Andric            __itt_string_handle *name))
23360b57cec5SDimitry Andric #define __itt_task_group(d, x, y, z) ITTNOTIFY_VOID_D3(task_group, d, x, y, z)
23370b57cec5SDimitry Andric #define __itt_task_group_ptr ITTNOTIFY_NAME(task_group)
23380b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
23390b57cec5SDimitry Andric #define __itt_task_group(d, x, y, z)
23400b57cec5SDimitry Andric #define __itt_task_group_ptr 0
23410b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
23420b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
23430b57cec5SDimitry Andric #define __itt_task_group_ptr 0
23440b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
23450b57cec5SDimitry Andric /** @endcond */
23460b57cec5SDimitry Andric /** @} taskgroup group */
23470b57cec5SDimitry Andric 
23480b57cec5SDimitry Andric /**
23490b57cec5SDimitry Andric  * @defgroup tasks Tasks
23500b57cec5SDimitry Andric  * @ingroup public
23510b57cec5SDimitry Andric  * A task instance represents a piece of work performed by a particular
23520b57cec5SDimitry Andric  * thread for a period of time. A call to __itt_task_begin creates a
23530b57cec5SDimitry Andric  * task instance. This becomes the current instance for that task on that
23540b57cec5SDimitry Andric  * thread. A following call to __itt_task_end on the same thread ends the
23550b57cec5SDimitry Andric  * instance. There may be multiple simultaneous instances of tasks with the
23560b57cec5SDimitry Andric  * same name on different threads. If an ID is specified, the task instance
23570b57cec5SDimitry Andric  * receives that ID. Nested tasks are allowed.
23580b57cec5SDimitry Andric  *
23590b57cec5SDimitry Andric  * Note: The task is defined by the bracketing of __itt_task_begin and
23600b57cec5SDimitry Andric  * __itt_task_end on the same thread. If some scheduling mechanism causes
23610b57cec5SDimitry Andric  * task switching (the thread executes a different user task) or task
23620b57cec5SDimitry Andric  * switching (the user task switches to a different thread) then this breaks
23630b57cec5SDimitry Andric  * the notion of  current instance. Additional API calls are required to
23640b57cec5SDimitry Andric  * deal with that possibility.
23650b57cec5SDimitry Andric  * @{
23660b57cec5SDimitry Andric  */
23670b57cec5SDimitry Andric 
23680b57cec5SDimitry Andric /**
23690b57cec5SDimitry Andric  * @ingroup tasks
23700b57cec5SDimitry Andric  * @brief Begin a task instance.
23710b57cec5SDimitry Andric  * @param[in] domain The domain for this task
23720b57cec5SDimitry Andric  * @param[in] taskid The instance ID for this task instance, or __itt_null
2373fe6060f1SDimitry Andric  * @param[in] parentid The parent instance to which this task instance belongs,
2374fe6060f1SDimitry Andric  * or __itt_null
23750b57cec5SDimitry Andric  * @param[in] name The name of this task
23760b57cec5SDimitry Andric  */
2377fe6060f1SDimitry Andric void ITTAPI __itt_task_begin(const __itt_domain *domain, __itt_id taskid,
2378fe6060f1SDimitry Andric                              __itt_id parentid, __itt_string_handle *name);
23790b57cec5SDimitry Andric 
23800b57cec5SDimitry Andric /**
23810b57cec5SDimitry Andric  * @ingroup tasks
23820b57cec5SDimitry Andric  * @brief Begin a task instance.
23830b57cec5SDimitry Andric  * @param[in] domain The domain for this task
23840b57cec5SDimitry Andric  * @param[in] taskid The identifier for this task instance (may be 0)
23850b57cec5SDimitry Andric  * @param[in] parentid The parent of this task (may be 0)
23860b57cec5SDimitry Andric  * @param[in] fn The pointer to the function you are tracing
23870b57cec5SDimitry Andric  */
2388fe6060f1SDimitry Andric void ITTAPI __itt_task_begin_fn(const __itt_domain *domain, __itt_id taskid,
2389fe6060f1SDimitry Andric                                 __itt_id parentid, void *fn);
23900b57cec5SDimitry Andric 
23910b57cec5SDimitry Andric /**
23920b57cec5SDimitry Andric  * @ingroup tasks
23930b57cec5SDimitry Andric  * @brief End the current task instance.
23940b57cec5SDimitry Andric  * @param[in] domain The domain for this task
23950b57cec5SDimitry Andric  */
23960b57cec5SDimitry Andric void ITTAPI __itt_task_end(const __itt_domain *domain);
23970b57cec5SDimitry Andric 
23980b57cec5SDimitry Andric /**
23990b57cec5SDimitry Andric  * @ingroup tasks
24000b57cec5SDimitry Andric  * @brief Begin an overlapped task instance.
24010b57cec5SDimitry Andric  * @param[in] domain The domain for this task.
2402fe6060f1SDimitry Andric  * @param[in] taskid The identifier for this task instance, *cannot* be
2403fe6060f1SDimitry Andric  * __itt_null.
24040b57cec5SDimitry Andric  * @param[in] parentid The parent of this task, or __itt_null.
24050b57cec5SDimitry Andric  * @param[in] name The name of this task.
24060b57cec5SDimitry Andric  */
2407fe6060f1SDimitry Andric void ITTAPI __itt_task_begin_overlapped(const __itt_domain *domain,
2408fe6060f1SDimitry Andric                                         __itt_id taskid, __itt_id parentid,
2409fe6060f1SDimitry Andric                                         __itt_string_handle *name);
24100b57cec5SDimitry Andric 
24110b57cec5SDimitry Andric /**
24120b57cec5SDimitry Andric  * @ingroup tasks
24130b57cec5SDimitry Andric  * @brief End an overlapped task instance.
24140b57cec5SDimitry Andric  * @param[in] domain The domain for this task
24150b57cec5SDimitry Andric  * @param[in] taskid Explicit ID of finished task
24160b57cec5SDimitry Andric  */
2417fe6060f1SDimitry Andric void ITTAPI __itt_task_end_overlapped(const __itt_domain *domain,
2418fe6060f1SDimitry Andric                                       __itt_id taskid);
24190b57cec5SDimitry Andric 
24200b57cec5SDimitry Andric /** @cond exclude_from_documentation */
24210b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
24220b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2423fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_begin,
2424fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2425fe6060f1SDimitry Andric            __itt_string_handle *name))
2426fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_begin_fn,
2427fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2428fe6060f1SDimitry Andric            void *fn))
24290b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain))
2430fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_begin_overlapped,
2431fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id taskid, __itt_id parentid,
2432fe6060f1SDimitry Andric            __itt_string_handle *name))
2433fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_end_overlapped,
2434fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id taskid))
24350b57cec5SDimitry Andric #define __itt_task_begin(d, x, y, z) ITTNOTIFY_VOID_D3(task_begin, d, x, y, z)
24360b57cec5SDimitry Andric #define __itt_task_begin_ptr ITTNOTIFY_NAME(task_begin)
2437fe6060f1SDimitry Andric #define __itt_task_begin_fn(d, x, y, z)                                        \
2438fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(task_begin_fn, d, x, y, z)
24390b57cec5SDimitry Andric #define __itt_task_begin_fn_ptr ITTNOTIFY_NAME(task_begin_fn)
24400b57cec5SDimitry Andric #define __itt_task_end(d) ITTNOTIFY_VOID_D0(task_end, d)
24410b57cec5SDimitry Andric #define __itt_task_end_ptr ITTNOTIFY_NAME(task_end)
2442fe6060f1SDimitry Andric #define __itt_task_begin_overlapped(d, x, y, z)                                \
2443fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(task_begin_overlapped, d, x, y, z)
24440b57cec5SDimitry Andric #define __itt_task_begin_overlapped_ptr ITTNOTIFY_NAME(task_begin_overlapped)
2445fe6060f1SDimitry Andric #define __itt_task_end_overlapped(d, x)                                        \
2446fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D1(task_end_overlapped, d, x)
24470b57cec5SDimitry Andric #define __itt_task_end_overlapped_ptr ITTNOTIFY_NAME(task_end_overlapped)
24480b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
24490b57cec5SDimitry Andric #define __itt_task_begin(domain, id, parentid, name)
24500b57cec5SDimitry Andric #define __itt_task_begin_ptr 0
24510b57cec5SDimitry Andric #define __itt_task_begin_fn(domain, id, parentid, fn)
24520b57cec5SDimitry Andric #define __itt_task_begin_fn_ptr 0
24530b57cec5SDimitry Andric #define __itt_task_end(domain)
24540b57cec5SDimitry Andric #define __itt_task_end_ptr 0
24550b57cec5SDimitry Andric #define __itt_task_begin_overlapped(domain, taskid, parentid, name)
24560b57cec5SDimitry Andric #define __itt_task_begin_overlapped_ptr 0
24570b57cec5SDimitry Andric #define __itt_task_end_overlapped(domain, taskid)
24580b57cec5SDimitry Andric #define __itt_task_end_overlapped_ptr 0
24590b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
24600b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
24610b57cec5SDimitry Andric #define __itt_task_begin_ptr 0
24620b57cec5SDimitry Andric #define __itt_task_begin_fn_ptr 0
24630b57cec5SDimitry Andric #define __itt_task_end_ptr 0
24640b57cec5SDimitry Andric #define __itt_task_begin_overlapped_ptr 0
24650b57cec5SDimitry Andric #define __itt_task_end_overlapped_ptr 0
24660b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
24670b57cec5SDimitry Andric /** @endcond */
24680b57cec5SDimitry Andric /** @} tasks group */
24690b57cec5SDimitry Andric 
24700b57cec5SDimitry Andric /**
24710b57cec5SDimitry Andric  * @defgroup markers Markers
24720b57cec5SDimitry Andric  * Markers represent a single discreet event in time. Markers have a scope,
24730b57cec5SDimitry Andric  * described by an enumerated type __itt_scope. Markers are created by
24740b57cec5SDimitry Andric  * the API call __itt_marker. A marker instance can be given an ID for use in
24750b57cec5SDimitry Andric  * adding metadata.
24760b57cec5SDimitry Andric  * @{
24770b57cec5SDimitry Andric  */
24780b57cec5SDimitry Andric 
24790b57cec5SDimitry Andric /**
24800b57cec5SDimitry Andric  * @brief Describes the scope of an event object in the trace.
24810b57cec5SDimitry Andric  */
2482fe6060f1SDimitry Andric typedef enum {
24830b57cec5SDimitry Andric   __itt_scope_unknown = 0,
24840b57cec5SDimitry Andric   __itt_scope_global,
24850b57cec5SDimitry Andric   __itt_scope_track_group,
24860b57cec5SDimitry Andric   __itt_scope_track,
24870b57cec5SDimitry Andric   __itt_scope_task,
24880b57cec5SDimitry Andric   __itt_scope_marker
24890b57cec5SDimitry Andric } __itt_scope;
24900b57cec5SDimitry Andric 
24910b57cec5SDimitry Andric /** @cond exclude_from_documentation */
24920b57cec5SDimitry Andric #define __itt_marker_scope_unknown __itt_scope_unknown
24930b57cec5SDimitry Andric #define __itt_marker_scope_global __itt_scope_global
24940b57cec5SDimitry Andric #define __itt_marker_scope_process __itt_scope_track_group
24950b57cec5SDimitry Andric #define __itt_marker_scope_thread __itt_scope_track
24960b57cec5SDimitry Andric #define __itt_marker_scope_task __itt_scope_task
24970b57cec5SDimitry Andric /** @endcond */
24980b57cec5SDimitry Andric 
24990b57cec5SDimitry Andric /**
25000b57cec5SDimitry Andric  * @ingroup markers
25010b57cec5SDimitry Andric  * @brief Create a marker instance
25020b57cec5SDimitry Andric  * @param[in] domain The domain for this marker
25030b57cec5SDimitry Andric  * @param[in] id The instance ID for this marker or __itt_null
25040b57cec5SDimitry Andric  * @param[in] name The name for this marker
25050b57cec5SDimitry Andric  * @param[in] scope The scope for this marker
25060b57cec5SDimitry Andric  */
2507fe6060f1SDimitry Andric void ITTAPI __itt_marker(const __itt_domain *domain, __itt_id id,
2508fe6060f1SDimitry Andric                          __itt_string_handle *name, __itt_scope scope);
25090b57cec5SDimitry Andric 
25100b57cec5SDimitry Andric /** @cond exclude_from_documentation */
25110b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
25120b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2513fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, marker,
2514fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_string_handle *name,
2515fe6060f1SDimitry Andric            __itt_scope scope))
25160b57cec5SDimitry Andric #define __itt_marker(d, x, y, z) ITTNOTIFY_VOID_D3(marker, d, x, y, z)
25170b57cec5SDimitry Andric #define __itt_marker_ptr ITTNOTIFY_NAME(marker)
25180b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
25190b57cec5SDimitry Andric #define __itt_marker(domain, id, name, scope)
25200b57cec5SDimitry Andric #define __itt_marker_ptr 0
25210b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
25220b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
25230b57cec5SDimitry Andric #define __itt_marker_ptr 0
25240b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
25250b57cec5SDimitry Andric /** @endcond */
25260b57cec5SDimitry Andric /** @} markers group */
25270b57cec5SDimitry Andric 
25280b57cec5SDimitry Andric /**
25290b57cec5SDimitry Andric  * @defgroup metadata Metadata
25300b57cec5SDimitry Andric  * The metadata API is used to attach extra information to named
25310b57cec5SDimitry Andric  * entities. Metadata can be attached to an identified named entity by ID,
25320b57cec5SDimitry Andric  * or to the current entity (which is always a task).
25330b57cec5SDimitry Andric  *
25340b57cec5SDimitry Andric  * Conceptually metadata has a type (what kind of metadata), a key (the
25350b57cec5SDimitry Andric  * name of the metadata), and a value (the actual data). The encoding of
25360b57cec5SDimitry Andric  * the value depends on the type of the metadata.
25370b57cec5SDimitry Andric  *
2538349cc55cSDimitry Andric  * The type of metadata is specified by an enumerated type __itt_metdata_type.
25390b57cec5SDimitry Andric  * @{
25400b57cec5SDimitry Andric  */
25410b57cec5SDimitry Andric 
25420b57cec5SDimitry Andric /**
25430b57cec5SDimitry Andric  * @ingroup parameters
25440b57cec5SDimitry Andric  * @brief describes the type of metadata
25450b57cec5SDimitry Andric  */
25460b57cec5SDimitry Andric typedef enum {
25470b57cec5SDimitry Andric   __itt_metadata_unknown = 0,
25480b57cec5SDimitry Andric   __itt_metadata_u64, /**< Unsigned 64-bit integer */
25490b57cec5SDimitry Andric   __itt_metadata_s64, /**< Signed 64-bit integer */
25500b57cec5SDimitry Andric   __itt_metadata_u32, /**< Unsigned 32-bit integer */
25510b57cec5SDimitry Andric   __itt_metadata_s32, /**< Signed 32-bit integer */
25520b57cec5SDimitry Andric   __itt_metadata_u16, /**< Unsigned 16-bit integer */
25530b57cec5SDimitry Andric   __itt_metadata_s16, /**< Signed 16-bit integer */
25540b57cec5SDimitry Andric   __itt_metadata_float, /**< Signed 32-bit floating-point */
25550b57cec5SDimitry Andric   __itt_metadata_double /**< SIgned 64-bit floating-point */
25560b57cec5SDimitry Andric } __itt_metadata_type;
25570b57cec5SDimitry Andric 
25580b57cec5SDimitry Andric /**
25590b57cec5SDimitry Andric  * @ingroup parameters
25600b57cec5SDimitry Andric  * @brief Add metadata to an instance of a named entity.
25610b57cec5SDimitry Andric  * @param[in] domain The domain controlling the call
2562fe6060f1SDimitry Andric  * @param[in] id The identifier of the instance to which the metadata is to be
2563fe6060f1SDimitry Andric  * added, or __itt_null to add to the current task
25640b57cec5SDimitry Andric  * @param[in] key The name of the metadata
25650b57cec5SDimitry Andric  * @param[in] type The type of the metadata
2566fe6060f1SDimitry Andric  * @param[in] count The number of elements of the given type. If count == 0, no
2567fe6060f1SDimitry Andric  * metadata will be added.
25680b57cec5SDimitry Andric  * @param[in] data The metadata itself
25690b57cec5SDimitry Andric  */
2570fe6060f1SDimitry Andric void ITTAPI __itt_metadata_add(const __itt_domain *domain, __itt_id id,
2571fe6060f1SDimitry Andric                                __itt_string_handle *key,
2572fe6060f1SDimitry Andric                                __itt_metadata_type type, size_t count,
2573fe6060f1SDimitry Andric                                void *data);
25740b57cec5SDimitry Andric 
25750b57cec5SDimitry Andric /** @cond exclude_from_documentation */
25760b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
25770b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2578fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_add,
2579fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2580fe6060f1SDimitry Andric            __itt_metadata_type type, size_t count, void *data))
2581fe6060f1SDimitry Andric #define __itt_metadata_add(d, x, y, z, a, b)                                   \
2582fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D5(metadata_add, d, x, y, z, a, b)
25830b57cec5SDimitry Andric #define __itt_metadata_add_ptr ITTNOTIFY_NAME(metadata_add)
25840b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
25850b57cec5SDimitry Andric #define __itt_metadata_add(d, x, y, z, a, b)
25860b57cec5SDimitry Andric #define __itt_metadata_add_ptr 0
25870b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
25880b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
25890b57cec5SDimitry Andric #define __itt_metadata_add_ptr 0
25900b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
25910b57cec5SDimitry Andric /** @endcond */
25920b57cec5SDimitry Andric 
25930b57cec5SDimitry Andric /**
25940b57cec5SDimitry Andric  * @ingroup parameters
25950b57cec5SDimitry Andric  * @brief Add string metadata to an instance of a named entity.
25960b57cec5SDimitry Andric  * @param[in] domain The domain controlling the call
2597fe6060f1SDimitry Andric  * @param[in] id The identifier of the instance to which the metadata is to be
2598fe6060f1SDimitry Andric  * added, or __itt_null to add to the current task
25990b57cec5SDimitry Andric  * @param[in] key The name of the metadata
26000b57cec5SDimitry Andric  * @param[in] data The metadata itself
2601fe6060f1SDimitry Andric  * @param[in] length The number of characters in the string, or -1 if the length
2602fe6060f1SDimitry Andric  * is unknown but the string is null-terminated
26030b57cec5SDimitry Andric  */
26040b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
2605fe6060f1SDimitry Andric void ITTAPI __itt_metadata_str_addA(const __itt_domain *domain, __itt_id id,
2606fe6060f1SDimitry Andric                                     __itt_string_handle *key, const char *data,
2607fe6060f1SDimitry Andric                                     size_t length);
2608fe6060f1SDimitry Andric void ITTAPI __itt_metadata_str_addW(const __itt_domain *domain, __itt_id id,
2609fe6060f1SDimitry Andric                                     __itt_string_handle *key,
2610fe6060f1SDimitry Andric                                     const wchar_t *data, size_t length);
26110b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
26120b57cec5SDimitry Andric #define __itt_metadata_str_add __itt_metadata_str_addW
26130b57cec5SDimitry Andric #define __itt_metadata_str_add_ptr __itt_metadata_str_addW_ptr
26140b57cec5SDimitry Andric #else /* UNICODE */
26150b57cec5SDimitry Andric #define __itt_metadata_str_add __itt_metadata_str_addA
26160b57cec5SDimitry Andric #define __itt_metadata_str_add_ptr __itt_metadata_str_addA_ptr
26170b57cec5SDimitry Andric #endif /* UNICODE */
26180b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2619fe6060f1SDimitry Andric void ITTAPI __itt_metadata_str_add(const __itt_domain *domain, __itt_id id,
2620fe6060f1SDimitry Andric                                    __itt_string_handle *key, const char *data,
2621fe6060f1SDimitry Andric                                    size_t length);
26220b57cec5SDimitry Andric #endif
26230b57cec5SDimitry Andric 
26240b57cec5SDimitry Andric /** @cond exclude_from_documentation */
26250b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
26260b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
26270b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
2628fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_str_addA,
2629fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2630fe6060f1SDimitry Andric            const char *data, size_t length))
2631fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_str_addW,
2632fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2633fe6060f1SDimitry Andric            const wchar_t *data, size_t length))
26340b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2635fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_str_add,
2636fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2637fe6060f1SDimitry Andric            const char *data, size_t length))
26380b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
26390b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
2640fe6060f1SDimitry Andric #define __itt_metadata_str_addA(d, x, y, z, a)                                 \
2641fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D4(metadata_str_addA, d, x, y, z, a)
26420b57cec5SDimitry Andric #define __itt_metadata_str_addA_ptr ITTNOTIFY_NAME(metadata_str_addA)
2643fe6060f1SDimitry Andric #define __itt_metadata_str_addW(d, x, y, z, a)                                 \
2644fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D4(metadata_str_addW, d, x, y, z, a)
26450b57cec5SDimitry Andric #define __itt_metadata_str_addW_ptr ITTNOTIFY_NAME(metadata_str_addW)
26460b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2647fe6060f1SDimitry Andric #define __itt_metadata_str_add(d, x, y, z, a)                                  \
2648fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D4(metadata_str_add, d, x, y, z, a)
26490b57cec5SDimitry Andric #define __itt_metadata_str_add_ptr ITTNOTIFY_NAME(metadata_str_add)
26500b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
26510b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
26520b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
26530b57cec5SDimitry Andric #define __itt_metadata_str_addA(d, x, y, z, a)
26540b57cec5SDimitry Andric #define __itt_metadata_str_addA_ptr 0
26550b57cec5SDimitry Andric #define __itt_metadata_str_addW(d, x, y, z, a)
26560b57cec5SDimitry Andric #define __itt_metadata_str_addW_ptr 0
26570b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
26580b57cec5SDimitry Andric #define __itt_metadata_str_add(d, x, y, z, a)
26590b57cec5SDimitry Andric #define __itt_metadata_str_add_ptr 0
26600b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
26610b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
26620b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
26630b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
26640b57cec5SDimitry Andric #define __itt_metadata_str_addA_ptr 0
26650b57cec5SDimitry Andric #define __itt_metadata_str_addW_ptr 0
26660b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
26670b57cec5SDimitry Andric #define __itt_metadata_str_add_ptr 0
26680b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
26690b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
26700b57cec5SDimitry Andric /** @endcond */
26710b57cec5SDimitry Andric 
26720b57cec5SDimitry Andric /**
26730b57cec5SDimitry Andric  * @ingroup parameters
26740b57cec5SDimitry Andric  * @brief Add metadata to an instance of a named entity.
26750b57cec5SDimitry Andric  * @param[in] domain The domain controlling the call
2676fe6060f1SDimitry Andric  * @param[in] scope The scope of the instance to which the metadata is to be
2677fe6060f1SDimitry Andric  added
26780b57cec5SDimitry Andric 
2679fe6060f1SDimitry Andric  * @param[in] id The identifier of the instance to which the metadata is to be
2680fe6060f1SDimitry Andric  added, or __itt_null to add to the current task
26810b57cec5SDimitry Andric 
26820b57cec5SDimitry Andric  * @param[in] key The name of the metadata
26830b57cec5SDimitry Andric  * @param[in] type The type of the metadata
2684fe6060f1SDimitry Andric  * @param[in] count The number of elements of the given type. If count == 0, no
2685fe6060f1SDimitry Andric  metadata will be added.
26860b57cec5SDimitry Andric  * @param[in] data The metadata itself
26870b57cec5SDimitry Andric */
2688fe6060f1SDimitry Andric void ITTAPI __itt_metadata_add_with_scope(const __itt_domain *domain,
2689fe6060f1SDimitry Andric                                           __itt_scope scope,
2690fe6060f1SDimitry Andric                                           __itt_string_handle *key,
2691fe6060f1SDimitry Andric                                           __itt_metadata_type type,
2692fe6060f1SDimitry Andric                                           size_t count, void *data);
26930b57cec5SDimitry Andric 
26940b57cec5SDimitry Andric /** @cond exclude_from_documentation */
26950b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
26960b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2697fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_add_with_scope,
2698fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_scope scope,
2699fe6060f1SDimitry Andric            __itt_string_handle *key, __itt_metadata_type type, size_t count,
2700fe6060f1SDimitry Andric            void *data))
2701fe6060f1SDimitry Andric #define __itt_metadata_add_with_scope(d, x, y, z, a, b)                        \
2702fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D5(metadata_add_with_scope, d, x, y, z, a, b)
2703fe6060f1SDimitry Andric #define __itt_metadata_add_with_scope_ptr                                      \
2704fe6060f1SDimitry Andric   ITTNOTIFY_NAME(metadata_add_with_scope)
27050b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
27060b57cec5SDimitry Andric #define __itt_metadata_add_with_scope(d, x, y, z, a, b)
27070b57cec5SDimitry Andric #define __itt_metadata_add_with_scope_ptr 0
27080b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
27090b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
27100b57cec5SDimitry Andric #define __itt_metadata_add_with_scope_ptr 0
27110b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
27120b57cec5SDimitry Andric /** @endcond */
27130b57cec5SDimitry Andric 
27140b57cec5SDimitry Andric /**
27150b57cec5SDimitry Andric  * @ingroup parameters
27160b57cec5SDimitry Andric  * @brief Add string metadata to an instance of a named entity.
27170b57cec5SDimitry Andric  * @param[in] domain The domain controlling the call
2718fe6060f1SDimitry Andric  * @param[in] scope The scope of the instance to which the metadata is to be
2719fe6060f1SDimitry Andric  added
27200b57cec5SDimitry Andric 
2721fe6060f1SDimitry Andric  * @param[in] id The identifier of the instance to which the metadata is to be
2722fe6060f1SDimitry Andric  added, or __itt_null to add to the current task
27230b57cec5SDimitry Andric 
27240b57cec5SDimitry Andric  * @param[in] key The name of the metadata
27250b57cec5SDimitry Andric  * @param[in] data The metadata itself
2726fe6060f1SDimitry Andric  * @param[in] length The number of characters in the string, or -1 if the length
2727fe6060f1SDimitry Andric  is unknown but the string is null-terminated
27280b57cec5SDimitry Andric */
27290b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
2730fe6060f1SDimitry Andric void ITTAPI __itt_metadata_str_add_with_scopeA(const __itt_domain *domain,
2731fe6060f1SDimitry Andric                                                __itt_scope scope,
2732fe6060f1SDimitry Andric                                                __itt_string_handle *key,
2733fe6060f1SDimitry Andric                                                const char *data, size_t length);
2734fe6060f1SDimitry Andric void ITTAPI __itt_metadata_str_add_with_scopeW(const __itt_domain *domain,
2735fe6060f1SDimitry Andric                                                __itt_scope scope,
2736fe6060f1SDimitry Andric                                                __itt_string_handle *key,
2737fe6060f1SDimitry Andric                                                const wchar_t *data,
2738fe6060f1SDimitry Andric                                                size_t length);
27390b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
27400b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeW
2741fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scope_ptr                                  \
2742fe6060f1SDimitry Andric   __itt_metadata_str_add_with_scopeW_ptr
27430b57cec5SDimitry Andric #else /* UNICODE */
27440b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeA
2745fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scope_ptr                                  \
2746fe6060f1SDimitry Andric   __itt_metadata_str_add_with_scopeA_ptr
27470b57cec5SDimitry Andric #endif /* UNICODE */
27480b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2749fe6060f1SDimitry Andric void ITTAPI __itt_metadata_str_add_with_scope(const __itt_domain *domain,
2750fe6060f1SDimitry Andric                                               __itt_scope scope,
2751fe6060f1SDimitry Andric                                               __itt_string_handle *key,
2752fe6060f1SDimitry Andric                                               const char *data, size_t length);
27530b57cec5SDimitry Andric #endif
27540b57cec5SDimitry Andric 
27550b57cec5SDimitry Andric /** @cond exclude_from_documentation */
27560b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
27570b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
27580b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
2759fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA,
2760fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_scope scope,
2761fe6060f1SDimitry Andric            __itt_string_handle *key, const char *data, size_t length))
2762fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW,
2763fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_scope scope,
2764fe6060f1SDimitry Andric            __itt_string_handle *key, const wchar_t *data, size_t length))
27650b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2766fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope,
2767fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_scope scope,
2768fe6060f1SDimitry Andric            __itt_string_handle *key, const char *data, size_t length))
27690b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
27700b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
2771fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scopeA(d, x, y, z, a)                      \
2772fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeA, d, x, y, z, a)
2773fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scopeA_ptr                                 \
2774fe6060f1SDimitry Andric   ITTNOTIFY_NAME(metadata_str_add_with_scopeA)
2775fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scopeW(d, x, y, z, a)                      \
2776fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeW, d, x, y, z, a)
2777fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scopeW_ptr                                 \
2778fe6060f1SDimitry Andric   ITTNOTIFY_NAME(metadata_str_add_with_scopeW)
27790b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2780fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scope(d, x, y, z, a)                       \
2781fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D4(metadata_str_add_with_scope, d, x, y, z, a)
2782fe6060f1SDimitry Andric #define __itt_metadata_str_add_with_scope_ptr                                  \
2783fe6060f1SDimitry Andric   ITTNOTIFY_NAME(metadata_str_add_with_scope)
27840b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
27850b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
27860b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
27870b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scopeA(d, x, y, z, a)
27880b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scopeA_ptr 0
27890b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scopeW(d, x, y, z, a)
27900b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scopeW_ptr 0
27910b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
27920b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scope(d, x, y, z, a)
27930b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scope_ptr 0
27940b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
27950b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
27960b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
27970b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
27980b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scopeA_ptr 0
27990b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scopeW_ptr 0
28000b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
28010b57cec5SDimitry Andric #define __itt_metadata_str_add_with_scope_ptr 0
28020b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
28030b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
28040b57cec5SDimitry Andric /** @endcond */
28050b57cec5SDimitry Andric 
28060b57cec5SDimitry Andric /** @} metadata group */
28070b57cec5SDimitry Andric 
28080b57cec5SDimitry Andric /**
28090b57cec5SDimitry Andric  * @defgroup relations Relations
28100b57cec5SDimitry Andric  * Instances of named entities can be explicitly associated with other
28110b57cec5SDimitry Andric  * instances using instance IDs and the relationship API calls.
28120b57cec5SDimitry Andric  *
28130b57cec5SDimitry Andric  * @{
28140b57cec5SDimitry Andric  */
28150b57cec5SDimitry Andric 
28160b57cec5SDimitry Andric /**
28170b57cec5SDimitry Andric  * @ingroup relations
2818fe6060f1SDimitry Andric  * @brief The kind of relation between two instances is specified by the
2819fe6060f1SDimitry Andric  * enumerated type __itt_relation. Relations between instances can be added with
2820fe6060f1SDimitry Andric  * an API call. The relation API uses instance IDs. Relations can be added
2821fe6060f1SDimitry Andric  * before or after the actual instances are created and persist independently of
2822fe6060f1SDimitry Andric  * the instances. This is the motivation for having different lifetimes for
2823fe6060f1SDimitry Andric  * instance IDs and the actual instances.
28240b57cec5SDimitry Andric  */
2825fe6060f1SDimitry Andric typedef enum {
28260b57cec5SDimitry Andric   __itt_relation_is_unknown = 0,
2827fe6060f1SDimitry Andric   __itt_relation_is_dependent_on, /**< "A is dependent on B" means that A cannot
2828fe6060f1SDimitry Andric                                      start until B completes */
2829fe6060f1SDimitry Andric   __itt_relation_is_sibling_of, /**< "A is sibling of B" means that A and B were
2830fe6060f1SDimitry Andric                                    created as a group */
28310b57cec5SDimitry Andric   __itt_relation_is_parent_of, /**< "A is parent of B" means that A created B */
2832fe6060f1SDimitry Andric   __itt_relation_is_continuation_of, /**< "A is continuation of B" means that A
2833fe6060f1SDimitry Andric                                         assumes the dependencies of B */
2834fe6060f1SDimitry Andric   __itt_relation_is_child_of, /**< "A is child of B" means that A was created by
2835fe6060f1SDimitry Andric                                  B (inverse of is_parent_of) */
2836fe6060f1SDimitry Andric   __itt_relation_is_continued_by, /**< "A is continued by B" means that B
2837fe6060f1SDimitry Andric                                      assumes the dependencies of A (inverse of
2838fe6060f1SDimitry Andric                                      is_continuation_of) */
2839fe6060f1SDimitry Andric   __itt_relation_is_predecessor_to /**< "A is predecessor to B" means that B
2840fe6060f1SDimitry Andric                                       cannot start until A completes (inverse of
2841fe6060f1SDimitry Andric                                       is_dependent_on) */
28420b57cec5SDimitry Andric } __itt_relation;
28430b57cec5SDimitry Andric 
28440b57cec5SDimitry Andric /**
28450b57cec5SDimitry Andric  * @ingroup relations
28460b57cec5SDimitry Andric  * @brief Add a relation to the current task instance.
28470b57cec5SDimitry Andric  * The current task instance is the head of the relation.
28480b57cec5SDimitry Andric  * @param[in] domain The domain controlling this call
28490b57cec5SDimitry Andric  * @param[in] relation The kind of relation
28500b57cec5SDimitry Andric  * @param[in] tail The ID for the tail of the relation
28510b57cec5SDimitry Andric  */
2852fe6060f1SDimitry Andric void ITTAPI __itt_relation_add_to_current(const __itt_domain *domain,
2853fe6060f1SDimitry Andric                                           __itt_relation relation,
2854fe6060f1SDimitry Andric                                           __itt_id tail);
28550b57cec5SDimitry Andric 
28560b57cec5SDimitry Andric /**
28570b57cec5SDimitry Andric  * @ingroup relations
28580b57cec5SDimitry Andric  * @brief Add a relation between two instance identifiers.
28590b57cec5SDimitry Andric  * @param[in] domain The domain controlling this call
28600b57cec5SDimitry Andric  * @param[in] head The ID for the head of the relation
28610b57cec5SDimitry Andric  * @param[in] relation The kind of relation
28620b57cec5SDimitry Andric  * @param[in] tail The ID for the tail of the relation
28630b57cec5SDimitry Andric  */
2864fe6060f1SDimitry Andric void ITTAPI __itt_relation_add(const __itt_domain *domain, __itt_id head,
2865fe6060f1SDimitry Andric                                __itt_relation relation, __itt_id tail);
28660b57cec5SDimitry Andric 
28670b57cec5SDimitry Andric /** @cond exclude_from_documentation */
28680b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
28690b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2870fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, relation_add_to_current,
2871fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_relation relation, __itt_id tail))
2872fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, relation_add,
2873fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_id head, __itt_relation relation,
2874fe6060f1SDimitry Andric            __itt_id tail))
2875fe6060f1SDimitry Andric #define __itt_relation_add_to_current(d, x, y)                                 \
2876fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D2(relation_add_to_current, d, x, y)
2877fe6060f1SDimitry Andric #define __itt_relation_add_to_current_ptr                                      \
2878fe6060f1SDimitry Andric   ITTNOTIFY_NAME(relation_add_to_current)
2879fe6060f1SDimitry Andric #define __itt_relation_add(d, x, y, z)                                         \
2880fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(relation_add, d, x, y, z)
28810b57cec5SDimitry Andric #define __itt_relation_add_ptr ITTNOTIFY_NAME(relation_add)
28820b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
28830b57cec5SDimitry Andric #define __itt_relation_add_to_current(d, x, y)
28840b57cec5SDimitry Andric #define __itt_relation_add_to_current_ptr 0
28850b57cec5SDimitry Andric #define __itt_relation_add(d, x, y, z)
28860b57cec5SDimitry Andric #define __itt_relation_add_ptr 0
28870b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
28880b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
28890b57cec5SDimitry Andric #define __itt_relation_add_to_current_ptr 0
28900b57cec5SDimitry Andric #define __itt_relation_add_ptr 0
28910b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
28920b57cec5SDimitry Andric /** @endcond */
28930b57cec5SDimitry Andric /** @} relations group */
28940b57cec5SDimitry Andric 
28950b57cec5SDimitry Andric /** @cond exclude_from_documentation */
28960b57cec5SDimitry Andric #pragma pack(push, 8)
28970b57cec5SDimitry Andric 
2898fe6060f1SDimitry Andric typedef struct ___itt_clock_info {
28990b57cec5SDimitry Andric   unsigned long long clock_freq; /*!< Clock domain frequency */
29000b57cec5SDimitry Andric   unsigned long long clock_base; /*!< Clock domain base timestamp */
29010b57cec5SDimitry Andric } __itt_clock_info;
29020b57cec5SDimitry Andric 
29030b57cec5SDimitry Andric #pragma pack(pop)
29040b57cec5SDimitry Andric /** @endcond */
29050b57cec5SDimitry Andric 
29060b57cec5SDimitry Andric /** @cond exclude_from_documentation */
2907fe6060f1SDimitry Andric typedef void(ITTAPI *__itt_get_clock_info_fn)(__itt_clock_info *clock_info,
2908fe6060f1SDimitry Andric                                               void *data);
29090b57cec5SDimitry Andric /** @endcond */
29100b57cec5SDimitry Andric 
29110b57cec5SDimitry Andric /** @cond exclude_from_documentation */
29120b57cec5SDimitry Andric #pragma pack(push, 8)
29130b57cec5SDimitry Andric 
2914fe6060f1SDimitry Andric typedef struct ___itt_clock_domain {
29150b57cec5SDimitry Andric   __itt_clock_info info; /*!< Most recent clock domain info */
29160b57cec5SDimitry Andric   __itt_get_clock_info_fn fn; /*!< Callback function pointer */
29170b57cec5SDimitry Andric   void *fn_data; /*!< Input argument for the callback function */
29180b57cec5SDimitry Andric   int extra1; /*!< Reserved. Must be zero */
29190b57cec5SDimitry Andric   void *extra2; /*!< Reserved. Must be zero */
29200b57cec5SDimitry Andric   struct ___itt_clock_domain *next;
29210b57cec5SDimitry Andric } __itt_clock_domain;
29220b57cec5SDimitry Andric 
29230b57cec5SDimitry Andric #pragma pack(pop)
29240b57cec5SDimitry Andric /** @endcond */
29250b57cec5SDimitry Andric 
29260b57cec5SDimitry Andric /**
29270b57cec5SDimitry Andric  * @ingroup clockdomains
29280b57cec5SDimitry Andric  * @brief Create a clock domain.
29290b57cec5SDimitry Andric  * Certain applications require the capability to trace their application using
2930fe6060f1SDimitry Andric  * a clock domain different than the CPU, for instance the instrumentation of
2931fe6060f1SDimitry Andric  * events that occur on a GPU. Because the set of domains is expected to be
2932fe6060f1SDimitry Andric  * static over the application's execution time, there is no mechanism to
2933fe6060f1SDimitry Andric  * destroy a domain. Any domain can be accessed by any thread in the process,
2934fe6060f1SDimitry Andric  * regardless of which thread created the domain. This call is thread-safe.
2935fe6060f1SDimitry Andric  * @param[in] fn A pointer to a callback function which retrieves alternative
2936fe6060f1SDimitry Andric  * CPU timestamps
29370b57cec5SDimitry Andric  * @param[in] fn_data Argument for a callback function; may be NULL
29380b57cec5SDimitry Andric  */
2939fe6060f1SDimitry Andric __itt_clock_domain *ITTAPI __itt_clock_domain_create(__itt_get_clock_info_fn fn,
2940fe6060f1SDimitry Andric                                                      void *fn_data);
29410b57cec5SDimitry Andric 
29420b57cec5SDimitry Andric /** @cond exclude_from_documentation */
29430b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
29440b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
2945fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_clock_domain *, clock_domain_create,
2946fe6060f1SDimitry Andric          (__itt_get_clock_info_fn fn, void *fn_data))
29470b57cec5SDimitry Andric #define __itt_clock_domain_create ITTNOTIFY_DATA(clock_domain_create)
29480b57cec5SDimitry Andric #define __itt_clock_domain_create_ptr ITTNOTIFY_NAME(clock_domain_create)
29490b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
29500b57cec5SDimitry Andric #define __itt_clock_domain_create(fn, fn_data) (__itt_clock_domain *)0
29510b57cec5SDimitry Andric #define __itt_clock_domain_create_ptr 0
29520b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
29530b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
29540b57cec5SDimitry Andric #define __itt_clock_domain_create_ptr 0
29550b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
29560b57cec5SDimitry Andric /** @endcond */
29570b57cec5SDimitry Andric 
29580b57cec5SDimitry Andric /**
29590b57cec5SDimitry Andric  * @ingroup clockdomains
2960480093f4SDimitry Andric  * @brief Recalculate clock domains frequencies and clock base timestamps.
29610b57cec5SDimitry Andric  */
29620b57cec5SDimitry Andric void ITTAPI __itt_clock_domain_reset(void);
29630b57cec5SDimitry Andric 
29640b57cec5SDimitry Andric /** @cond exclude_from_documentation */
29650b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
29660b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
29670b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, clock_domain_reset, (void))
29680b57cec5SDimitry Andric #define __itt_clock_domain_reset ITTNOTIFY_VOID(clock_domain_reset)
29690b57cec5SDimitry Andric #define __itt_clock_domain_reset_ptr ITTNOTIFY_NAME(clock_domain_reset)
29700b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
29710b57cec5SDimitry Andric #define __itt_clock_domain_reset()
29720b57cec5SDimitry Andric #define __itt_clock_domain_reset_ptr 0
29730b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
29740b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
29750b57cec5SDimitry Andric #define __itt_clock_domain_reset_ptr 0
29760b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
29770b57cec5SDimitry Andric /** @endcond */
29780b57cec5SDimitry Andric 
29790b57cec5SDimitry Andric /**
29800b57cec5SDimitry Andric  * @ingroup clockdomain
2981fe6060f1SDimitry Andric  * @brief Create an instance of identifier. This establishes the beginning of
2982fe6060f1SDimitry Andric  * the lifetime of an instance of the given ID in the trace. Once this lifetime
2983fe6060f1SDimitry Andric  * starts, the ID can be used to tag named entity instances in calls such as
2984fe6060f1SDimitry Andric  * __itt_task_begin, and to specify relationships among identified named entity
2985fe6060f1SDimitry Andric  * instances, using the \ref relations APIs.
29860b57cec5SDimitry Andric  * @param[in] domain The domain controlling the execution of this call.
2987fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
2988fe6060f1SDimitry Andric  * call.
29890b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
29900b57cec5SDimitry Andric  * @param[in] id The ID to create.
29910b57cec5SDimitry Andric  */
2992fe6060f1SDimitry Andric void ITTAPI __itt_id_create_ex(const __itt_domain *domain,
2993fe6060f1SDimitry Andric                                __itt_clock_domain *clock_domain,
2994fe6060f1SDimitry Andric                                unsigned long long timestamp, __itt_id id);
29950b57cec5SDimitry Andric 
29960b57cec5SDimitry Andric /**
29970b57cec5SDimitry Andric  * @ingroup clockdomain
2998fe6060f1SDimitry Andric  * @brief Destroy an instance of identifier. This ends the lifetime of the
2999fe6060f1SDimitry Andric  * current instance of the given ID value in the trace. Any relationships that
3000fe6060f1SDimitry Andric  * are established after this lifetime ends are invalid. This call must be
3001fe6060f1SDimitry Andric  * performed before the given ID value can be reused for a different named
3002fe6060f1SDimitry Andric  * entity instance.
30030b57cec5SDimitry Andric  * @param[in] domain The domain controlling the execution of this call.
3004fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
3005fe6060f1SDimitry Andric  * call.
30060b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
30070b57cec5SDimitry Andric  * @param[in] id The ID to destroy.
30080b57cec5SDimitry Andric  */
3009fe6060f1SDimitry Andric void ITTAPI __itt_id_destroy_ex(const __itt_domain *domain,
3010fe6060f1SDimitry Andric                                 __itt_clock_domain *clock_domain,
3011fe6060f1SDimitry Andric                                 unsigned long long timestamp, __itt_id id);
30120b57cec5SDimitry Andric 
30130b57cec5SDimitry Andric /** @cond exclude_from_documentation */
30140b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
30150b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3016fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, id_create_ex,
3017fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3018fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id id))
3019fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, id_destroy_ex,
3020fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3021fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id id))
3022fe6060f1SDimitry Andric #define __itt_id_create_ex(d, x, y, z)                                         \
3023fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(id_create_ex, d, x, y, z)
30240b57cec5SDimitry Andric #define __itt_id_create_ex_ptr ITTNOTIFY_NAME(id_create_ex)
3025fe6060f1SDimitry Andric #define __itt_id_destroy_ex(d, x, y, z)                                        \
3026fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(id_destroy_ex, d, x, y, z)
30270b57cec5SDimitry Andric #define __itt_id_destroy_ex_ptr ITTNOTIFY_NAME(id_destroy_ex)
30280b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
30290b57cec5SDimitry Andric #define __itt_id_create_ex(domain, clock_domain, timestamp, id)
30300b57cec5SDimitry Andric #define __itt_id_create_ex_ptr 0
30310b57cec5SDimitry Andric #define __itt_id_destroy_ex(domain, clock_domain, timestamp, id)
30320b57cec5SDimitry Andric #define __itt_id_destroy_ex_ptr 0
30330b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
30340b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
30350b57cec5SDimitry Andric #define __itt_id_create_ex_ptr 0
30360b57cec5SDimitry Andric #define __itt_id_destroy_ex_ptr 0
30370b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
30380b57cec5SDimitry Andric /** @endcond */
30390b57cec5SDimitry Andric 
30400b57cec5SDimitry Andric /**
30410b57cec5SDimitry Andric  * @ingroup clockdomain
30420b57cec5SDimitry Andric  * @brief Begin a task instance.
30430b57cec5SDimitry Andric  * @param[in] domain The domain for this task
3044fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
3045fe6060f1SDimitry Andric  * call.
30460b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
30470b57cec5SDimitry Andric  * @param[in] taskid The instance ID for this task instance, or __itt_null
3048fe6060f1SDimitry Andric  * @param[in] parentid The parent instance to which this task instance belongs,
3049fe6060f1SDimitry Andric  * or __itt_null
30500b57cec5SDimitry Andric  * @param[in] name The name of this task
30510b57cec5SDimitry Andric  */
3052fe6060f1SDimitry Andric void ITTAPI __itt_task_begin_ex(const __itt_domain *domain,
3053fe6060f1SDimitry Andric                                 __itt_clock_domain *clock_domain,
3054fe6060f1SDimitry Andric                                 unsigned long long timestamp, __itt_id taskid,
3055fe6060f1SDimitry Andric                                 __itt_id parentid, __itt_string_handle *name);
30560b57cec5SDimitry Andric 
30570b57cec5SDimitry Andric /**
30580b57cec5SDimitry Andric  * @ingroup clockdomain
30590b57cec5SDimitry Andric  * @brief Begin a task instance.
30600b57cec5SDimitry Andric  * @param[in] domain The domain for this task
3061fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
3062fe6060f1SDimitry Andric  * call.
30630b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
30640b57cec5SDimitry Andric  * @param[in] taskid The identifier for this task instance, or __itt_null
30650b57cec5SDimitry Andric  * @param[in] parentid The parent of this task, or __itt_null
30660b57cec5SDimitry Andric  * @param[in] fn The pointer to the function you are tracing
30670b57cec5SDimitry Andric  */
3068fe6060f1SDimitry Andric void ITTAPI __itt_task_begin_fn_ex(const __itt_domain *domain,
3069fe6060f1SDimitry Andric                                    __itt_clock_domain *clock_domain,
3070fe6060f1SDimitry Andric                                    unsigned long long timestamp,
3071fe6060f1SDimitry Andric                                    __itt_id taskid, __itt_id parentid,
3072fe6060f1SDimitry Andric                                    void *fn);
30730b57cec5SDimitry Andric 
30740b57cec5SDimitry Andric /**
30750b57cec5SDimitry Andric  * @ingroup clockdomain
30760b57cec5SDimitry Andric  * @brief End the current task instance.
30770b57cec5SDimitry Andric  * @param[in] domain The domain for this task
3078fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
3079fe6060f1SDimitry Andric  * call.
30800b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
30810b57cec5SDimitry Andric  */
3082fe6060f1SDimitry Andric void ITTAPI __itt_task_end_ex(const __itt_domain *domain,
3083fe6060f1SDimitry Andric                               __itt_clock_domain *clock_domain,
3084fe6060f1SDimitry Andric                               unsigned long long timestamp);
30850b57cec5SDimitry Andric 
30860b57cec5SDimitry Andric /** @cond exclude_from_documentation */
30870b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
30880b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3089fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_begin_ex,
3090fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3091fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id id, __itt_id parentid,
3092fe6060f1SDimitry Andric            __itt_string_handle *name))
3093fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_begin_fn_ex,
3094fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3095fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id id, __itt_id parentid,
3096fe6060f1SDimitry Andric            void *fn))
3097fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_end_ex,
3098fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3099fe6060f1SDimitry Andric            unsigned long long timestamp))
3100fe6060f1SDimitry Andric #define __itt_task_begin_ex(d, x, y, z, a, b)                                  \
3101fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D5(task_begin_ex, d, x, y, z, a, b)
31020b57cec5SDimitry Andric #define __itt_task_begin_ex_ptr ITTNOTIFY_NAME(task_begin_ex)
3103fe6060f1SDimitry Andric #define __itt_task_begin_fn_ex(d, x, y, z, a, b)                               \
3104fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D5(task_begin_fn_ex, d, x, y, z, a, b)
31050b57cec5SDimitry Andric #define __itt_task_begin_fn_ex_ptr ITTNOTIFY_NAME(task_begin_fn_ex)
31060b57cec5SDimitry Andric #define __itt_task_end_ex(d, x, y) ITTNOTIFY_VOID_D2(task_end_ex, d, x, y)
31070b57cec5SDimitry Andric #define __itt_task_end_ex_ptr ITTNOTIFY_NAME(task_end_ex)
31080b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
31090b57cec5SDimitry Andric #define __itt_task_begin_ex(domain, clock_domain, timestamp, id, parentid, name)
31100b57cec5SDimitry Andric #define __itt_task_begin_ex_ptr 0
3111fe6060f1SDimitry Andric #define __itt_task_begin_fn_ex(domain, clock_domain, timestamp, id, parentid,  \
3112fe6060f1SDimitry Andric                                fn)
31130b57cec5SDimitry Andric #define __itt_task_begin_fn_ex_ptr 0
31140b57cec5SDimitry Andric #define __itt_task_end_ex(domain, clock_domain, timestamp)
31150b57cec5SDimitry Andric #define __itt_task_end_ex_ptr 0
31160b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
31170b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
31180b57cec5SDimitry Andric #define __itt_task_begin_ex_ptr 0
31190b57cec5SDimitry Andric #define __itt_task_begin_fn_ex_ptr 0
31200b57cec5SDimitry Andric #define __itt_task_end_ex_ptr 0
31210b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
31220b57cec5SDimitry Andric /** @endcond */
31230b57cec5SDimitry Andric 
31240b57cec5SDimitry Andric /**
31250b57cec5SDimitry Andric  * @defgroup counters Counters
31260b57cec5SDimitry Andric  * @ingroup public
31270b57cec5SDimitry Andric  * Counters are user-defined objects with a monotonically increasing
31280b57cec5SDimitry Andric  * value. Counter values are 64-bit unsigned integers.
31290b57cec5SDimitry Andric  * Counters have names that can be displayed in
31300b57cec5SDimitry Andric  * the tools.
31310b57cec5SDimitry Andric  * @{
31320b57cec5SDimitry Andric  */
31330b57cec5SDimitry Andric 
31340b57cec5SDimitry Andric /**
31350b57cec5SDimitry Andric  * @brief opaque structure for counter identification
31360b57cec5SDimitry Andric  */
31370b57cec5SDimitry Andric /** @cond exclude_from_documentation */
31380b57cec5SDimitry Andric 
31390b57cec5SDimitry Andric typedef struct ___itt_counter *__itt_counter;
31400b57cec5SDimitry Andric 
31410b57cec5SDimitry Andric /**
31420b57cec5SDimitry Andric  * @brief Create an unsigned 64 bits integer counter with given name/domain
31430b57cec5SDimitry Andric  *
3144fe6060f1SDimitry Andric  * After __itt_counter_create() is called, __itt_counter_inc(id),
3145fe6060f1SDimitry Andric  * __itt_counter_inc_delta(id, delta),
3146fe6060f1SDimitry Andric  * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id,
3147fe6060f1SDimitry Andric  * clock_domain, timestamp, value_ptr) can be used to change the value of the
3148fe6060f1SDimitry Andric  * counter, where value_ptr is a pointer to an unsigned 64 bits integer
31490b57cec5SDimitry Andric  *
3150fe6060f1SDimitry Andric  * The call is equal to __itt_counter_create_typed(name, domain,
3151fe6060f1SDimitry Andric  * __itt_metadata_u64)
31520b57cec5SDimitry Andric  */
31530b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
3154fe6060f1SDimitry Andric __itt_counter ITTAPI __itt_counter_createA(const char *name,
3155fe6060f1SDimitry Andric                                            const char *domain);
3156fe6060f1SDimitry Andric __itt_counter ITTAPI __itt_counter_createW(const wchar_t *name,
3157fe6060f1SDimitry Andric                                            const wchar_t *domain);
31580b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
31590b57cec5SDimitry Andric #define __itt_counter_create __itt_counter_createW
31600b57cec5SDimitry Andric #define __itt_counter_create_ptr __itt_counter_createW_ptr
31610b57cec5SDimitry Andric #else /* UNICODE */
31620b57cec5SDimitry Andric #define __itt_counter_create __itt_counter_createA
31630b57cec5SDimitry Andric #define __itt_counter_create_ptr __itt_counter_createA_ptr
31640b57cec5SDimitry Andric #endif /* UNICODE */
31650b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
31660b57cec5SDimitry Andric __itt_counter ITTAPI __itt_counter_create(const char *name, const char *domain);
31670b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
31680b57cec5SDimitry Andric 
31690b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
31700b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
31710b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
3172fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_counter, counter_createA,
3173fe6060f1SDimitry Andric          (const char *name, const char *domain))
3174fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_counter, counter_createW,
3175fe6060f1SDimitry Andric          (const wchar_t *name, const wchar_t *domain))
31760b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3177fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_counter, counter_create,
3178fe6060f1SDimitry Andric          (const char *name, const char *domain))
31790b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
31800b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
31810b57cec5SDimitry Andric #define __itt_counter_createA ITTNOTIFY_DATA(counter_createA)
31820b57cec5SDimitry Andric #define __itt_counter_createA_ptr ITTNOTIFY_NAME(counter_createA)
31830b57cec5SDimitry Andric #define __itt_counter_createW ITTNOTIFY_DATA(counter_createW)
31840b57cec5SDimitry Andric #define __itt_counter_createW_ptr ITTNOTIFY_NAME(counter_createW)
31850b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
31860b57cec5SDimitry Andric #define __itt_counter_create ITTNOTIFY_DATA(counter_create)
31870b57cec5SDimitry Andric #define __itt_counter_create_ptr ITTNOTIFY_NAME(counter_create)
31880b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
31890b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
31900b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
31910b57cec5SDimitry Andric #define __itt_counter_createA(name, domain)
31920b57cec5SDimitry Andric #define __itt_counter_createA_ptr 0
31930b57cec5SDimitry Andric #define __itt_counter_createW(name, domain)
31940b57cec5SDimitry Andric #define __itt_counter_createW_ptr 0
31950b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
31960b57cec5SDimitry Andric #define __itt_counter_create(name, domain)
31970b57cec5SDimitry Andric #define __itt_counter_create_ptr 0
31980b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
31990b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
32000b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
32010b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
32020b57cec5SDimitry Andric #define __itt_counter_createA_ptr 0
32030b57cec5SDimitry Andric #define __itt_counter_createW_ptr 0
32040b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
32050b57cec5SDimitry Andric #define __itt_counter_create_ptr 0
32060b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
32070b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
32080b57cec5SDimitry Andric /** @endcond */
32090b57cec5SDimitry Andric 
32100b57cec5SDimitry Andric /**
32110b57cec5SDimitry Andric  * @brief Increment the unsigned 64 bits integer counter value
32120b57cec5SDimitry Andric  *
32130b57cec5SDimitry Andric  * Calling this function to non-unsigned 64 bits integer counters has no effect
32140b57cec5SDimitry Andric  */
32150b57cec5SDimitry Andric void ITTAPI __itt_counter_inc(__itt_counter id);
32160b57cec5SDimitry Andric 
32170b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
32180b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
32190b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id))
32200b57cec5SDimitry Andric #define __itt_counter_inc ITTNOTIFY_VOID(counter_inc)
32210b57cec5SDimitry Andric #define __itt_counter_inc_ptr ITTNOTIFY_NAME(counter_inc)
32220b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
32230b57cec5SDimitry Andric #define __itt_counter_inc(id)
32240b57cec5SDimitry Andric #define __itt_counter_inc_ptr 0
32250b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
32260b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
32270b57cec5SDimitry Andric #define __itt_counter_inc_ptr 0
32280b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
32290b57cec5SDimitry Andric /** @endcond */
32300b57cec5SDimitry Andric /**
32310b57cec5SDimitry Andric  * @brief Increment the unsigned 64 bits integer counter value with x
32320b57cec5SDimitry Andric  *
32330b57cec5SDimitry Andric  * Calling this function to non-unsigned 64 bits integer counters has no effect
32340b57cec5SDimitry Andric  */
32350b57cec5SDimitry Andric void ITTAPI __itt_counter_inc_delta(__itt_counter id, unsigned long long value);
32360b57cec5SDimitry Andric 
32370b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
32380b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3239fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, counter_inc_delta,
3240fe6060f1SDimitry Andric           (__itt_counter id, unsigned long long value))
32410b57cec5SDimitry Andric #define __itt_counter_inc_delta ITTNOTIFY_VOID(counter_inc_delta)
32420b57cec5SDimitry Andric #define __itt_counter_inc_delta_ptr ITTNOTIFY_NAME(counter_inc_delta)
32430b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
32440b57cec5SDimitry Andric #define __itt_counter_inc_delta(id, value)
32450b57cec5SDimitry Andric #define __itt_counter_inc_delta_ptr 0
32460b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
32470b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
32480b57cec5SDimitry Andric #define __itt_counter_inc_delta_ptr 0
32490b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
32500b57cec5SDimitry Andric /** @endcond */
32510b57cec5SDimitry Andric 
32520b57cec5SDimitry Andric /**
32530b57cec5SDimitry Andric  * @brief Decrement the unsigned 64 bits integer counter value
32540b57cec5SDimitry Andric  *
32550b57cec5SDimitry Andric  * Calling this function to non-unsigned 64 bits integer counters has no effect
32560b57cec5SDimitry Andric  */
32570b57cec5SDimitry Andric void ITTAPI __itt_counter_dec(__itt_counter id);
32580b57cec5SDimitry Andric 
32590b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
32600b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
32610b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id))
32620b57cec5SDimitry Andric #define __itt_counter_dec ITTNOTIFY_VOID(counter_dec)
32630b57cec5SDimitry Andric #define __itt_counter_dec_ptr ITTNOTIFY_NAME(counter_dec)
32640b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
32650b57cec5SDimitry Andric #define __itt_counter_dec(id)
32660b57cec5SDimitry Andric #define __itt_counter_dec_ptr 0
32670b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
32680b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
32690b57cec5SDimitry Andric #define __itt_counter_dec_ptr 0
32700b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
32710b57cec5SDimitry Andric /** @endcond */
32720b57cec5SDimitry Andric /**
32730b57cec5SDimitry Andric  * @brief Decrement the unsigned 64 bits integer counter value with x
32740b57cec5SDimitry Andric  *
32750b57cec5SDimitry Andric  * Calling this function to non-unsigned 64 bits integer counters has no effect
32760b57cec5SDimitry Andric  */
32770b57cec5SDimitry Andric void ITTAPI __itt_counter_dec_delta(__itt_counter id, unsigned long long value);
32780b57cec5SDimitry Andric 
32790b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
32800b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3281fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, counter_dec_delta,
3282fe6060f1SDimitry Andric           (__itt_counter id, unsigned long long value))
32830b57cec5SDimitry Andric #define __itt_counter_dec_delta ITTNOTIFY_VOID(counter_dec_delta)
32840b57cec5SDimitry Andric #define __itt_counter_dec_delta_ptr ITTNOTIFY_NAME(counter_dec_delta)
32850b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
32860b57cec5SDimitry Andric #define __itt_counter_dec_delta(id, value)
32870b57cec5SDimitry Andric #define __itt_counter_dec_delta_ptr 0
32880b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
32890b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
32900b57cec5SDimitry Andric #define __itt_counter_dec_delta_ptr 0
32910b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
32920b57cec5SDimitry Andric /** @endcond */
32930b57cec5SDimitry Andric 
32940b57cec5SDimitry Andric /**
32950b57cec5SDimitry Andric  * @ingroup counters
32960b57cec5SDimitry Andric  * @brief Increment a counter by one.
32970b57cec5SDimitry Andric  * The first call with a given name creates a counter by that name and sets its
32980b57cec5SDimitry Andric  * value to zero. Successive calls increment the counter value.
3299fe6060f1SDimitry Andric  * @param[in] domain The domain controlling the call. Counter names are not
3300fe6060f1SDimitry Andric  * domain specific. The domain argument is used only to enable or disable the
3301fe6060f1SDimitry Andric  * API calls.
33020b57cec5SDimitry Andric  * @param[in] name The name of the counter
33030b57cec5SDimitry Andric  */
3304fe6060f1SDimitry Andric void ITTAPI __itt_counter_inc_v3(const __itt_domain *domain,
3305fe6060f1SDimitry Andric                                  __itt_string_handle *name);
33060b57cec5SDimitry Andric 
33070b57cec5SDimitry Andric /**
33080b57cec5SDimitry Andric  * @ingroup counters
33090b57cec5SDimitry Andric  * @brief Increment a counter by the value specified in delta.
3310fe6060f1SDimitry Andric  * @param[in] domain The domain controlling the call. Counter names are not
3311fe6060f1SDimitry Andric  * domain specific. The domain argument is used only to enable or disable the
3312fe6060f1SDimitry Andric  * API calls.
33130b57cec5SDimitry Andric  * @param[in] name The name of the counter
33140b57cec5SDimitry Andric  * @param[in] delta The amount by which to increment the counter
33150b57cec5SDimitry Andric  */
3316fe6060f1SDimitry Andric void ITTAPI __itt_counter_inc_delta_v3(const __itt_domain *domain,
3317fe6060f1SDimitry Andric                                        __itt_string_handle *name,
3318fe6060f1SDimitry Andric                                        unsigned long long delta);
33190b57cec5SDimitry Andric 
33200b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
33210b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3322fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, counter_inc_v3,
3323fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_string_handle *name))
3324fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, counter_inc_delta_v3,
3325fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_string_handle *name,
3326fe6060f1SDimitry Andric            unsigned long long delta))
33270b57cec5SDimitry Andric #define __itt_counter_inc_v3(d, x) ITTNOTIFY_VOID_D1(counter_inc_v3, d, x)
33280b57cec5SDimitry Andric #define __itt_counter_inc_v3_ptr ITTNOTIFY_NAME(counter_inc_v3)
3329fe6060f1SDimitry Andric #define __itt_counter_inc_delta_v3(d, x, y)                                    \
3330fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D2(counter_inc_delta_v3, d, x, y)
33310b57cec5SDimitry Andric #define __itt_counter_inc_delta_v3_ptr ITTNOTIFY_NAME(counter_inc_delta_v3)
33320b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
33330b57cec5SDimitry Andric #define __itt_counter_inc_v3(domain, name)
33340b57cec5SDimitry Andric #define __itt_counter_inc_v3_ptr 0
33350b57cec5SDimitry Andric #define __itt_counter_inc_delta_v3(domain, name, delta)
33360b57cec5SDimitry Andric #define __itt_counter_inc_delta_v3_ptr 0
33370b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
33380b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
33390b57cec5SDimitry Andric #define __itt_counter_inc_v3_ptr 0
33400b57cec5SDimitry Andric #define __itt_counter_inc_delta_v3_ptr 0
33410b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
33420b57cec5SDimitry Andric /** @endcond */
33430b57cec5SDimitry Andric 
33440b57cec5SDimitry Andric /**
33450b57cec5SDimitry Andric  * @ingroup counters
33460b57cec5SDimitry Andric  * @brief Decrement a counter by one.
33470b57cec5SDimitry Andric  * The first call with a given name creates a counter by that name and sets its
33480b57cec5SDimitry Andric  * value to zero. Successive calls decrement the counter value.
3349fe6060f1SDimitry Andric  * @param[in] domain The domain controlling the call. Counter names are not
3350fe6060f1SDimitry Andric  * domain specific. The domain argument is used only to enable or disable the
3351fe6060f1SDimitry Andric  * API calls.
33520b57cec5SDimitry Andric  * @param[in] name The name of the counter
33530b57cec5SDimitry Andric  */
3354fe6060f1SDimitry Andric void ITTAPI __itt_counter_dec_v3(const __itt_domain *domain,
3355fe6060f1SDimitry Andric                                  __itt_string_handle *name);
33560b57cec5SDimitry Andric 
33570b57cec5SDimitry Andric /**
33580b57cec5SDimitry Andric  * @ingroup counters
33590b57cec5SDimitry Andric  * @brief Decrement a counter by the value specified in delta.
3360fe6060f1SDimitry Andric  * @param[in] domain The domain controlling the call. Counter names are not
3361fe6060f1SDimitry Andric  * domain specific. The domain argument is used only to enable or disable the
3362fe6060f1SDimitry Andric  * API calls.
33630b57cec5SDimitry Andric  * @param[in] name The name of the counter
33640b57cec5SDimitry Andric  * @param[in] delta The amount by which to decrement the counter
33650b57cec5SDimitry Andric  */
3366fe6060f1SDimitry Andric void ITTAPI __itt_counter_dec_delta_v3(const __itt_domain *domain,
3367fe6060f1SDimitry Andric                                        __itt_string_handle *name,
3368fe6060f1SDimitry Andric                                        unsigned long long delta);
33690b57cec5SDimitry Andric 
33700b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
33710b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3372fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, counter_dec_v3,
3373fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_string_handle *name))
3374fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, counter_dec_delta_v3,
3375fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_string_handle *name,
3376fe6060f1SDimitry Andric            unsigned long long delta))
33770b57cec5SDimitry Andric #define __itt_counter_dec_v3(d, x) ITTNOTIFY_VOID_D1(counter_dec_v3, d, x)
33780b57cec5SDimitry Andric #define __itt_counter_dec_v3_ptr ITTNOTIFY_NAME(counter_dec_v3)
3379fe6060f1SDimitry Andric #define __itt_counter_dec_delta_v3(d, x, y)                                    \
3380fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D2(counter_dec_delta_v3, d, x, y)
33810b57cec5SDimitry Andric #define __itt_counter_dec_delta_v3_ptr ITTNOTIFY_NAME(counter_dec_delta_v3)
33820b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
33830b57cec5SDimitry Andric #define __itt_counter_dec_v3(domain, name)
33840b57cec5SDimitry Andric #define __itt_counter_dec_v3_ptr 0
33850b57cec5SDimitry Andric #define __itt_counter_dec_delta_v3(domain, name, delta)
33860b57cec5SDimitry Andric #define __itt_counter_dec_delta_v3_ptr 0
33870b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
33880b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
33890b57cec5SDimitry Andric #define __itt_counter_dec_v3_ptr 0
33900b57cec5SDimitry Andric #define __itt_counter_dec_delta_v3_ptr 0
33910b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
33920b57cec5SDimitry Andric /** @endcond */
33930b57cec5SDimitry Andric 
33940b57cec5SDimitry Andric /** @} counters group */
33950b57cec5SDimitry Andric 
33960b57cec5SDimitry Andric /**
33970b57cec5SDimitry Andric  * @brief Set the counter value
33980b57cec5SDimitry Andric  */
33990b57cec5SDimitry Andric void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr);
34000b57cec5SDimitry Andric 
34010b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
34020b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
34030b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr))
34040b57cec5SDimitry Andric #define __itt_counter_set_value ITTNOTIFY_VOID(counter_set_value)
34050b57cec5SDimitry Andric #define __itt_counter_set_value_ptr ITTNOTIFY_NAME(counter_set_value)
34060b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
34070b57cec5SDimitry Andric #define __itt_counter_set_value(id, value_ptr)
34080b57cec5SDimitry Andric #define __itt_counter_set_value_ptr 0
34090b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
34100b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
34110b57cec5SDimitry Andric #define __itt_counter_set_value_ptr 0
34120b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
34130b57cec5SDimitry Andric /** @endcond */
34140b57cec5SDimitry Andric 
34150b57cec5SDimitry Andric /**
34160b57cec5SDimitry Andric  * @brief Set the counter value
34170b57cec5SDimitry Andric  */
3418fe6060f1SDimitry Andric void ITTAPI __itt_counter_set_value_ex(__itt_counter id,
3419fe6060f1SDimitry Andric                                        __itt_clock_domain *clock_domain,
3420fe6060f1SDimitry Andric                                        unsigned long long timestamp,
3421fe6060f1SDimitry Andric                                        void *value_ptr);
34220b57cec5SDimitry Andric 
34230b57cec5SDimitry Andric /** @cond exclude_from_documentation */
34240b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
34250b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3426fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, counter_set_value_ex,
3427fe6060f1SDimitry Andric           (__itt_counter id, __itt_clock_domain *clock_domain,
3428fe6060f1SDimitry Andric            unsigned long long timestamp, void *value_ptr))
34290b57cec5SDimitry Andric #define __itt_counter_set_value_ex ITTNOTIFY_VOID(counter_set_value_ex)
34300b57cec5SDimitry Andric #define __itt_counter_set_value_ex_ptr ITTNOTIFY_NAME(counter_set_value_ex)
34310b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
34320b57cec5SDimitry Andric #define __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
34330b57cec5SDimitry Andric #define __itt_counter_set_value_ex_ptr 0
34340b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
34350b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
34360b57cec5SDimitry Andric #define __itt_counter_set_value_ex_ptr 0
34370b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
34380b57cec5SDimitry Andric /** @endcond */
34390b57cec5SDimitry Andric 
34400b57cec5SDimitry Andric /**
34410b57cec5SDimitry Andric  * @brief Create a typed counter with given name/domain
34420b57cec5SDimitry Andric  *
3443fe6060f1SDimitry Andric  * After __itt_counter_create_typed() is called, __itt_counter_inc(id),
3444fe6060f1SDimitry Andric  * __itt_counter_inc_delta(id, delta),
3445fe6060f1SDimitry Andric  * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id,
3446fe6060f1SDimitry Andric  * clock_domain, timestamp, value_ptr) can be used to change the value of the
3447fe6060f1SDimitry Andric  * counter
34480b57cec5SDimitry Andric  */
34490b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
3450fe6060f1SDimitry Andric __itt_counter ITTAPI __itt_counter_create_typedA(const char *name,
3451fe6060f1SDimitry Andric                                                  const char *domain,
3452fe6060f1SDimitry Andric                                                  __itt_metadata_type type);
3453fe6060f1SDimitry Andric __itt_counter ITTAPI __itt_counter_create_typedW(const wchar_t *name,
3454fe6060f1SDimitry Andric                                                  const wchar_t *domain,
3455fe6060f1SDimitry Andric                                                  __itt_metadata_type type);
34560b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
34570b57cec5SDimitry Andric #define __itt_counter_create_typed __itt_counter_create_typedW
34580b57cec5SDimitry Andric #define __itt_counter_create_typed_ptr __itt_counter_create_typedW_ptr
34590b57cec5SDimitry Andric #else /* UNICODE */
34600b57cec5SDimitry Andric #define __itt_counter_create_typed __itt_counter_create_typedA
34610b57cec5SDimitry Andric #define __itt_counter_create_typed_ptr __itt_counter_create_typedA_ptr
34620b57cec5SDimitry Andric #endif /* UNICODE */
34630b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3464fe6060f1SDimitry Andric __itt_counter ITTAPI __itt_counter_create_typed(const char *name,
3465fe6060f1SDimitry Andric                                                 const char *domain,
3466fe6060f1SDimitry Andric                                                 __itt_metadata_type type);
34670b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
34680b57cec5SDimitry Andric 
34690b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
34700b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
34710b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
3472fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA,
3473fe6060f1SDimitry Andric          (const char *name, const char *domain, __itt_metadata_type type))
3474fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW,
3475fe6060f1SDimitry Andric          (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type))
34760b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3477fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_counter, counter_create_typed,
3478fe6060f1SDimitry Andric          (const char *name, const char *domain, __itt_metadata_type type))
34790b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
34800b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
34810b57cec5SDimitry Andric #define __itt_counter_create_typedA ITTNOTIFY_DATA(counter_create_typedA)
34820b57cec5SDimitry Andric #define __itt_counter_create_typedA_ptr ITTNOTIFY_NAME(counter_create_typedA)
34830b57cec5SDimitry Andric #define __itt_counter_create_typedW ITTNOTIFY_DATA(counter_create_typedW)
34840b57cec5SDimitry Andric #define __itt_counter_create_typedW_ptr ITTNOTIFY_NAME(counter_create_typedW)
34850b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
34860b57cec5SDimitry Andric #define __itt_counter_create_typed ITTNOTIFY_DATA(counter_create_typed)
34870b57cec5SDimitry Andric #define __itt_counter_create_typed_ptr ITTNOTIFY_NAME(counter_create_typed)
34880b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
34890b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
34900b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
34910b57cec5SDimitry Andric #define __itt_counter_create_typedA(name, domain, type)
34920b57cec5SDimitry Andric #define __itt_counter_create_typedA_ptr 0
34930b57cec5SDimitry Andric #define __itt_counter_create_typedW(name, domain, type)
34940b57cec5SDimitry Andric #define __itt_counter_create_typedW_ptr 0
34950b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
34960b57cec5SDimitry Andric #define __itt_counter_create_typed(name, domain, type)
34970b57cec5SDimitry Andric #define __itt_counter_create_typed_ptr 0
34980b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
34990b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
35000b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
35010b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
35020b57cec5SDimitry Andric #define __itt_counter_create_typedA_ptr 0
35030b57cec5SDimitry Andric #define __itt_counter_create_typedW_ptr 0
35040b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
35050b57cec5SDimitry Andric #define __itt_counter_create_typed_ptr 0
35060b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
35070b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
35080b57cec5SDimitry Andric /** @endcond */
35090b57cec5SDimitry Andric 
35100b57cec5SDimitry Andric /**
3511fe6060f1SDimitry Andric  * @brief Destroy the counter identified by the pointer previously returned by
3512fe6060f1SDimitry Andric  * __itt_counter_create() or
35130b57cec5SDimitry Andric  * __itt_counter_create_typed()
35140b57cec5SDimitry Andric  */
35150b57cec5SDimitry Andric void ITTAPI __itt_counter_destroy(__itt_counter id);
35160b57cec5SDimitry Andric 
35170b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
35180b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
35190b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id))
35200b57cec5SDimitry Andric #define __itt_counter_destroy ITTNOTIFY_VOID(counter_destroy)
35210b57cec5SDimitry Andric #define __itt_counter_destroy_ptr ITTNOTIFY_NAME(counter_destroy)
35220b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
35230b57cec5SDimitry Andric #define __itt_counter_destroy(id)
35240b57cec5SDimitry Andric #define __itt_counter_destroy_ptr 0
35250b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
35260b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
35270b57cec5SDimitry Andric #define __itt_counter_destroy_ptr 0
35280b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
35290b57cec5SDimitry Andric /** @endcond */
35300b57cec5SDimitry Andric /** @} counters group */
35310b57cec5SDimitry Andric 
35320b57cec5SDimitry Andric /**
35330b57cec5SDimitry Andric  * @ingroup markers
35340b57cec5SDimitry Andric  * @brief Create a marker instance.
35350b57cec5SDimitry Andric  * @param[in] domain The domain for this marker
3536fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
3537fe6060f1SDimitry Andric  * call.
35380b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
35390b57cec5SDimitry Andric  * @param[in] id The instance ID for this marker, or __itt_null
35400b57cec5SDimitry Andric  * @param[in] name The name for this marker
35410b57cec5SDimitry Andric  * @param[in] scope The scope for this marker
35420b57cec5SDimitry Andric  */
3543fe6060f1SDimitry Andric void ITTAPI __itt_marker_ex(const __itt_domain *domain,
3544fe6060f1SDimitry Andric                             __itt_clock_domain *clock_domain,
3545fe6060f1SDimitry Andric                             unsigned long long timestamp, __itt_id id,
3546fe6060f1SDimitry Andric                             __itt_string_handle *name, __itt_scope scope);
35470b57cec5SDimitry Andric 
35480b57cec5SDimitry Andric /** @cond exclude_from_documentation */
35490b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
35500b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3551fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, marker_ex,
3552fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3553fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id id, __itt_string_handle *name,
3554fe6060f1SDimitry Andric            __itt_scope scope))
3555fe6060f1SDimitry Andric #define __itt_marker_ex(d, x, y, z, a, b)                                      \
3556fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D5(marker_ex, d, x, y, z, a, b)
35570b57cec5SDimitry Andric #define __itt_marker_ex_ptr ITTNOTIFY_NAME(marker_ex)
35580b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
35590b57cec5SDimitry Andric #define __itt_marker_ex(domain, clock_domain, timestamp, id, name, scope)
35600b57cec5SDimitry Andric #define __itt_marker_ex_ptr 0
35610b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
35620b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
35630b57cec5SDimitry Andric #define __itt_marker_ex_ptr 0
35640b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
35650b57cec5SDimitry Andric /** @endcond */
35660b57cec5SDimitry Andric 
35670b57cec5SDimitry Andric /**
35680b57cec5SDimitry Andric  * @ingroup clockdomain
35690b57cec5SDimitry Andric  * @brief Add a relation to the current task instance.
35700b57cec5SDimitry Andric  * The current task instance is the head of the relation.
35710b57cec5SDimitry Andric  * @param[in] domain The domain controlling this call
3572fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
3573fe6060f1SDimitry Andric  * call.
35740b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
35750b57cec5SDimitry Andric  * @param[in] relation The kind of relation
35760b57cec5SDimitry Andric  * @param[in] tail The ID for the tail of the relation
35770b57cec5SDimitry Andric  */
3578fe6060f1SDimitry Andric void ITTAPI __itt_relation_add_to_current_ex(const __itt_domain *domain,
3579fe6060f1SDimitry Andric                                              __itt_clock_domain *clock_domain,
3580fe6060f1SDimitry Andric                                              unsigned long long timestamp,
3581fe6060f1SDimitry Andric                                              __itt_relation relation,
3582fe6060f1SDimitry Andric                                              __itt_id tail);
35830b57cec5SDimitry Andric 
35840b57cec5SDimitry Andric /**
35850b57cec5SDimitry Andric  * @ingroup clockdomain
35860b57cec5SDimitry Andric  * @brief Add a relation between two instance identifiers.
35870b57cec5SDimitry Andric  * @param[in] domain The domain controlling this call
3588fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
3589fe6060f1SDimitry Andric  * call.
35900b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
35910b57cec5SDimitry Andric  * @param[in] head The ID for the head of the relation
35920b57cec5SDimitry Andric  * @param[in] relation The kind of relation
35930b57cec5SDimitry Andric  * @param[in] tail The ID for the tail of the relation
35940b57cec5SDimitry Andric  */
3595fe6060f1SDimitry Andric void ITTAPI __itt_relation_add_ex(const __itt_domain *domain,
3596fe6060f1SDimitry Andric                                   __itt_clock_domain *clock_domain,
3597fe6060f1SDimitry Andric                                   unsigned long long timestamp, __itt_id head,
3598fe6060f1SDimitry Andric                                   __itt_relation relation, __itt_id tail);
35990b57cec5SDimitry Andric 
36000b57cec5SDimitry Andric /** @cond exclude_from_documentation */
36010b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
36020b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3603fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, relation_add_to_current_ex,
3604fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3605fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_relation relation,
3606fe6060f1SDimitry Andric            __itt_id tail))
3607fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, relation_add_ex,
3608fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3609fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id head, __itt_relation relation,
3610fe6060f1SDimitry Andric            __itt_id tail))
3611fe6060f1SDimitry Andric #define __itt_relation_add_to_current_ex(d, x, y, z, a)                        \
3612fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D4(relation_add_to_current_ex, d, x, y, z, a)
3613fe6060f1SDimitry Andric #define __itt_relation_add_to_current_ex_ptr                                   \
3614fe6060f1SDimitry Andric   ITTNOTIFY_NAME(relation_add_to_current_ex)
3615fe6060f1SDimitry Andric #define __itt_relation_add_ex(d, x, y, z, a, b)                                \
3616fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D5(relation_add_ex, d, x, y, z, a, b)
36170b57cec5SDimitry Andric #define __itt_relation_add_ex_ptr ITTNOTIFY_NAME(relation_add_ex)
36180b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
3619349cc55cSDimitry Andric #define __itt_relation_add_to_current_ex(domain, clock_domain, timestame,      \
3620fe6060f1SDimitry Andric                                          relation, tail)
36210b57cec5SDimitry Andric #define __itt_relation_add_to_current_ex_ptr 0
3622fe6060f1SDimitry Andric #define __itt_relation_add_ex(domain, clock_domain, timestamp, head, relation, \
3623fe6060f1SDimitry Andric                               tail)
36240b57cec5SDimitry Andric #define __itt_relation_add_ex_ptr 0
36250b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
36260b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
36270b57cec5SDimitry Andric #define __itt_relation_add_to_current_ex_ptr 0
36280b57cec5SDimitry Andric #define __itt_relation_add_ex_ptr 0
36290b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
36300b57cec5SDimitry Andric /** @endcond */
36310b57cec5SDimitry Andric 
36320b57cec5SDimitry Andric /** @cond exclude_from_documentation */
3633fe6060f1SDimitry Andric typedef enum ___itt_track_group_type {
36340b57cec5SDimitry Andric   __itt_track_group_type_normal = 0
36350b57cec5SDimitry Andric } __itt_track_group_type;
36360b57cec5SDimitry Andric /** @endcond */
36370b57cec5SDimitry Andric 
36380b57cec5SDimitry Andric /** @cond exclude_from_documentation */
36390b57cec5SDimitry Andric #pragma pack(push, 8)
36400b57cec5SDimitry Andric 
3641fe6060f1SDimitry Andric typedef struct ___itt_track_group {
36420b57cec5SDimitry Andric   __itt_string_handle *name; /*!< Name of the track group */
36430b57cec5SDimitry Andric   struct ___itt_track *track; /*!< List of child tracks    */
36440b57cec5SDimitry Andric   __itt_track_group_type tgtype; /*!< Type of the track group */
36450b57cec5SDimitry Andric   int extra1; /*!< Reserved. Must be zero  */
36460b57cec5SDimitry Andric   void *extra2; /*!< Reserved. Must be zero  */
36470b57cec5SDimitry Andric   struct ___itt_track_group *next;
36480b57cec5SDimitry Andric } __itt_track_group;
36490b57cec5SDimitry Andric 
36500b57cec5SDimitry Andric #pragma pack(pop)
36510b57cec5SDimitry Andric /** @endcond */
36520b57cec5SDimitry Andric 
36530b57cec5SDimitry Andric /**
36540b57cec5SDimitry Andric  * @brief Placeholder for custom track types. Currently, "normal" custom track
36550b57cec5SDimitry Andric  * is the only available track type.
36560b57cec5SDimitry Andric  */
3657fe6060f1SDimitry Andric typedef enum ___itt_track_type {
36580b57cec5SDimitry Andric   __itt_track_type_normal = 0
36590b57cec5SDimitry Andric #ifdef INTEL_ITTNOTIFY_API_PRIVATE
3660fe6060f1SDimitry Andric   ,
3661fe6060f1SDimitry Andric   __itt_track_type_queue
36620b57cec5SDimitry Andric #endif /* INTEL_ITTNOTIFY_API_PRIVATE */
36630b57cec5SDimitry Andric } __itt_track_type;
36640b57cec5SDimitry Andric 
36650b57cec5SDimitry Andric /** @cond exclude_from_documentation */
36660b57cec5SDimitry Andric #pragma pack(push, 8)
36670b57cec5SDimitry Andric 
3668fe6060f1SDimitry Andric typedef struct ___itt_track {
36690b57cec5SDimitry Andric   __itt_string_handle *name; /*!< Name of the track group */
36700b57cec5SDimitry Andric   __itt_track_group *group; /*!< Parent group to a track */
36710b57cec5SDimitry Andric   __itt_track_type ttype; /*!< Type of the track       */
36720b57cec5SDimitry Andric   int extra1; /*!< Reserved. Must be zero  */
36730b57cec5SDimitry Andric   void *extra2; /*!< Reserved. Must be zero  */
36740b57cec5SDimitry Andric   struct ___itt_track *next;
36750b57cec5SDimitry Andric } __itt_track;
36760b57cec5SDimitry Andric 
36770b57cec5SDimitry Andric #pragma pack(pop)
36780b57cec5SDimitry Andric /** @endcond */
36790b57cec5SDimitry Andric 
36800b57cec5SDimitry Andric /**
36810b57cec5SDimitry Andric  * @brief Create logical track group.
36820b57cec5SDimitry Andric  */
3683fe6060f1SDimitry Andric __itt_track_group *ITTAPI __itt_track_group_create(
3684fe6060f1SDimitry Andric     __itt_string_handle *name, __itt_track_group_type track_group_type);
36850b57cec5SDimitry Andric 
36860b57cec5SDimitry Andric /** @cond exclude_from_documentation */
36870b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
36880b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3689fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_track_group *, track_group_create,
3690fe6060f1SDimitry Andric          (__itt_string_handle * name, __itt_track_group_type track_group_type))
36910b57cec5SDimitry Andric #define __itt_track_group_create ITTNOTIFY_DATA(track_group_create)
36920b57cec5SDimitry Andric #define __itt_track_group_create_ptr ITTNOTIFY_NAME(track_group_create)
36930b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
36940b57cec5SDimitry Andric #define __itt_track_group_create(name) (__itt_track_group *)0
36950b57cec5SDimitry Andric #define __itt_track_group_create_ptr 0
36960b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
36970b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
36980b57cec5SDimitry Andric #define __itt_track_group_create_ptr 0
36990b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
37000b57cec5SDimitry Andric /** @endcond */
37010b57cec5SDimitry Andric 
37020b57cec5SDimitry Andric /**
37030b57cec5SDimitry Andric  * @brief Create logical track.
37040b57cec5SDimitry Andric  */
3705fe6060f1SDimitry Andric __itt_track *ITTAPI __itt_track_create(__itt_track_group *track_group,
3706fe6060f1SDimitry Andric                                        __itt_string_handle *name,
3707fe6060f1SDimitry Andric                                        __itt_track_type track_type);
37080b57cec5SDimitry Andric 
37090b57cec5SDimitry Andric /** @cond exclude_from_documentation */
37100b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
37110b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
3712fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_track *, track_create,
3713fe6060f1SDimitry Andric          (__itt_track_group * track_group, __itt_string_handle *name,
3714fe6060f1SDimitry Andric           __itt_track_type track_type))
37150b57cec5SDimitry Andric #define __itt_track_create ITTNOTIFY_DATA(track_create)
37160b57cec5SDimitry Andric #define __itt_track_create_ptr ITTNOTIFY_NAME(track_create)
37170b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
37180b57cec5SDimitry Andric #define __itt_track_create(track_group, name, track_type) (__itt_track *)0
37190b57cec5SDimitry Andric #define __itt_track_create_ptr 0
37200b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
37210b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
37220b57cec5SDimitry Andric #define __itt_track_create_ptr 0
37230b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
37240b57cec5SDimitry Andric /** @endcond */
37250b57cec5SDimitry Andric 
37260b57cec5SDimitry Andric /**
37270b57cec5SDimitry Andric  * @brief Set the logical track.
37280b57cec5SDimitry Andric  */
37290b57cec5SDimitry Andric void ITTAPI __itt_set_track(__itt_track *track);
37300b57cec5SDimitry Andric 
37310b57cec5SDimitry Andric /** @cond exclude_from_documentation */
37320b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
37330b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
37340b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, set_track, (__itt_track * track))
37350b57cec5SDimitry Andric #define __itt_set_track ITTNOTIFY_VOID(set_track)
37360b57cec5SDimitry Andric #define __itt_set_track_ptr ITTNOTIFY_NAME(set_track)
37370b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
37380b57cec5SDimitry Andric #define __itt_set_track(track)
37390b57cec5SDimitry Andric #define __itt_set_track_ptr 0
37400b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
37410b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
37420b57cec5SDimitry Andric #define __itt_set_track_ptr 0
37430b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
37440b57cec5SDimitry Andric /** @endcond */
37450b57cec5SDimitry Andric 
37460b57cec5SDimitry Andric /* ========================================================================== */
37470b57cec5SDimitry Andric /** @cond exclude_from_gpa_documentation */
37480b57cec5SDimitry Andric /**
37490b57cec5SDimitry Andric  * @defgroup events Events
37500b57cec5SDimitry Andric  * @ingroup public
37510b57cec5SDimitry Andric  * Events group
37520b57cec5SDimitry Andric  * @{
37530b57cec5SDimitry Andric  */
37540b57cec5SDimitry Andric /** @brief user event type */
37550b57cec5SDimitry Andric typedef int __itt_event;
37560b57cec5SDimitry Andric 
37570b57cec5SDimitry Andric /**
37580b57cec5SDimitry Andric  * @brief Create an event notification
3759fe6060f1SDimitry Andric  * @note name or namelen being null/name and namelen not matching, user event
3760fe6060f1SDimitry Andric  * feature not enabled
37610b57cec5SDimitry Andric  * @return non-zero event identifier upon success and __itt_err otherwise
37620b57cec5SDimitry Andric  */
37630b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
37640b57cec5SDimitry Andric __itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen);
37650b57cec5SDimitry Andric __itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen);
37660b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
37670b57cec5SDimitry Andric #define __itt_event_create __itt_event_createW
37680b57cec5SDimitry Andric #define __itt_event_create_ptr __itt_event_createW_ptr
37690b57cec5SDimitry Andric #else
37700b57cec5SDimitry Andric #define __itt_event_create __itt_event_createA
37710b57cec5SDimitry Andric #define __itt_event_create_ptr __itt_event_createA_ptr
37720b57cec5SDimitry Andric #endif /* UNICODE */
37730b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
37740b57cec5SDimitry Andric __itt_event LIBITTAPI __itt_event_create(const char *name, int namelen);
37750b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
37760b57cec5SDimitry Andric 
37770b57cec5SDimitry Andric /** @cond exclude_from_documentation */
37780b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
37790b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
37800b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
37810b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen))
3782fe6060f1SDimitry Andric ITT_STUB(LIBITTAPI, __itt_event, event_createW,
3783fe6060f1SDimitry Andric          (const wchar_t *name, int namelen))
37840b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
37850b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen))
37860b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
37870b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
37880b57cec5SDimitry Andric #define __itt_event_createA ITTNOTIFY_DATA(event_createA)
37890b57cec5SDimitry Andric #define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA)
37900b57cec5SDimitry Andric #define __itt_event_createW ITTNOTIFY_DATA(event_createW)
37910b57cec5SDimitry Andric #define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW)
37920b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
37930b57cec5SDimitry Andric #define __itt_event_create ITTNOTIFY_DATA(event_create)
37940b57cec5SDimitry Andric #define __itt_event_create_ptr ITTNOTIFY_NAME(event_create)
37950b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
37960b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
37970b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
37980b57cec5SDimitry Andric #define __itt_event_createA(name, namelen) (__itt_event)0
37990b57cec5SDimitry Andric #define __itt_event_createA_ptr 0
38000b57cec5SDimitry Andric #define __itt_event_createW(name, namelen) (__itt_event)0
38010b57cec5SDimitry Andric #define __itt_event_createW_ptr 0
38020b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
38030b57cec5SDimitry Andric #define __itt_event_create(name, namelen) (__itt_event)0
38040b57cec5SDimitry Andric #define __itt_event_create_ptr 0
38050b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
38060b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
38070b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
38080b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
38090b57cec5SDimitry Andric #define __itt_event_createA_ptr 0
38100b57cec5SDimitry Andric #define __itt_event_createW_ptr 0
38110b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
38120b57cec5SDimitry Andric #define __itt_event_create_ptr 0
38130b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
38140b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
38150b57cec5SDimitry Andric /** @endcond */
38160b57cec5SDimitry Andric 
38170b57cec5SDimitry Andric /**
38180b57cec5SDimitry Andric  * @brief Record an event occurrence.
3819fe6060f1SDimitry Andric  * @return __itt_err upon failure (invalid event id/user event feature not
3820fe6060f1SDimitry Andric  * enabled)
38210b57cec5SDimitry Andric  */
38220b57cec5SDimitry Andric int LIBITTAPI __itt_event_start(__itt_event event);
38230b57cec5SDimitry Andric 
38240b57cec5SDimitry Andric /** @cond exclude_from_documentation */
38250b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
38260b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
38270b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event))
38280b57cec5SDimitry Andric #define __itt_event_start ITTNOTIFY_DATA(event_start)
38290b57cec5SDimitry Andric #define __itt_event_start_ptr ITTNOTIFY_NAME(event_start)
38300b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
38310b57cec5SDimitry Andric #define __itt_event_start(event) (int)0
38320b57cec5SDimitry Andric #define __itt_event_start_ptr 0
38330b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
38340b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
38350b57cec5SDimitry Andric #define __itt_event_start_ptr 0
38360b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
38370b57cec5SDimitry Andric /** @endcond */
38380b57cec5SDimitry Andric 
38390b57cec5SDimitry Andric /**
38400b57cec5SDimitry Andric  * @brief Record an event end occurrence.
38410b57cec5SDimitry Andric  * @note It is optional if events do not have durations.
3842fe6060f1SDimitry Andric  * @return __itt_err upon failure (invalid event id/user event feature not
3843fe6060f1SDimitry Andric  * enabled)
38440b57cec5SDimitry Andric  */
38450b57cec5SDimitry Andric int LIBITTAPI __itt_event_end(__itt_event event);
38460b57cec5SDimitry Andric 
38470b57cec5SDimitry Andric /** @cond exclude_from_documentation */
38480b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
38490b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
38500b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event))
38510b57cec5SDimitry Andric #define __itt_event_end ITTNOTIFY_DATA(event_end)
38520b57cec5SDimitry Andric #define __itt_event_end_ptr ITTNOTIFY_NAME(event_end)
38530b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
38540b57cec5SDimitry Andric #define __itt_event_end(event) (int)0
38550b57cec5SDimitry Andric #define __itt_event_end_ptr 0
38560b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
38570b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
38580b57cec5SDimitry Andric #define __itt_event_end_ptr 0
38590b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
38600b57cec5SDimitry Andric /** @endcond */
38610b57cec5SDimitry Andric /** @} events group */
38620b57cec5SDimitry Andric 
38630b57cec5SDimitry Andric /**
38640b57cec5SDimitry Andric  * @defgroup arrays Arrays Visualizer
38650b57cec5SDimitry Andric  * @ingroup public
38660b57cec5SDimitry Andric  * Visualize arrays
38670b57cec5SDimitry Andric  * @{
38680b57cec5SDimitry Andric  */
38690b57cec5SDimitry Andric 
38700b57cec5SDimitry Andric /**
38710b57cec5SDimitry Andric  * @enum __itt_av_data_type
38720b57cec5SDimitry Andric  * @brief Defines types of arrays data (for C/C++ intrinsic types)
38730b57cec5SDimitry Andric  */
3874fe6060f1SDimitry Andric typedef enum {
38750b57cec5SDimitry Andric   __itt_e_first = 0,
38760b57cec5SDimitry Andric   __itt_e_char = 0, /* 1-byte integer */
38770b57cec5SDimitry Andric   __itt_e_uchar, /* 1-byte unsigned integer */
38780b57cec5SDimitry Andric   __itt_e_int16, /* 2-byte integer */
38790b57cec5SDimitry Andric   __itt_e_uint16, /* 2-byte unsigned integer  */
38800b57cec5SDimitry Andric   __itt_e_int32, /* 4-byte integer */
38810b57cec5SDimitry Andric   __itt_e_uint32, /* 4-byte unsigned integer */
38820b57cec5SDimitry Andric   __itt_e_int64, /* 8-byte integer */
38830b57cec5SDimitry Andric   __itt_e_uint64, /* 8-byte unsigned integer */
38840b57cec5SDimitry Andric   __itt_e_float, /* 4-byte floating */
38850b57cec5SDimitry Andric   __itt_e_double, /* 8-byte floating */
38860b57cec5SDimitry Andric   __itt_e_last = __itt_e_double
38870b57cec5SDimitry Andric } __itt_av_data_type;
38880b57cec5SDimitry Andric 
38890b57cec5SDimitry Andric /**
38900b57cec5SDimitry Andric  * @brief Save an array data to a file.
3891fe6060f1SDimitry Andric  * Output format is defined by the file extension. The csv and bmp formats are
3892fe6060f1SDimitry Andric  * supported (bmp - for 2-dimensional array only).
38930b57cec5SDimitry Andric  * @param[in] data - pointer to the array data
38940b57cec5SDimitry Andric  * @param[in] rank - the rank of the array
3895fe6060f1SDimitry Andric  * @param[in] dimensions - pointer to an array of integers, which specifies the
3896fe6060f1SDimitry Andric  * array dimensions. The size of dimensions must be equal to the rank
3897fe6060f1SDimitry Andric  * @param[in] type - the type of the array, specified as one of the
3898fe6060f1SDimitry Andric  * __itt_av_data_type values (for intrinsic types)
3899fe6060f1SDimitry Andric  * @param[in] filePath - the file path; the output format is defined by the file
3900fe6060f1SDimitry Andric  * extension
3901fe6060f1SDimitry Andric  * @param[in] columnOrder - defines how the array is stored in the linear
3902fe6060f1SDimitry Andric  * memory. It should be 1 for column-major order (e.g. in FORTRAN) or 0 - for
3903fe6060f1SDimitry Andric  * row-major order (e.g. in C).
39040b57cec5SDimitry Andric  */
39050b57cec5SDimitry Andric 
39060b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
3907fe6060f1SDimitry Andric int ITTAPI __itt_av_saveA(void *data, int rank, const int *dimensions, int type,
3908fe6060f1SDimitry Andric                           const char *filePath, int columnOrder);
3909fe6060f1SDimitry Andric int ITTAPI __itt_av_saveW(void *data, int rank, const int *dimensions, int type,
3910fe6060f1SDimitry Andric                           const wchar_t *filePath, int columnOrder);
39110b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
39120b57cec5SDimitry Andric #define __itt_av_save __itt_av_saveW
39130b57cec5SDimitry Andric #define __itt_av_save_ptr __itt_av_saveW_ptr
39140b57cec5SDimitry Andric #else /* UNICODE */
39150b57cec5SDimitry Andric #define __itt_av_save __itt_av_saveA
39160b57cec5SDimitry Andric #define __itt_av_save_ptr __itt_av_saveA_ptr
39170b57cec5SDimitry Andric #endif /* UNICODE */
39180b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3919fe6060f1SDimitry Andric int ITTAPI __itt_av_save(void *data, int rank, const int *dimensions, int type,
3920fe6060f1SDimitry Andric                          const char *filePath, int columnOrder);
39210b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39220b57cec5SDimitry Andric 
39230b57cec5SDimitry Andric /** @cond exclude_from_documentation */
39240b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
39250b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
39260b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
3927fe6060f1SDimitry Andric ITT_STUB(ITTAPI, int, av_saveA,
3928fe6060f1SDimitry Andric          (void *data, int rank, const int *dimensions, int type,
3929fe6060f1SDimitry Andric           const char *filePath, int columnOrder))
3930fe6060f1SDimitry Andric ITT_STUB(ITTAPI, int, av_saveW,
3931fe6060f1SDimitry Andric          (void *data, int rank, const int *dimensions, int type,
3932fe6060f1SDimitry Andric           const wchar_t *filePath, int columnOrder))
39330b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3934fe6060f1SDimitry Andric ITT_STUB(ITTAPI, int, av_save,
3935fe6060f1SDimitry Andric          (void *data, int rank, const int *dimensions, int type,
3936fe6060f1SDimitry Andric           const char *filePath, int columnOrder))
39370b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39380b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
39390b57cec5SDimitry Andric #define __itt_av_saveA ITTNOTIFY_DATA(av_saveA)
39400b57cec5SDimitry Andric #define __itt_av_saveA_ptr ITTNOTIFY_NAME(av_saveA)
39410b57cec5SDimitry Andric #define __itt_av_saveW ITTNOTIFY_DATA(av_saveW)
39420b57cec5SDimitry Andric #define __itt_av_saveW_ptr ITTNOTIFY_NAME(av_saveW)
39430b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39440b57cec5SDimitry Andric #define __itt_av_save ITTNOTIFY_DATA(av_save)
39450b57cec5SDimitry Andric #define __itt_av_save_ptr ITTNOTIFY_NAME(av_save)
39460b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39470b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
39480b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
39490b57cec5SDimitry Andric #define __itt_av_saveA(name)
39500b57cec5SDimitry Andric #define __itt_av_saveA_ptr 0
39510b57cec5SDimitry Andric #define __itt_av_saveW(name)
39520b57cec5SDimitry Andric #define __itt_av_saveW_ptr 0
39530b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39540b57cec5SDimitry Andric #define __itt_av_save(name)
39550b57cec5SDimitry Andric #define __itt_av_save_ptr 0
39560b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39570b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
39580b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
39590b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
39600b57cec5SDimitry Andric #define __itt_av_saveA_ptr 0
39610b57cec5SDimitry Andric #define __itt_av_saveW_ptr 0
39620b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39630b57cec5SDimitry Andric #define __itt_av_save_ptr 0
39640b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
39650b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
39660b57cec5SDimitry Andric /** @endcond */
39670b57cec5SDimitry Andric 
39680b57cec5SDimitry Andric void ITTAPI __itt_enable_attach(void);
39690b57cec5SDimitry Andric 
39700b57cec5SDimitry Andric /** @cond exclude_from_documentation */
39710b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
39720b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
39730b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, enable_attach, (void))
39740b57cec5SDimitry Andric #define __itt_enable_attach ITTNOTIFY_VOID(enable_attach)
39750b57cec5SDimitry Andric #define __itt_enable_attach_ptr ITTNOTIFY_NAME(enable_attach)
39760b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
39770b57cec5SDimitry Andric #define __itt_enable_attach()
39780b57cec5SDimitry Andric #define __itt_enable_attach_ptr 0
39790b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
39800b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
39810b57cec5SDimitry Andric #define __itt_enable_attach_ptr 0
39820b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
39830b57cec5SDimitry Andric /** @endcond */
39840b57cec5SDimitry Andric 
39850b57cec5SDimitry Andric /** @cond exclude_from_gpa_documentation */
39860b57cec5SDimitry Andric 
39870b57cec5SDimitry Andric /** @} arrays group */
39880b57cec5SDimitry Andric 
39890b57cec5SDimitry Andric /** @endcond */
39900b57cec5SDimitry Andric 
39910b57cec5SDimitry Andric /**
3992349cc55cSDimitry Andric  * @brief Module load notification
3993349cc55cSDimitry Andric  * This API is used to report necessary information in case of bypassing default
3994349cc55cSDimitry Andric  * system loader. Notification should be done immidiatelly after this module is
3995349cc55cSDimitry Andric  * loaded to process memory.
3996349cc55cSDimitry Andric  * @param[in] start_addr - module start address
3997349cc55cSDimitry Andric  * @param[in] end_addr - module end address
3998349cc55cSDimitry Andric  * @param[in] path - file system full path to the module
39990b57cec5SDimitry Andric  */
40000b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4001fe6060f1SDimitry Andric void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr,
4002fe6060f1SDimitry Andric                                const char *path);
4003fe6060f1SDimitry Andric void ITTAPI __itt_module_loadW(void *start_addr, void *end_addr,
4004fe6060f1SDimitry Andric                                const wchar_t *path);
40050b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
40060b57cec5SDimitry Andric #define __itt_module_load __itt_module_loadW
40070b57cec5SDimitry Andric #define __itt_module_load_ptr __itt_module_loadW_ptr
40080b57cec5SDimitry Andric #else /* UNICODE */
40090b57cec5SDimitry Andric #define __itt_module_load __itt_module_loadA
40100b57cec5SDimitry Andric #define __itt_module_load_ptr __itt_module_loadA_ptr
40110b57cec5SDimitry Andric #endif /* UNICODE */
40120b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4013fe6060f1SDimitry Andric void ITTAPI __itt_module_load(void *start_addr, void *end_addr,
4014fe6060f1SDimitry Andric                               const char *path);
40150b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40160b57cec5SDimitry Andric 
40170b57cec5SDimitry Andric /** @cond exclude_from_documentation */
40180b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
40190b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
40200b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4021fe6060f1SDimitry Andric ITT_STUB(ITTAPI, void, module_loadA,
4022fe6060f1SDimitry Andric          (void *start_addr, void *end_addr, const char *path))
4023fe6060f1SDimitry Andric ITT_STUB(ITTAPI, void, module_loadW,
4024fe6060f1SDimitry Andric          (void *start_addr, void *end_addr, const wchar_t *path))
40250b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4026fe6060f1SDimitry Andric ITT_STUB(ITTAPI, void, module_load,
4027fe6060f1SDimitry Andric          (void *start_addr, void *end_addr, const char *path))
40280b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40290b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
40300b57cec5SDimitry Andric #define __itt_module_loadA ITTNOTIFY_VOID(module_loadA)
40310b57cec5SDimitry Andric #define __itt_module_loadA_ptr ITTNOTIFY_NAME(module_loadA)
40320b57cec5SDimitry Andric #define __itt_module_loadW ITTNOTIFY_VOID(module_loadW)
40330b57cec5SDimitry Andric #define __itt_module_loadW_ptr ITTNOTIFY_NAME(module_loadW)
40340b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40350b57cec5SDimitry Andric #define __itt_module_load ITTNOTIFY_VOID(module_load)
40360b57cec5SDimitry Andric #define __itt_module_load_ptr ITTNOTIFY_NAME(module_load)
40370b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40380b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
40390b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
40400b57cec5SDimitry Andric #define __itt_module_loadA(start_addr, end_addr, path)
40410b57cec5SDimitry Andric #define __itt_module_loadA_ptr 0
40420b57cec5SDimitry Andric #define __itt_module_loadW(start_addr, end_addr, path)
40430b57cec5SDimitry Andric #define __itt_module_loadW_ptr 0
40440b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40450b57cec5SDimitry Andric #define __itt_module_load(start_addr, end_addr, path)
40460b57cec5SDimitry Andric #define __itt_module_load_ptr 0
40470b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40480b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
40490b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
40500b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
40510b57cec5SDimitry Andric #define __itt_module_loadA_ptr 0
40520b57cec5SDimitry Andric #define __itt_module_loadW_ptr 0
40530b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40540b57cec5SDimitry Andric #define __itt_module_load_ptr 0
40550b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
40560b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
40570b57cec5SDimitry Andric /** @endcond */
40580b57cec5SDimitry Andric 
4059349cc55cSDimitry Andric /**
4060349cc55cSDimitry Andric  * @brief Report module unload
4061349cc55cSDimitry Andric  * This API is used to report necessary information in case of bypassing default
4062349cc55cSDimitry Andric  * system loader. Notification should be done just before the module is unloaded
4063349cc55cSDimitry Andric  * from process memory.
4064349cc55cSDimitry Andric  * @param[in] addr - base address of loaded module
4065349cc55cSDimitry Andric  */
4066349cc55cSDimitry Andric void ITTAPI __itt_module_unload(void *addr);
4067349cc55cSDimitry Andric 
4068349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4069349cc55cSDimitry Andric #ifndef INTEL_NO_MACRO_BODY
4070349cc55cSDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
4071349cc55cSDimitry Andric ITT_STUBV(ITTAPI, void, module_unload, (void *addr))
4072349cc55cSDimitry Andric #define __itt_module_unload ITTNOTIFY_VOID(module_unload)
4073349cc55cSDimitry Andric #define __itt_module_unload_ptr ITTNOTIFY_NAME(module_unload)
4074349cc55cSDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
4075349cc55cSDimitry Andric #define __itt_module_unload(addr)
4076349cc55cSDimitry Andric #define __itt_module_unload_ptr 0
4077349cc55cSDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
4078349cc55cSDimitry Andric #else /* INTEL_NO_MACRO_BODY */
4079349cc55cSDimitry Andric #define __itt_module_unload_ptr 0
4080349cc55cSDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
4081349cc55cSDimitry Andric /** @endcond */
4082349cc55cSDimitry Andric 
4083349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4084349cc55cSDimitry Andric typedef enum {
4085349cc55cSDimitry Andric   __itt_module_type_unknown = 0,
4086349cc55cSDimitry Andric   __itt_module_type_elf,
4087349cc55cSDimitry Andric   __itt_module_type_coff
4088349cc55cSDimitry Andric } __itt_module_type;
4089349cc55cSDimitry Andric /** @endcond */
4090349cc55cSDimitry Andric 
4091349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4092349cc55cSDimitry Andric typedef enum {
4093349cc55cSDimitry Andric   itt_section_type_unknown,
4094349cc55cSDimitry Andric   itt_section_type_bss, /* notifies that the section contains uninitialized
4095349cc55cSDimitry Andric                          * data. These are the relevant section types and the
4096349cc55cSDimitry Andric                          * modules that contain them: ELF module:  SHT_NOBITS
4097349cc55cSDimitry Andric                          * section type COFF module:
4098349cc55cSDimitry Andric                          * IMAGE_SCN_CNT_UNINITIALIZED_DATA section type
4099349cc55cSDimitry Andric                          */
4100349cc55cSDimitry Andric   itt_section_type_data, /* notifies that section contains initialized data.
4101349cc55cSDimitry Andric                           * These are the relevant section types and the modules
4102349cc55cSDimitry Andric                           * that contain them: ELF module:  SHT_PROGBITS section
4103349cc55cSDimitry Andric                           * type COFF module: IMAGE_SCN_CNT_INITIALIZED_DATA
4104349cc55cSDimitry Andric                           * section type
4105349cc55cSDimitry Andric                           */
4106349cc55cSDimitry Andric   itt_section_type_text /* notifies that the section contains executable code.
4107349cc55cSDimitry Andric                          * These are the relevant section types and the modules
4108349cc55cSDimitry Andric                          * that contain them: ELF module:  SHT_PROGBITS section
4109349cc55cSDimitry Andric                          * type COFF module: IMAGE_SCN_CNT_CODE section type
4110349cc55cSDimitry Andric                          */
4111349cc55cSDimitry Andric } __itt_section_type;
4112349cc55cSDimitry Andric /** @endcond */
4113349cc55cSDimitry Andric 
4114349cc55cSDimitry Andric /**
4115349cc55cSDimitry Andric  * @hideinitializer
4116349cc55cSDimitry Andric  * @brief bit-mask, detects a section attribute that indicates whether a section
4117349cc55cSDimitry Andric  * can be executed as code: These are the relevant section attributes and the
4118349cc55cSDimitry Andric  * modules that contain them: ELF module:  PF_X section attribute COFF module:
4119349cc55cSDimitry Andric  * IMAGE_SCN_MEM_EXECUTE attribute
4120349cc55cSDimitry Andric  */
4121349cc55cSDimitry Andric #define __itt_section_exec 0x20000000
4122349cc55cSDimitry Andric 
4123349cc55cSDimitry Andric /**
4124349cc55cSDimitry Andric  * @hideinitializer
4125349cc55cSDimitry Andric  * @brief bit-mask, detects a section attribute that indicates whether a section
4126349cc55cSDimitry Andric  * can be read. These are the relevant section attributes and the modules that
4127349cc55cSDimitry Andric  * contain them: ELF module:  PF_R attribute COFF module: IMAGE_SCN_MEM_READ
4128349cc55cSDimitry Andric  * attribute
4129349cc55cSDimitry Andric  */
4130349cc55cSDimitry Andric #define __itt_section_read 0x40000000
4131349cc55cSDimitry Andric 
4132349cc55cSDimitry Andric /**
4133349cc55cSDimitry Andric  * @hideinitializer
4134349cc55cSDimitry Andric  * @brief bit-mask, detects a section attribute that indicates whether a section
4135349cc55cSDimitry Andric  * can be written to. These are the relevant section attributes and the modules
4136349cc55cSDimitry Andric  * that contain them: ELF module:  PF_W attribute COFF module:
4137349cc55cSDimitry Andric  * IMAGE_SCN_MEM_WRITE attribute
4138349cc55cSDimitry Andric  */
4139349cc55cSDimitry Andric #define __itt_section_write 0x80000000
4140349cc55cSDimitry Andric 
4141349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4142349cc55cSDimitry Andric #pragma pack(push, 8)
4143349cc55cSDimitry Andric 
4144349cc55cSDimitry Andric typedef struct ___itt_section_info {
4145349cc55cSDimitry Andric   const char *name; /*!< Section name in UTF8 */
4146349cc55cSDimitry Andric   __itt_section_type type; /*!< Section content and semantics description */
4147349cc55cSDimitry Andric   size_t flags; /*!< Section bit flags that describe attributes using bit mask
4148349cc55cSDimitry Andric                  * Zero if disabled, non-zero if enabled
4149349cc55cSDimitry Andric                  */
4150349cc55cSDimitry Andric   void *start_addr; /*!< Section load(relocated) start address */
4151349cc55cSDimitry Andric   size_t size; /*!< Section file offset */
4152349cc55cSDimitry Andric   size_t file_offset; /*!< Section size */
4153349cc55cSDimitry Andric } __itt_section_info;
4154349cc55cSDimitry Andric 
4155349cc55cSDimitry Andric #pragma pack(pop)
4156349cc55cSDimitry Andric /** @endcond */
4157349cc55cSDimitry Andric 
4158349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4159349cc55cSDimitry Andric #pragma pack(push, 8)
4160349cc55cSDimitry Andric 
4161349cc55cSDimitry Andric typedef struct ___itt_module_object {
4162349cc55cSDimitry Andric   unsigned int version; /*!< API version*/
4163349cc55cSDimitry Andric   __itt_id module_id; /*!< Unique identifier. This is unchanged for sections
4164349cc55cSDimitry Andric                          that belong to the same module */
4165349cc55cSDimitry Andric   __itt_module_type module_type; /*!< Binary module format */
4166349cc55cSDimitry Andric   const char *module_name; /*!< Unique module name or path to module in UTF8
4167349cc55cSDimitry Andric                             * Contains module name when module_bufer and
4168349cc55cSDimitry Andric                             * module_size exist Contains module path when
4169349cc55cSDimitry Andric                             * module_bufer and module_size absent module_name
4170349cc55cSDimitry Andric                             * remains the same for the certain module_id
4171349cc55cSDimitry Andric                             */
4172349cc55cSDimitry Andric   void *module_buffer; /*!< Module buffer content */
4173349cc55cSDimitry Andric   size_t module_size; /*!< Module buffer size */
4174349cc55cSDimitry Andric   /*!< If module_buffer and module_size exist, the binary module is dumped onto
4175349cc55cSDimitry Andric    * the system. If module_buffer and module_size do not exist, the binary
4176349cc55cSDimitry Andric    * module exists on the system already. The module_name parameter contains the
4177349cc55cSDimitry Andric    * path to the module.
4178349cc55cSDimitry Andric    */
4179349cc55cSDimitry Andric   __itt_section_info *section_array; /*!< Reference to section information */
4180349cc55cSDimitry Andric   size_t section_number;
4181349cc55cSDimitry Andric } __itt_module_object;
4182349cc55cSDimitry Andric 
4183349cc55cSDimitry Andric #pragma pack(pop)
4184349cc55cSDimitry Andric /** @endcond */
4185349cc55cSDimitry Andric 
4186349cc55cSDimitry Andric /**
4187349cc55cSDimitry Andric  * @brief Load module content and its loaded(relocated) sections.
4188349cc55cSDimitry Andric  * This API is useful to save a module, or specify its location on the system
4189349cc55cSDimitry Andric  * and report information about loaded sections. The target module is saved on
4190349cc55cSDimitry Andric  * the system if module buffer content and size are available. If module buffer
4191349cc55cSDimitry Andric  * content and size are unavailable, the module name contains the path to the
4192349cc55cSDimitry Andric  * existing binary module.
4193349cc55cSDimitry Andric  * @param[in] module_obj - provides module and section information, along with
4194349cc55cSDimitry Andric  * unique module identifiers (name,module ID) which bind the binary module to
4195349cc55cSDimitry Andric  * particular sections.
4196349cc55cSDimitry Andric  */
4197349cc55cSDimitry Andric void ITTAPI __itt_module_load_with_sections(__itt_module_object *module_obj);
4198349cc55cSDimitry Andric 
4199349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4200349cc55cSDimitry Andric #ifndef INTEL_NO_MACRO_BODY
4201349cc55cSDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
4202349cc55cSDimitry Andric ITT_STUBV(ITTAPI, void, module_load_with_sections,
4203349cc55cSDimitry Andric           (__itt_module_object * module_obj))
4204349cc55cSDimitry Andric #define __itt_module_load_with_sections                                        \
4205349cc55cSDimitry Andric   ITTNOTIFY_VOID(module_load_with_sections)
4206349cc55cSDimitry Andric #define __itt_module_load_with_sections_ptr                                    \
4207349cc55cSDimitry Andric   ITTNOTIFY_NAME(module_load_with_sections)
4208349cc55cSDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
4209349cc55cSDimitry Andric #define __itt_module_load_with_sections(module_obj)
4210349cc55cSDimitry Andric #define __itt_module_load_with_sections_ptr 0
4211349cc55cSDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
4212349cc55cSDimitry Andric #else /* INTEL_NO_MACRO_BODY */
4213349cc55cSDimitry Andric #define __itt_module_load_with_sections_ptr 0
4214349cc55cSDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
4215349cc55cSDimitry Andric /** @endcond */
4216349cc55cSDimitry Andric 
4217349cc55cSDimitry Andric /**
4218349cc55cSDimitry Andric  * @brief Unload a module and its loaded(relocated) sections.
4219349cc55cSDimitry Andric  * This API notifies that the module and its sections were unloaded.
4220349cc55cSDimitry Andric  * @param[in] module_obj - provides module and sections information, along with
4221349cc55cSDimitry Andric  * unique module identifiers (name,module ID) which bind the binary module to
4222349cc55cSDimitry Andric  * particular sections.
4223349cc55cSDimitry Andric  */
4224349cc55cSDimitry Andric void ITTAPI __itt_module_unload_with_sections(__itt_module_object *module_obj);
4225349cc55cSDimitry Andric 
4226349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4227349cc55cSDimitry Andric #ifndef INTEL_NO_MACRO_BODY
4228349cc55cSDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
4229349cc55cSDimitry Andric ITT_STUBV(ITTAPI, void, module_unload_with_sections,
4230349cc55cSDimitry Andric           (__itt_module_object * module_obj))
4231349cc55cSDimitry Andric #define __itt_module_unload_with_sections                                      \
4232349cc55cSDimitry Andric   ITTNOTIFY_VOID(module_unload_with_sections)
4233349cc55cSDimitry Andric #define __itt_module_unload_with_sections_ptr                                  \
4234349cc55cSDimitry Andric   ITTNOTIFY_NAME(module_unload_with_sections)
4235349cc55cSDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
4236349cc55cSDimitry Andric #define __itt_module_unload_with_sections(module_obj)
4237349cc55cSDimitry Andric #define __itt_module_unload_with_sections_ptr 0
4238349cc55cSDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
4239349cc55cSDimitry Andric #else /* INTEL_NO_MACRO_BODY */
4240349cc55cSDimitry Andric #define __itt_module_unload_with_sections_ptr 0
4241349cc55cSDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
4242349cc55cSDimitry Andric /** @endcond */
4243349cc55cSDimitry Andric 
4244349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4245349cc55cSDimitry Andric #pragma pack(push, 8)
4246349cc55cSDimitry Andric 
4247349cc55cSDimitry Andric typedef struct ___itt_histogram {
4248349cc55cSDimitry Andric   const __itt_domain *domain; /*!< Domain of the histogram*/
4249349cc55cSDimitry Andric   const char *nameA; /*!< Name of the histogram */
4250349cc55cSDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
4251349cc55cSDimitry Andric   const wchar_t *nameW;
4252349cc55cSDimitry Andric #else /* UNICODE || _UNICODE */
4253349cc55cSDimitry Andric   void *nameW;
4254349cc55cSDimitry Andric #endif /* UNICODE || _UNICODE */
4255349cc55cSDimitry Andric   __itt_metadata_type x_type; /*!< Type of the histogram X axis */
4256349cc55cSDimitry Andric   __itt_metadata_type y_type; /*!< Type of the histogram Y axis */
4257349cc55cSDimitry Andric   int extra1; /*!< Reserved to the runtime */
4258349cc55cSDimitry Andric   void *extra2; /*!< Reserved to the runtime */
4259349cc55cSDimitry Andric   struct ___itt_histogram *next;
4260349cc55cSDimitry Andric } __itt_histogram;
4261349cc55cSDimitry Andric 
4262349cc55cSDimitry Andric #pragma pack(pop)
4263349cc55cSDimitry Andric /** @endcond */
4264349cc55cSDimitry Andric 
4265349cc55cSDimitry Andric /**
4266349cc55cSDimitry Andric  * @brief Create a typed histogram instance with given name/domain.
4267349cc55cSDimitry Andric  * @param[in] domain The domain controlling the call.
4268349cc55cSDimitry Andric  * @param[in] name   The name of the histogram.
4269349cc55cSDimitry Andric  * @param[in] x_type The type of the X axis in histogram (may be 0 to calculate
4270349cc55cSDimitry Andric  * batch statistics).
4271349cc55cSDimitry Andric  * @param[in] y_type The type of the Y axis in histogram.
4272349cc55cSDimitry Andric  */
4273349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4274349cc55cSDimitry Andric __itt_histogram *ITTAPI __itt_histogram_createA(const __itt_domain *domain,
4275349cc55cSDimitry Andric                                                 const char *name,
4276349cc55cSDimitry Andric                                                 __itt_metadata_type x_type,
4277349cc55cSDimitry Andric                                                 __itt_metadata_type y_type);
4278349cc55cSDimitry Andric __itt_histogram *ITTAPI __itt_histogram_createW(const __itt_domain *domain,
4279349cc55cSDimitry Andric                                                 const wchar_t *name,
4280349cc55cSDimitry Andric                                                 __itt_metadata_type x_type,
4281349cc55cSDimitry Andric                                                 __itt_metadata_type y_type);
4282349cc55cSDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
4283349cc55cSDimitry Andric #define __itt_histogram_create __itt_histogram_createW
4284349cc55cSDimitry Andric #define __itt_histogram_create_ptr __itt_histogram_createW_ptr
4285349cc55cSDimitry Andric #else /* UNICODE */
4286349cc55cSDimitry Andric #define __itt_histogram_create __itt_histogram_createA
4287349cc55cSDimitry Andric #define __itt_histogram_create_ptr __itt_histogram_createA_ptr
4288349cc55cSDimitry Andric #endif /* UNICODE */
4289349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4290349cc55cSDimitry Andric __itt_histogram *ITTAPI __itt_histogram_create(const __itt_domain *domain,
4291349cc55cSDimitry Andric                                                const char *name,
4292349cc55cSDimitry Andric                                                __itt_metadata_type x_type,
4293349cc55cSDimitry Andric                                                __itt_metadata_type y_type);
4294349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4295349cc55cSDimitry Andric 
4296349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4297349cc55cSDimitry Andric #ifndef INTEL_NO_MACRO_BODY
4298349cc55cSDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
4299349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4300349cc55cSDimitry Andric ITT_STUB(ITTAPI, __itt_histogram *, histogram_createA,
4301349cc55cSDimitry Andric          (const __itt_domain *domain, const char *name,
4302349cc55cSDimitry Andric           __itt_metadata_type x_type, __itt_metadata_type y_type))
4303349cc55cSDimitry Andric ITT_STUB(ITTAPI, __itt_histogram *, histogram_createW,
4304349cc55cSDimitry Andric          (const __itt_domain *domain, const wchar_t *name,
4305349cc55cSDimitry Andric           __itt_metadata_type x_type, __itt_metadata_type y_type))
4306349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4307349cc55cSDimitry Andric ITT_STUB(ITTAPI, __itt_histogram *, histogram_create,
4308349cc55cSDimitry Andric          (const __itt_domain *domain, const char *name,
4309349cc55cSDimitry Andric           __itt_metadata_type x_type, __itt_metadata_type y_type))
4310349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4311349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4312349cc55cSDimitry Andric #define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
4313349cc55cSDimitry Andric #define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
4314349cc55cSDimitry Andric #define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
4315349cc55cSDimitry Andric #define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
4316349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4317349cc55cSDimitry Andric #define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
4318349cc55cSDimitry Andric #define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
4319349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4320349cc55cSDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
4321349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4322349cc55cSDimitry Andric #define __itt_histogram_createA(domain, name, x_type, y_type)                  \
4323349cc55cSDimitry Andric   (__itt_histogram *)0
4324349cc55cSDimitry Andric #define __itt_histogram_createA_ptr 0
4325349cc55cSDimitry Andric #define __itt_histogram_createW(domain, name, x_type, y_type)                  \
4326349cc55cSDimitry Andric   (__itt_histogram *)0
4327349cc55cSDimitry Andric #define __itt_histogram_createW_ptr 0
4328349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4329349cc55cSDimitry Andric #define __itt_histogram_create(domain, name, x_type, y_type)                   \
4330349cc55cSDimitry Andric   (__itt_histogram *)0
4331349cc55cSDimitry Andric #define __itt_histogram_create_ptr 0
4332349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4333349cc55cSDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
4334349cc55cSDimitry Andric #else /* INTEL_NO_MACRO_BODY */
4335349cc55cSDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
4336349cc55cSDimitry Andric #define __itt_histogram_createA_ptr 0
4337349cc55cSDimitry Andric #define __itt_histogram_createW_ptr 0
4338349cc55cSDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4339349cc55cSDimitry Andric #define __itt_histogram_create_ptr 0
4340349cc55cSDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4341349cc55cSDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
4342349cc55cSDimitry Andric /** @endcond */
4343349cc55cSDimitry Andric 
4344349cc55cSDimitry Andric /**
4345349cc55cSDimitry Andric  * @brief Submit statistics for a histogram instance.
4346349cc55cSDimitry Andric  * @param[in] hist    Pointer to the histogram instance to which the histogram
4347349cc55cSDimitry Andric  * statistic is to be dumped.
4348349cc55cSDimitry Andric  * @param[in] length  The number of elements in dumped axis data array.
4349349cc55cSDimitry Andric  * @param[in] x_data  The X axis dumped data itself (may be NULL to calculate
4350349cc55cSDimitry Andric  * batch statistics).
4351349cc55cSDimitry Andric  * @param[in] y_data  The Y axis dumped data itself.
4352349cc55cSDimitry Andric  */
4353349cc55cSDimitry Andric void ITTAPI __itt_histogram_submit(__itt_histogram *hist, size_t length,
4354349cc55cSDimitry Andric                                    void *x_data, void *y_data);
4355349cc55cSDimitry Andric 
4356349cc55cSDimitry Andric /** @cond exclude_from_documentation */
4357349cc55cSDimitry Andric #ifndef INTEL_NO_MACRO_BODY
4358349cc55cSDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
4359349cc55cSDimitry Andric ITT_STUBV(ITTAPI, void, histogram_submit,
4360349cc55cSDimitry Andric           (__itt_histogram * hist, size_t length, void *x_data, void *y_data))
4361349cc55cSDimitry Andric #define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
4362349cc55cSDimitry Andric #define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
4363349cc55cSDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
4364349cc55cSDimitry Andric #define __itt_histogram_submit(hist, length, x_data, y_data)
4365349cc55cSDimitry Andric #define __itt_histogram_submit_ptr 0
4366349cc55cSDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
4367349cc55cSDimitry Andric #else /* INTEL_NO_MACRO_BODY */
4368349cc55cSDimitry Andric #define __itt_histogram_submit_ptr 0
4369349cc55cSDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
4370349cc55cSDimitry Andric /** @endcond */
4371349cc55cSDimitry Andric 
43720b57cec5SDimitry Andric #ifdef __cplusplus
43730b57cec5SDimitry Andric }
43740b57cec5SDimitry Andric #endif /* __cplusplus */
43750b57cec5SDimitry Andric 
43760b57cec5SDimitry Andric #endif /* _ITTNOTIFY_H_ */
43770b57cec5SDimitry Andric 
43780b57cec5SDimitry Andric #ifdef INTEL_ITTNOTIFY_API_PRIVATE
43790b57cec5SDimitry Andric 
43800b57cec5SDimitry Andric #ifndef _ITTNOTIFY_PRIVATE_
43810b57cec5SDimitry Andric #define _ITTNOTIFY_PRIVATE_
43820b57cec5SDimitry Andric 
43830b57cec5SDimitry Andric #ifdef __cplusplus
43840b57cec5SDimitry Andric extern "C" {
43850b57cec5SDimitry Andric #endif /* __cplusplus */
43860b57cec5SDimitry Andric 
43870b57cec5SDimitry Andric /**
43880b57cec5SDimitry Andric  * @ingroup clockdomain
43890b57cec5SDimitry Andric  * @brief Begin an overlapped task instance.
43900b57cec5SDimitry Andric  * @param[in] domain The domain for this task
4391fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
4392fe6060f1SDimitry Andric  * call.
43930b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
4394fe6060f1SDimitry Andric  * @param[in] taskid The identifier for this task instance, *cannot* be
4395fe6060f1SDimitry Andric  * __itt_null.
43960b57cec5SDimitry Andric  * @param[in] parentid The parent of this task, or __itt_null.
43970b57cec5SDimitry Andric  * @param[in] name The name of this task.
43980b57cec5SDimitry Andric  */
4399fe6060f1SDimitry Andric void ITTAPI __itt_task_begin_overlapped_ex(const __itt_domain *domain,
4400fe6060f1SDimitry Andric                                            __itt_clock_domain *clock_domain,
4401fe6060f1SDimitry Andric                                            unsigned long long timestamp,
4402fe6060f1SDimitry Andric                                            __itt_id taskid, __itt_id parentid,
4403fe6060f1SDimitry Andric                                            __itt_string_handle *name);
44040b57cec5SDimitry Andric 
44050b57cec5SDimitry Andric /**
44060b57cec5SDimitry Andric  * @ingroup clockdomain
44070b57cec5SDimitry Andric  * @brief End an overlapped task instance.
44080b57cec5SDimitry Andric  * @param[in] domain The domain for this task
4409fe6060f1SDimitry Andric  * @param[in] clock_domain The clock domain controlling the execution of this
4410fe6060f1SDimitry Andric  * call.
44110b57cec5SDimitry Andric  * @param[in] timestamp The user defined timestamp.
44120b57cec5SDimitry Andric  * @param[in] taskid Explicit ID of finished task
44130b57cec5SDimitry Andric  */
4414fe6060f1SDimitry Andric void ITTAPI __itt_task_end_overlapped_ex(const __itt_domain *domain,
4415fe6060f1SDimitry Andric                                          __itt_clock_domain *clock_domain,
4416fe6060f1SDimitry Andric                                          unsigned long long timestamp,
4417fe6060f1SDimitry Andric                                          __itt_id taskid);
44180b57cec5SDimitry Andric 
44190b57cec5SDimitry Andric /** @cond exclude_from_documentation */
44200b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
44210b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
4422fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex,
4423fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
4424fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id taskid, __itt_id parentid,
4425fe6060f1SDimitry Andric            __itt_string_handle *name))
4426fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, task_end_overlapped_ex,
4427fe6060f1SDimitry Andric           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
4428fe6060f1SDimitry Andric            unsigned long long timestamp, __itt_id taskid))
4429fe6060f1SDimitry Andric #define __itt_task_begin_overlapped_ex(d, x, y, z, a, b)                       \
4430fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D5(task_begin_overlapped_ex, d, x, y, z, a, b)
4431fe6060f1SDimitry Andric #define __itt_task_begin_overlapped_ex_ptr                                     \
4432fe6060f1SDimitry Andric   ITTNOTIFY_NAME(task_begin_overlapped_ex)
4433fe6060f1SDimitry Andric #define __itt_task_end_overlapped_ex(d, x, y, z)                               \
4434fe6060f1SDimitry Andric   ITTNOTIFY_VOID_D3(task_end_overlapped_ex, d, x, y, z)
44350b57cec5SDimitry Andric #define __itt_task_end_overlapped_ex_ptr ITTNOTIFY_NAME(task_end_overlapped_ex)
44360b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
4437fe6060f1SDimitry Andric #define __itt_task_begin_overlapped_ex(domain, clock_domain, timestamp,        \
4438fe6060f1SDimitry Andric                                        taskid, parentid, name)
44390b57cec5SDimitry Andric #define __itt_task_begin_overlapped_ex_ptr 0
44400b57cec5SDimitry Andric #define __itt_task_end_overlapped_ex(domain, clock_domain, timestamp, taskid)
44410b57cec5SDimitry Andric #define __itt_task_end_overlapped_ex_ptr 0
44420b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
44430b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
44440b57cec5SDimitry Andric #define __itt_task_begin_overlapped_ex_ptr 0
44450b57cec5SDimitry Andric #define __itt_task_end_overlapped_ptr 0
44460b57cec5SDimitry Andric #define __itt_task_end_overlapped_ex_ptr 0
44470b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
44480b57cec5SDimitry Andric /** @endcond */
44490b57cec5SDimitry Andric 
44500b57cec5SDimitry Andric /**
44510b57cec5SDimitry Andric  * @defgroup makrs_internal Marks
44520b57cec5SDimitry Andric  * @ingroup internal
44530b57cec5SDimitry Andric  * Marks group
44540b57cec5SDimitry Andric  * @warning Internal API:
44550b57cec5SDimitry Andric  *   - It is not shipped to outside of Intel
44560b57cec5SDimitry Andric  *   - It is delivered to internal Intel teams using e-mail or SVN access only
44570b57cec5SDimitry Andric  * @{
44580b57cec5SDimitry Andric  */
44590b57cec5SDimitry Andric /** @brief user mark type */
44600b57cec5SDimitry Andric typedef int __itt_mark_type;
44610b57cec5SDimitry Andric 
44620b57cec5SDimitry Andric /**
4463fe6060f1SDimitry Andric  * @brief Creates a user mark type with the specified name using char or Unicode
4464fe6060f1SDimitry Andric  * string.
44650b57cec5SDimitry Andric  * @param[in] name - name of mark to create
44660b57cec5SDimitry Andric  * @return Returns a handle to the mark type
44670b57cec5SDimitry Andric  */
44680b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
44690b57cec5SDimitry Andric __itt_mark_type ITTAPI __itt_mark_createA(const char *name);
44700b57cec5SDimitry Andric __itt_mark_type ITTAPI __itt_mark_createW(const wchar_t *name);
44710b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
44720b57cec5SDimitry Andric #define __itt_mark_create __itt_mark_createW
44730b57cec5SDimitry Andric #define __itt_mark_create_ptr __itt_mark_createW_ptr
44740b57cec5SDimitry Andric #else /* UNICODE */
44750b57cec5SDimitry Andric #define __itt_mark_create __itt_mark_createA
44760b57cec5SDimitry Andric #define __itt_mark_create_ptr __itt_mark_createA_ptr
44770b57cec5SDimitry Andric #endif /* UNICODE */
44780b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
44790b57cec5SDimitry Andric __itt_mark_type ITTAPI __itt_mark_create(const char *name);
44800b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
44810b57cec5SDimitry Andric 
44820b57cec5SDimitry Andric /** @cond exclude_from_documentation */
44830b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
44840b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
44850b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
44860b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name))
44870b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name))
44880b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
44890b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name))
44900b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
44910b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
44920b57cec5SDimitry Andric #define __itt_mark_createA ITTNOTIFY_DATA(mark_createA)
44930b57cec5SDimitry Andric #define __itt_mark_createA_ptr ITTNOTIFY_NAME(mark_createA)
44940b57cec5SDimitry Andric #define __itt_mark_createW ITTNOTIFY_DATA(mark_createW)
44950b57cec5SDimitry Andric #define __itt_mark_createW_ptr ITTNOTIFY_NAME(mark_createW)
44960b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
44970b57cec5SDimitry Andric #define __itt_mark_create ITTNOTIFY_DATA(mark_create)
44980b57cec5SDimitry Andric #define __itt_mark_create_ptr ITTNOTIFY_NAME(mark_create)
44990b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45000b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
45010b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45020b57cec5SDimitry Andric #define __itt_mark_createA(name) (__itt_mark_type)0
45030b57cec5SDimitry Andric #define __itt_mark_createA_ptr 0
45040b57cec5SDimitry Andric #define __itt_mark_createW(name) (__itt_mark_type)0
45050b57cec5SDimitry Andric #define __itt_mark_createW_ptr 0
45060b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45070b57cec5SDimitry Andric #define __itt_mark_create(name) (__itt_mark_type)0
45080b57cec5SDimitry Andric #define __itt_mark_create_ptr 0
45090b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45100b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
45110b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
45120b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45130b57cec5SDimitry Andric #define __itt_mark_createA_ptr 0
45140b57cec5SDimitry Andric #define __itt_mark_createW_ptr 0
45150b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45160b57cec5SDimitry Andric #define __itt_mark_create_ptr 0
45170b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45180b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
45190b57cec5SDimitry Andric /** @endcond */
45200b57cec5SDimitry Andric 
45210b57cec5SDimitry Andric /**
4522fe6060f1SDimitry Andric  * @brief Creates a "discrete" user mark type of the specified type and an
4523fe6060f1SDimitry Andric  * optional parameter using char or Unicode string.
45240b57cec5SDimitry Andric  *
4525fe6060f1SDimitry Andric  * - The mark of "discrete" type is placed to collection results in case of
4526fe6060f1SDimitry Andric  * success. It appears in overtime view(s) as a special tick sign.
4527fe6060f1SDimitry Andric  * - The call is "synchronous" - function returns after mark is actually added
4528fe6060f1SDimitry Andric  * to results.
4529fe6060f1SDimitry Andric  * - This function is useful, for example, to mark different phases of
4530fe6060f1SDimitry Andric  * application (beginning of the next mark automatically meand end of current
4531fe6060f1SDimitry Andric  * region).
4532fe6060f1SDimitry Andric  * - Can be used together with "continuous" marks (see below) at the same
4533fe6060f1SDimitry Andric  * collection session
45340b57cec5SDimitry Andric  * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
45350b57cec5SDimitry Andric  * @param[in] parameter - string parameter of mark
45360b57cec5SDimitry Andric  * @return Returns zero value in case of success, non-zero value otherwise.
45370b57cec5SDimitry Andric  */
45380b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45390b57cec5SDimitry Andric int ITTAPI __itt_markA(__itt_mark_type mt, const char *parameter);
45400b57cec5SDimitry Andric int ITTAPI __itt_markW(__itt_mark_type mt, const wchar_t *parameter);
45410b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
45420b57cec5SDimitry Andric #define __itt_mark __itt_markW
45430b57cec5SDimitry Andric #define __itt_mark_ptr __itt_markW_ptr
45440b57cec5SDimitry Andric #else /* UNICODE  */
45450b57cec5SDimitry Andric #define __itt_mark __itt_markA
45460b57cec5SDimitry Andric #define __itt_mark_ptr __itt_markA_ptr
45470b57cec5SDimitry Andric #endif /* UNICODE */
45480b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45490b57cec5SDimitry Andric int ITTAPI __itt_mark(__itt_mark_type mt, const char *parameter);
45500b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45510b57cec5SDimitry Andric 
45520b57cec5SDimitry Andric /** @cond exclude_from_documentation */
45530b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
45540b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
45550b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45560b57cec5SDimitry Andric ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter))
45570b57cec5SDimitry Andric ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter))
45580b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45590b57cec5SDimitry Andric ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter))
45600b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45610b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45620b57cec5SDimitry Andric #define __itt_markA ITTNOTIFY_DATA(markA)
45630b57cec5SDimitry Andric #define __itt_markA_ptr ITTNOTIFY_NAME(markA)
45640b57cec5SDimitry Andric #define __itt_markW ITTNOTIFY_DATA(markW)
45650b57cec5SDimitry Andric #define __itt_markW_ptr ITTNOTIFY_NAME(markW)
45660b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45670b57cec5SDimitry Andric #define __itt_mark ITTNOTIFY_DATA(mark)
45680b57cec5SDimitry Andric #define __itt_mark_ptr ITTNOTIFY_NAME(mark)
45690b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45700b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
45710b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45720b57cec5SDimitry Andric #define __itt_markA(mt, parameter) (int)0
45730b57cec5SDimitry Andric #define __itt_markA_ptr 0
45740b57cec5SDimitry Andric #define __itt_markW(mt, parameter) (int)0
45750b57cec5SDimitry Andric #define __itt_markW_ptr 0
45760b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45770b57cec5SDimitry Andric #define __itt_mark(mt, parameter) (int)0
45780b57cec5SDimitry Andric #define __itt_mark_ptr 0
45790b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45800b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
45810b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
45820b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45830b57cec5SDimitry Andric #define __itt_markA_ptr 0
45840b57cec5SDimitry Andric #define __itt_markW_ptr 0
45850b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45860b57cec5SDimitry Andric #define __itt_mark_ptr 0
45870b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
45880b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
45890b57cec5SDimitry Andric /** @endcond */
45900b57cec5SDimitry Andric 
45910b57cec5SDimitry Andric /**
4592fe6060f1SDimitry Andric  * @brief Use this if necessary to create a "discrete" user event type (mark)
4593fe6060f1SDimitry Andric  * for process rather then for one thread
45940b57cec5SDimitry Andric  * @see int __itt_mark(__itt_mark_type mt, const char* parameter);
45950b57cec5SDimitry Andric  */
45960b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
45970b57cec5SDimitry Andric int ITTAPI __itt_mark_globalA(__itt_mark_type mt, const char *parameter);
45980b57cec5SDimitry Andric int ITTAPI __itt_mark_globalW(__itt_mark_type mt, const wchar_t *parameter);
45990b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE)
46000b57cec5SDimitry Andric #define __itt_mark_global __itt_mark_globalW
46010b57cec5SDimitry Andric #define __itt_mark_global_ptr __itt_mark_globalW_ptr
46020b57cec5SDimitry Andric #else /* UNICODE  */
46030b57cec5SDimitry Andric #define __itt_mark_global __itt_mark_globalA
46040b57cec5SDimitry Andric #define __itt_mark_global_ptr __itt_mark_globalA_ptr
46050b57cec5SDimitry Andric #endif /* UNICODE */
46060b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46070b57cec5SDimitry Andric int ITTAPI __itt_mark_global(__itt_mark_type mt, const char *parameter);
46080b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46090b57cec5SDimitry Andric 
46100b57cec5SDimitry Andric /** @cond exclude_from_documentation */
46110b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
46120b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
46130b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
46140b57cec5SDimitry Andric ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter))
4615fe6060f1SDimitry Andric ITT_STUB(ITTAPI, int, mark_globalW,
4616fe6060f1SDimitry Andric          (__itt_mark_type mt, const wchar_t *parameter))
46170b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46180b57cec5SDimitry Andric ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter))
46190b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46200b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
46210b57cec5SDimitry Andric #define __itt_mark_globalA ITTNOTIFY_DATA(mark_globalA)
46220b57cec5SDimitry Andric #define __itt_mark_globalA_ptr ITTNOTIFY_NAME(mark_globalA)
46230b57cec5SDimitry Andric #define __itt_mark_globalW ITTNOTIFY_DATA(mark_globalW)
46240b57cec5SDimitry Andric #define __itt_mark_globalW_ptr ITTNOTIFY_NAME(mark_globalW)
46250b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46260b57cec5SDimitry Andric #define __itt_mark_global ITTNOTIFY_DATA(mark_global)
46270b57cec5SDimitry Andric #define __itt_mark_global_ptr ITTNOTIFY_NAME(mark_global)
46280b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46290b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
46300b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
46310b57cec5SDimitry Andric #define __itt_mark_globalA(mt, parameter) (int)0
46320b57cec5SDimitry Andric #define __itt_mark_globalA_ptr 0
46330b57cec5SDimitry Andric #define __itt_mark_globalW(mt, parameter) (int)0
46340b57cec5SDimitry Andric #define __itt_mark_globalW_ptr 0
46350b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46360b57cec5SDimitry Andric #define __itt_mark_global(mt, parameter) (int)0
46370b57cec5SDimitry Andric #define __itt_mark_global_ptr 0
46380b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46390b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
46400b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
46410b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN
46420b57cec5SDimitry Andric #define __itt_mark_globalA_ptr 0
46430b57cec5SDimitry Andric #define __itt_mark_globalW_ptr 0
46440b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46450b57cec5SDimitry Andric #define __itt_mark_global_ptr 0
46460b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
46470b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
46480b57cec5SDimitry Andric /** @endcond */
46490b57cec5SDimitry Andric 
46500b57cec5SDimitry Andric /**
46510b57cec5SDimitry Andric  * @brief Creates an "end" point for "continuous" mark with specified name.
46520b57cec5SDimitry Andric  *
46530b57cec5SDimitry Andric  * - Returns zero value in case of success, non-zero value otherwise.
46540b57cec5SDimitry Andric  *   Also returns non-zero value when preceding "begin" point for the
46550b57cec5SDimitry Andric  *   mark with the same name failed to be created or not created.
46560b57cec5SDimitry Andric  * - The mark of "continuous" type is placed to collection results in
46570b57cec5SDimitry Andric  *   case of success. It appears in overtime view(s) as a special tick
46580b57cec5SDimitry Andric  *   sign (different from "discrete" mark) together with line from
46590b57cec5SDimitry Andric  *   corresponding "begin" mark to "end" mark.
46600b57cec5SDimitry Andric  * @note Continuous marks can overlap and be nested inside each other.
46610b57cec5SDimitry Andric  * Discrete mark can be nested inside marked region
46620b57cec5SDimitry Andric  * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
46630b57cec5SDimitry Andric  * @return Returns zero value in case of success, non-zero value otherwise.
46640b57cec5SDimitry Andric  */
46650b57cec5SDimitry Andric int ITTAPI __itt_mark_off(__itt_mark_type mt);
46660b57cec5SDimitry Andric 
46670b57cec5SDimitry Andric /** @cond exclude_from_documentation */
46680b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
46690b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
46700b57cec5SDimitry Andric ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt))
46710b57cec5SDimitry Andric #define __itt_mark_off ITTNOTIFY_DATA(mark_off)
46720b57cec5SDimitry Andric #define __itt_mark_off_ptr ITTNOTIFY_NAME(mark_off)
46730b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
46740b57cec5SDimitry Andric #define __itt_mark_off(mt) (int)0
46750b57cec5SDimitry Andric #define __itt_mark_off_ptr 0
46760b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
46770b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
46780b57cec5SDimitry Andric #define __itt_mark_off_ptr 0
46790b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
46800b57cec5SDimitry Andric /** @endcond */
46810b57cec5SDimitry Andric 
46820b57cec5SDimitry Andric /**
46830b57cec5SDimitry Andric  * @brief Use this if necessary to create an "end" point for mark of process
46840b57cec5SDimitry Andric  * @see int __itt_mark_off(__itt_mark_type mt);
46850b57cec5SDimitry Andric  */
46860b57cec5SDimitry Andric int ITTAPI __itt_mark_global_off(__itt_mark_type mt);
46870b57cec5SDimitry Andric 
46880b57cec5SDimitry Andric /** @cond exclude_from_documentation */
46890b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
46900b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
46910b57cec5SDimitry Andric ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt))
46920b57cec5SDimitry Andric #define __itt_mark_global_off ITTNOTIFY_DATA(mark_global_off)
46930b57cec5SDimitry Andric #define __itt_mark_global_off_ptr ITTNOTIFY_NAME(mark_global_off)
46940b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
46950b57cec5SDimitry Andric #define __itt_mark_global_off(mt) (int)0
46960b57cec5SDimitry Andric #define __itt_mark_global_off_ptr 0
46970b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
46980b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
46990b57cec5SDimitry Andric #define __itt_mark_global_off_ptr 0
47000b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
47010b57cec5SDimitry Andric /** @endcond */
47020b57cec5SDimitry Andric /** @} marks group */
47030b57cec5SDimitry Andric 
47040b57cec5SDimitry Andric /**
47050b57cec5SDimitry Andric  * @defgroup counters_internal Counters
47060b57cec5SDimitry Andric  * @ingroup internal
47070b57cec5SDimitry Andric  * Counters group
47080b57cec5SDimitry Andric  * @{
47090b57cec5SDimitry Andric  */
47100b57cec5SDimitry Andric 
47110b57cec5SDimitry Andric /**
47120b57cec5SDimitry Andric  * @defgroup stitch Stack Stitching
47130b57cec5SDimitry Andric  * @ingroup internal
47140b57cec5SDimitry Andric  * Stack Stitching group
47150b57cec5SDimitry Andric  * @{
47160b57cec5SDimitry Andric  */
47170b57cec5SDimitry Andric /**
47180b57cec5SDimitry Andric  * @brief opaque structure for counter identification
47190b57cec5SDimitry Andric  */
47200b57cec5SDimitry Andric typedef struct ___itt_caller *__itt_caller;
47210b57cec5SDimitry Andric 
47220b57cec5SDimitry Andric /**
4723fe6060f1SDimitry Andric  * @brief Create the stitch point e.g. a point in call stack where other stacks
4724fe6060f1SDimitry Andric  * should be stitched to. The function returns a unique identifier which is used
4725fe6060f1SDimitry Andric  * to match the cut points with corresponding stitch points.
47260b57cec5SDimitry Andric  */
47270b57cec5SDimitry Andric __itt_caller ITTAPI __itt_stack_caller_create(void);
47280b57cec5SDimitry Andric 
47290b57cec5SDimitry Andric /** @cond exclude_from_documentation */
47300b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
47310b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
47320b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
47330b57cec5SDimitry Andric #define __itt_stack_caller_create ITTNOTIFY_DATA(stack_caller_create)
47340b57cec5SDimitry Andric #define __itt_stack_caller_create_ptr ITTNOTIFY_NAME(stack_caller_create)
47350b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
47360b57cec5SDimitry Andric #define __itt_stack_caller_create() (__itt_caller)0
47370b57cec5SDimitry Andric #define __itt_stack_caller_create_ptr 0
47380b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
47390b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
47400b57cec5SDimitry Andric #define __itt_stack_caller_create_ptr 0
47410b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
47420b57cec5SDimitry Andric /** @endcond */
47430b57cec5SDimitry Andric 
47440b57cec5SDimitry Andric /**
4745fe6060f1SDimitry Andric  * @brief Destroy the information about stitch point identified by the pointer
4746fe6060f1SDimitry Andric  * previously returned by __itt_stack_caller_create()
47470b57cec5SDimitry Andric  */
47480b57cec5SDimitry Andric void ITTAPI __itt_stack_caller_destroy(__itt_caller id);
47490b57cec5SDimitry Andric 
47500b57cec5SDimitry Andric /** @cond exclude_from_documentation */
47510b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
47520b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
47530b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id))
47540b57cec5SDimitry Andric #define __itt_stack_caller_destroy ITTNOTIFY_VOID(stack_caller_destroy)
47550b57cec5SDimitry Andric #define __itt_stack_caller_destroy_ptr ITTNOTIFY_NAME(stack_caller_destroy)
47560b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
47570b57cec5SDimitry Andric #define __itt_stack_caller_destroy(id)
47580b57cec5SDimitry Andric #define __itt_stack_caller_destroy_ptr 0
47590b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
47600b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
47610b57cec5SDimitry Andric #define __itt_stack_caller_destroy_ptr 0
47620b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
47630b57cec5SDimitry Andric /** @endcond */
47640b57cec5SDimitry Andric 
47650b57cec5SDimitry Andric /**
4766fe6060f1SDimitry Andric  * @brief Sets the cut point. Stack from each event which occurs after this call
4767fe6060f1SDimitry Andric  * will be cut at the same stack level the function was called and stitched to
4768fe6060f1SDimitry Andric  * the corresponding stitch point.
47690b57cec5SDimitry Andric  */
47700b57cec5SDimitry Andric void ITTAPI __itt_stack_callee_enter(__itt_caller id);
47710b57cec5SDimitry Andric 
47720b57cec5SDimitry Andric /** @cond exclude_from_documentation */
47730b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
47740b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
47750b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id))
47760b57cec5SDimitry Andric #define __itt_stack_callee_enter ITTNOTIFY_VOID(stack_callee_enter)
47770b57cec5SDimitry Andric #define __itt_stack_callee_enter_ptr ITTNOTIFY_NAME(stack_callee_enter)
47780b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
47790b57cec5SDimitry Andric #define __itt_stack_callee_enter(id)
47800b57cec5SDimitry Andric #define __itt_stack_callee_enter_ptr 0
47810b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
47820b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
47830b57cec5SDimitry Andric #define __itt_stack_callee_enter_ptr 0
47840b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
47850b57cec5SDimitry Andric /** @endcond */
47860b57cec5SDimitry Andric 
47870b57cec5SDimitry Andric /**
4788fe6060f1SDimitry Andric  * @brief This function eliminates the cut point which was set by latest
4789fe6060f1SDimitry Andric  * __itt_stack_callee_enter().
47900b57cec5SDimitry Andric  */
47910b57cec5SDimitry Andric void ITTAPI __itt_stack_callee_leave(__itt_caller id);
47920b57cec5SDimitry Andric 
47930b57cec5SDimitry Andric /** @cond exclude_from_documentation */
47940b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
47950b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
47960b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id))
47970b57cec5SDimitry Andric #define __itt_stack_callee_leave ITTNOTIFY_VOID(stack_callee_leave)
47980b57cec5SDimitry Andric #define __itt_stack_callee_leave_ptr ITTNOTIFY_NAME(stack_callee_leave)
47990b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
48000b57cec5SDimitry Andric #define __itt_stack_callee_leave(id)
48010b57cec5SDimitry Andric #define __itt_stack_callee_leave_ptr 0
48020b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
48030b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
48040b57cec5SDimitry Andric #define __itt_stack_callee_leave_ptr 0
48050b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
48060b57cec5SDimitry Andric /** @endcond */
48070b57cec5SDimitry Andric 
48080b57cec5SDimitry Andric /** @} stitch group */
48090b57cec5SDimitry Andric 
4810fe6060f1SDimitry Andric /* *****************************************************************************************************************************
4811fe6060f1SDimitry Andric  */
48120b57cec5SDimitry Andric 
48130b57cec5SDimitry Andric #include <stdarg.h>
48140b57cec5SDimitry Andric 
48150b57cec5SDimitry Andric /** @cond exclude_from_documentation */
4816fe6060f1SDimitry Andric typedef enum __itt_error_code {
48170b57cec5SDimitry Andric   __itt_error_success = 0, /*!< no error */
48180b57cec5SDimitry Andric   __itt_error_no_module = 1, /*!< module can't be loaded */
4819fe6060f1SDimitry Andric   /* %1$s -- library name; win: %2$d -- system error code; unx: %2$s -- system
4820fe6060f1SDimitry Andric      error message. */
48210b57cec5SDimitry Andric   __itt_error_no_symbol = 2, /*!< symbol not found */
48220b57cec5SDimitry Andric   /* %1$s -- library name, %2$s -- symbol name. */
48230b57cec5SDimitry Andric   __itt_error_unknown_group = 3, /*!< unknown group specified */
48240b57cec5SDimitry Andric   /* %1$s -- env var name, %2$s -- group name. */
48250b57cec5SDimitry Andric   __itt_error_cant_read_env = 4, /*!< GetEnvironmentVariable() failed */
48260b57cec5SDimitry Andric   /* %1$s -- env var name, %2$d -- system error. */
48270b57cec5SDimitry Andric   __itt_error_env_too_long = 5, /*!< variable value too long */
4828fe6060f1SDimitry Andric   /* %1$s -- env var name, %2$d -- actual length of the var, %3$d -- max allowed
4829fe6060f1SDimitry Andric      length. */
4830fe6060f1SDimitry Andric   __itt_error_system =
4831fe6060f1SDimitry Andric       6 /*!< pthread_mutexattr_init or pthread_mutex_init failed */
48320b57cec5SDimitry Andric   /* %1$s -- function name, %2$d -- errno. */
48330b57cec5SDimitry Andric } __itt_error_code;
48340b57cec5SDimitry Andric 
48350b57cec5SDimitry Andric typedef void(__itt_error_handler_t)(__itt_error_code code, va_list);
48360b57cec5SDimitry Andric __itt_error_handler_t *__itt_set_error_handler(__itt_error_handler_t *);
48370b57cec5SDimitry Andric 
48380b57cec5SDimitry Andric const char *ITTAPI __itt_api_version(void);
48390b57cec5SDimitry Andric /** @endcond */
48400b57cec5SDimitry Andric 
48410b57cec5SDimitry Andric /** @cond exclude_from_documentation */
48420b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY
48430b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API
48440b57cec5SDimitry Andric #define __itt_error_handler ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, error_handler)
48450b57cec5SDimitry Andric void __itt_error_handler(__itt_error_code code, va_list args);
48460b57cec5SDimitry Andric extern const int ITTNOTIFY_NAME(err);
48470b57cec5SDimitry Andric #define __itt_err ITTNOTIFY_NAME(err)
48480b57cec5SDimitry Andric ITT_STUB(ITTAPI, const char *, api_version, (void))
48490b57cec5SDimitry Andric #define __itt_api_version ITTNOTIFY_DATA(api_version)
48500b57cec5SDimitry Andric #define __itt_api_version_ptr ITTNOTIFY_NAME(api_version)
48510b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */
48520b57cec5SDimitry Andric #define __itt_api_version() (const char *)0
48530b57cec5SDimitry Andric #define __itt_api_version_ptr 0
48540b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */
48550b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */
48560b57cec5SDimitry Andric #define __itt_api_version_ptr 0
48570b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */
48580b57cec5SDimitry Andric /** @endcond */
48590b57cec5SDimitry Andric 
48600b57cec5SDimitry Andric #ifdef __cplusplus
48610b57cec5SDimitry Andric }
48620b57cec5SDimitry Andric #endif /* __cplusplus */
48630b57cec5SDimitry Andric 
48640b57cec5SDimitry Andric #endif /* _ITTNOTIFY_PRIVATE_ */
48650b57cec5SDimitry Andric 
48660b57cec5SDimitry Andric #endif /* INTEL_ITTNOTIFY_API_PRIVATE */
4867