1 
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef _ITTNOTIFY_H_
11 #define _ITTNOTIFY_H_
12 
13 /**
14 @file
15 @brief Public User API functions and types
16 @mainpage
17 
18 The Instrumentation and Tracing Technology API (ITT API) is used to
19 annotate a user's program with additional information
20 that can be used by correctness and performance tools. The user inserts
21 calls in their program. Those calls generate information that is collected
22 at runtime, and used by Intel(R) Threading Tools.
23 
24 @section API Concepts
25 The following general concepts are used throughout the API.
26 
27 @subsection Unicode Support
28 Many API functions take character string arguments. On Windows, there
29 are two versions of each such function. The function name is suffixed
30 by W if Unicode support is enabled, and by A otherwise. Any API function
31 that takes a character string argument adheres to this convention.
32 
33 @subsection Conditional Compilation
34 Many users prefer having an option to modify ITT API code when linking it
35 inside their runtimes. ITT API header file provides a mechanism to replace
36 ITT API function names inside your code with empty strings. To do this,
37 define the macros INTEL_NO_ITTNOTIFY_API during compilation and remove the
38 static library from the linker script.
39 
40 @subsection Domains
41 [see domains]
42 Domains provide a way to separate notification for different modules or
43 libraries in a program. Domains are specified by dotted character strings,
44 e.g. TBB.Internal.Control.
45 
46 A mechanism (to be specified) is provided to enable and disable
47 domains. By default, all domains are enabled.
48 @subsection Named Entities and Instances
49 Named entities (frames, regions, tasks, and markers) communicate
50 information about the program to the analysis tools. A named entity often
51 refers to a section of program code, or to some set of logical concepts
52 that the programmer wants to group together.
53 
54 Named entities relate to the programmer's static view of the program. When
55 the program actually executes, many instances of a given named entity
56 may be created.
57 
58 The API annotations denote instances of named entities. The actual
59 named entities are displayed using the analysis tools. In other words,
60 the named entities come into existence when instances are created.
61 
62 Instances of named entities may have instance identifiers (IDs). Some
63 API calls use instance identifiers to create relationships between
64 different instances of named entities. Other API calls associate data
65 with instances of named entities.
66 
67 Some named entities must always have instance IDs. In particular, regions
68 and frames always have IDs. Task and markers need IDs only if the ID is
69 needed in another API call (such as adding a relation or metadata).
70 
71 The lifetime of instance IDs is distinct from the lifetime of
72 instances. This allows various relationships to be specified separate
73 from the actual execution of instances. This flexibility comes at the
74 expense of extra API calls.
75 
76 The same ID may not be reused for different instances, unless a previous
77 [ref] __itt_id_destroy call for that ID has been issued.
78 */
79 
80 /** @cond exclude_from_documentation */
81 #ifndef ITT_OS_WIN
82 #define ITT_OS_WIN 1
83 #endif /* ITT_OS_WIN */
84 
85 #ifndef ITT_OS_LINUX
86 #define ITT_OS_LINUX 2
87 #endif /* ITT_OS_LINUX */
88 
89 #ifndef ITT_OS_MAC
90 #define ITT_OS_MAC 3
91 #endif /* ITT_OS_MAC */
92 
93 #ifndef ITT_OS_FREEBSD
94 #define ITT_OS_FREEBSD 4
95 #endif /* ITT_OS_FREEBSD */
96 
97 #ifndef ITT_OS
98 #if defined WIN32 || defined _WIN32
99 #define ITT_OS ITT_OS_WIN
100 #elif defined(__APPLE__) && defined(__MACH__)
101 #define ITT_OS ITT_OS_MAC
102 #elif defined(__FreeBSD__)
103 #define ITT_OS ITT_OS_FREEBSD
104 #else
105 #define ITT_OS ITT_OS_LINUX
106 #endif
107 #endif /* ITT_OS */
108 
109 #ifndef ITT_PLATFORM_WIN
110 #define ITT_PLATFORM_WIN 1
111 #endif /* ITT_PLATFORM_WIN */
112 
113 #ifndef ITT_PLATFORM_POSIX
114 #define ITT_PLATFORM_POSIX 2
115 #endif /* ITT_PLATFORM_POSIX */
116 
117 #ifndef ITT_PLATFORM_MAC
118 #define ITT_PLATFORM_MAC 3
119 #endif /* ITT_PLATFORM_MAC */
120 
121 #ifndef ITT_PLATFORM_FREEBSD
122 #define ITT_PLATFORM_FREEBSD 4
123 #endif /* ITT_PLATFORM_FREEBSD */
124 
125 #ifndef ITT_PLATFORM
126 #if ITT_OS == ITT_OS_WIN
127 #define ITT_PLATFORM ITT_PLATFORM_WIN
128 #elif ITT_OS == ITT_OS_MAC
129 #define ITT_PLATFORM ITT_PLATFORM_MAC
130 #elif ITT_OS == ITT_OS_FREEBSD
131 #define ITT_PLATFORM ITT_PLATFORM_FREEBSD
132 #else
133 #define ITT_PLATFORM ITT_PLATFORM_POSIX
134 #endif
135 #endif /* ITT_PLATFORM */
136 
137 #if defined(_UNICODE) && !defined(UNICODE)
138 #define UNICODE
139 #endif
140 
141 #include <stddef.h>
142 #if ITT_PLATFORM == ITT_PLATFORM_WIN
143 #include <tchar.h>
144 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
145 #include <stdint.h>
146 #if defined(UNICODE) || defined(_UNICODE)
147 #include <wchar.h>
148 #endif /* UNICODE || _UNICODE */
149 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
150 
151 #ifndef ITTAPI_CDECL
152 #if ITT_PLATFORM == ITT_PLATFORM_WIN
153 #define ITTAPI_CDECL __cdecl
154 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
155 #if defined _M_IX86 || defined __i386__
156 #define ITTAPI_CDECL __attribute__((cdecl))
157 #else /* _M_IX86 || __i386__ */
158 #define ITTAPI_CDECL /* actual only on x86 platform */
159 #endif /* _M_IX86 || __i386__ */
160 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
161 #endif /* ITTAPI_CDECL */
162 
163 #ifndef STDCALL
164 #if ITT_PLATFORM == ITT_PLATFORM_WIN
165 #define STDCALL __stdcall
166 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
167 #if defined _M_IX86 || defined __i386__
168 #define STDCALL __attribute__((stdcall))
169 #else /* _M_IX86 || __i386__ */
170 #define STDCALL /* supported only on x86 platform */
171 #endif /* _M_IX86 || __i386__ */
172 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
173 #endif /* STDCALL */
174 
175 #define ITTAPI ITTAPI_CDECL
176 #define LIBITTAPI ITTAPI_CDECL
177 
178 /* TODO: Temporary for compatibility! */
179 #define ITTAPI_CALL ITTAPI_CDECL
180 #define LIBITTAPI_CALL ITTAPI_CDECL
181 
182 #if ITT_PLATFORM == ITT_PLATFORM_WIN
183 /* use __forceinline (VC++ specific) */
184 #if defined(__MINGW32__) && !defined(__cplusplus)
185 #define ITT_INLINE                                                             \
186   static __inline__ __attribute__((__always_inline__, __gnu_inline__))
187 #else
188 #define ITT_INLINE static __forceinline
189 #endif /* __MINGW32__ */
190 
191 #define ITT_INLINE_ATTRIBUTE /* nothing */
192 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
193 /*
194  * Generally, functions are not inlined unless optimization is specified.
195  * For functions declared inline, this attribute inlines the function even
196  * if no optimization level was specified.
197  */
198 #ifdef __STRICT_ANSI__
199 #define ITT_INLINE static
200 #define ITT_INLINE_ATTRIBUTE __attribute__((unused))
201 #else /* __STRICT_ANSI__ */
202 #define ITT_INLINE static inline
203 #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
204 #endif /* __STRICT_ANSI__ */
205 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
206 /** @endcond */
207 
208 #ifdef INTEL_ITTNOTIFY_ENABLE_LEGACY
209 #if ITT_PLATFORM == ITT_PLATFORM_WIN
210 #pragma message(                                                               \
211     "WARNING!!! Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro")
212 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
213 #warning                                                                       \
214     "Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro"
215 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
216 #include "legacy/ittnotify.h"
217 #endif /* INTEL_ITTNOTIFY_ENABLE_LEGACY */
218 
219 /** @cond exclude_from_documentation */
220 /* Helper macro for joining tokens */
221 #define ITT_JOIN_AUX(p, n) p##n
222 #define ITT_JOIN(p, n) ITT_JOIN_AUX(p, n)
223 
224 #ifdef ITT_MAJOR
225 #undef ITT_MAJOR
226 #endif
227 #ifdef ITT_MINOR
228 #undef ITT_MINOR
229 #endif
230 #define ITT_MAJOR 3
231 #define ITT_MINOR 0
232 
233 /* Standard versioning of a token with major and minor version numbers */
234 #define ITT_VERSIONIZE(x)                                                      \
235   ITT_JOIN(x, ITT_JOIN(_, ITT_JOIN(ITT_MAJOR, ITT_JOIN(_, ITT_MINOR))))
236 
237 #ifndef INTEL_ITTNOTIFY_PREFIX
238 #define INTEL_ITTNOTIFY_PREFIX __itt_
239 #endif /* INTEL_ITTNOTIFY_PREFIX */
240 #ifndef INTEL_ITTNOTIFY_POSTFIX
241 #define INTEL_ITTNOTIFY_POSTFIX _ptr_
242 #endif /* INTEL_ITTNOTIFY_POSTFIX */
243 
244 #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, n)
245 #define ITTNOTIFY_NAME(n)                                                      \
246   ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n, INTEL_ITTNOTIFY_POSTFIX)))
247 
248 #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
249 #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
250 
251 #define ITTNOTIFY_VOID_D0(n, d)                                                \
252   (!(d)->flags)          ? (void)0                                             \
253   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
254                          : ITTNOTIFY_NAME(n)(d)
255 #define ITTNOTIFY_VOID_D1(n, d, x)                                             \
256   (!(d)->flags)          ? (void)0                                             \
257   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
258                          : ITTNOTIFY_NAME(n)(d, x)
259 #define ITTNOTIFY_VOID_D2(n, d, x, y)                                          \
260   (!(d)->flags)          ? (void)0                                             \
261   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
262                          : ITTNOTIFY_NAME(n)(d, x, y)
263 #define ITTNOTIFY_VOID_D3(n, d, x, y, z)                                       \
264   (!(d)->flags)          ? (void)0                                             \
265   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
266                          : ITTNOTIFY_NAME(n)(d, x, y, z)
267 #define ITTNOTIFY_VOID_D4(n, d, x, y, z, a)                                    \
268   (!(d)->flags)          ? (void)0                                             \
269   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
270                          : ITTNOTIFY_NAME(n)(d, x, y, z, a)
271 #define ITTNOTIFY_VOID_D5(n, d, x, y, z, a, b)                                 \
272   (!(d)->flags)          ? (void)0                                             \
273   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
274                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b)
275 #define ITTNOTIFY_VOID_D6(n, d, x, y, z, a, b, c)                              \
276   (!(d)->flags)          ? (void)0                                             \
277   : (!ITTNOTIFY_NAME(n)) ? (void)0                                             \
278                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c)
279 #define ITTNOTIFY_DATA_D0(n, d)                                                \
280   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
281 #define ITTNOTIFY_DATA_D1(n, d, x)                                             \
282   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x)
283 #define ITTNOTIFY_DATA_D2(n, d, x, y)                                          \
284   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y)
285 #define ITTNOTIFY_DATA_D3(n, d, x, y, z)                                       \
286   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y, z)
287 #define ITTNOTIFY_DATA_D4(n, d, x, y, z, a)                                    \
288   (!(d)->flags)          ? 0                                                   \
289   : (!ITTNOTIFY_NAME(n)) ? 0                                                   \
290                          : ITTNOTIFY_NAME(n)(d, x, y, z, a)
291 #define ITTNOTIFY_DATA_D5(n, d, x, y, z, a, b)                                 \
292   (!(d)->flags)          ? 0                                                   \
293   : (!ITTNOTIFY_NAME(n)) ? 0                                                   \
294                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b)
295 #define ITTNOTIFY_DATA_D6(n, d, x, y, z, a, b, c)                              \
296   (!(d)->flags)          ? 0                                                   \
297   : (!ITTNOTIFY_NAME(n)) ? 0                                                   \
298                          : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c)
299 
300 #ifdef ITT_STUB
301 #undef ITT_STUB
302 #endif
303 #ifdef ITT_STUBV
304 #undef ITT_STUBV
305 #endif
306 #define ITT_STUBV(api, type, name, args)                                       \
307   typedef type(api *ITT_JOIN(ITTNOTIFY_NAME(name), _t)) args;                  \
308   extern ITT_JOIN(ITTNOTIFY_NAME(name), _t) ITTNOTIFY_NAME(name);
309 #define ITT_STUB ITT_STUBV
310 /** @endcond */
311 
312 #ifdef __cplusplus
313 extern "C" {
314 #endif /* __cplusplus */
315 
316 /** @cond exclude_from_gpa_documentation */
317 /**
318  * @defgroup public Public API
319  * @{
320  * @}
321  */
322 
323 /**
324  * @defgroup control Collection Control
325  * @ingroup public
326  * General behavior: application continues to run, but no profiling information
327  * is being collected
328  *
329  * Pausing occurs not only for the current thread but for all process as well as
330  * spawned processes
331  * - Intel(R) Parallel Inspector and Intel(R) Inspector XE:
332  *   - Does not analyze or report errors that involve memory access.
333  *   - Other errors are reported as usual. Pausing data collection in
334  *     Intel(R) Parallel Inspector and Intel(R) Inspector XE
335  *     only pauses tracing and analyzing memory access.
336  *     It does not pause tracing or analyzing threading APIs.
337  *   .
338  * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
339  *   - Does continue to record when new threads are started.
340  *   .
341  * - Other effects:
342  *   - Possible reduction of runtime overhead.
343  *   .
344  * @{
345  */
346 /** @brief Pause collection */
347 void ITTAPI __itt_pause(void);
348 /** @brief Resume collection */
349 void ITTAPI __itt_resume(void);
350 /** @brief Detach collection */
351 void ITTAPI __itt_detach(void);
352 
353 /** @cond exclude_from_documentation */
354 #ifndef INTEL_NO_MACRO_BODY
355 #ifndef INTEL_NO_ITTNOTIFY_API
356 ITT_STUBV(ITTAPI, void, pause, (void))
357 ITT_STUBV(ITTAPI, void, resume, (void))
358 ITT_STUBV(ITTAPI, void, detach, (void))
359 #define __itt_pause ITTNOTIFY_VOID(pause)
360 #define __itt_pause_ptr ITTNOTIFY_NAME(pause)
361 #define __itt_resume ITTNOTIFY_VOID(resume)
362 #define __itt_resume_ptr ITTNOTIFY_NAME(resume)
363 #define __itt_detach ITTNOTIFY_VOID(detach)
364 #define __itt_detach_ptr ITTNOTIFY_NAME(detach)
365 #else /* INTEL_NO_ITTNOTIFY_API */
366 #define __itt_pause()
367 #define __itt_pause_ptr 0
368 #define __itt_resume()
369 #define __itt_resume_ptr 0
370 #define __itt_detach()
371 #define __itt_detach_ptr 0
372 #endif /* INTEL_NO_ITTNOTIFY_API */
373 #else /* INTEL_NO_MACRO_BODY */
374 #define __itt_pause_ptr 0
375 #define __itt_resume_ptr 0
376 #define __itt_detach_ptr 0
377 #endif /* INTEL_NO_MACRO_BODY */
378 /** @endcond */
379 /** @} control group */
380 /** @endcond */
381 
382 /**
383  * @defgroup Intel Processor Trace control
384  * API from this group provides control over collection and analysis of Intel
385  * Processor Trace (Intel PT) data Information about Intel Processor Trace
386  * technology can be found here (Volume 3 chapter 35):
387  * https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf
388  * Use this API to mark particular code regions for loading detailed performance
389  * statistics. This mode makes your analysis faster and more accurate.
390  * @{
391  */
392 typedef unsigned char __itt_pt_region;
393 
394 /**
395  * @brief function saves a region name marked with Intel PT API and returns a
396  * region id. Only 7 names can be registered. Attempts to register more names
397  * will be ignored and a region id with auto names will be returned. For
398  * automatic naming of regions pass NULL as function parameter
399  */
400 #if ITT_PLATFORM == ITT_PLATFORM_WIN
401 __itt_pt_region ITTAPI __itt_pt_region_createA(const char *name);
402 __itt_pt_region ITTAPI __itt_pt_region_createW(const wchar_t *name);
403 #if defined(UNICODE) || defined(_UNICODE)
404 #define __itt_pt_region_create __itt_pt_region_createW
405 #else /* UNICODE */
406 #define __itt_pt_region_create __itt_pt_region_createA
407 #endif /* UNICODE */
408 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
409 __itt_pt_region ITTAPI __itt_pt_region_create(const char *name);
410 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
411 
412 /** @cond exclude_from_documentation */
413 #ifndef INTEL_NO_MACRO_BODY
414 #ifndef INTEL_NO_ITTNOTIFY_API
415 #if ITT_PLATFORM == ITT_PLATFORM_WIN
416 ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name))
417 ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name))
418 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
419 ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name))
420 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
421 #if ITT_PLATFORM == ITT_PLATFORM_WIN
422 #define __itt_pt_region_createA ITTNOTIFY_DATA(pt_region_createA)
423 #define __itt_pt_region_createA_ptr ITTNOTIFY_NAME(pt_region_createA)
424 #define __itt_pt_region_createW ITTNOTIFY_DATA(pt_region_createW)
425 #define __itt_pt_region_createW_ptr ITTNOTIFY_NAME(pt_region_createW)
426 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
427 #define __itt_pt_region_create ITTNOTIFY_DATA(pt_region_create)
428 #define __itt_pt_region_create_ptr ITTNOTIFY_NAME(pt_region_create)
429 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
430 #else /* INTEL_NO_ITTNOTIFY_API */
431 #if ITT_PLATFORM == ITT_PLATFORM_WIN
432 #define __itt_pt_region_createA(name) (__itt_pt_region)0
433 #define __itt_pt_region_createA_ptr 0
434 #define __itt_pt_region_createW(name) (__itt_pt_region)0
435 #define __itt_pt_region_createW_ptr 0
436 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
437 #define __itt_pt_region_create(name) (__itt_pt_region)0
438 #define __itt_pt_region_create_ptr 0
439 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
440 #endif /* INTEL_NO_ITTNOTIFY_API */
441 #else /* INTEL_NO_MACRO_BODY */
442 #if ITT_PLATFORM == ITT_PLATFORM_WIN
443 #define __itt_pt_region_createA_ptr 0
444 #define __itt_pt_region_createW_ptr 0
445 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
446 #define __itt_pt_region_create_ptr 0
447 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
448 #endif /* INTEL_NO_MACRO_BODY */
449 /** @endcond */
450 
451 /**
452  * @brief function contains a special code pattern identified on the
453  * post-processing stage and marks the beginning of a code region targeted for
454  * Intel PT analysis
455  * @param[in] region - region id, 0 <= region < 8
456  */
457 void __itt_mark_pt_region_begin(__itt_pt_region region);
458 /**
459  * @brief function contains a special code pattern identified on the
460  * post-processing stage and marks the end of a code region targeted for Intel
461  * PT analysis
462  * @param[in] region - region id, 0 <= region < 8
463  */
464 void __itt_mark_pt_region_end(__itt_pt_region region);
465 /** @} Intel PT control group*/
466 
467 /**
468  * @defgroup threads Threads
469  * @ingroup public
470  * Give names to threads
471  * @{
472  */
473 /**
474  * @brief Sets thread name of calling thread
475  * @param[in] name - name of thread
476  */
477 #if ITT_PLATFORM == ITT_PLATFORM_WIN
478 void ITTAPI __itt_thread_set_nameA(const char *name);
479 void ITTAPI __itt_thread_set_nameW(const wchar_t *name);
480 #if defined(UNICODE) || defined(_UNICODE)
481 #define __itt_thread_set_name __itt_thread_set_nameW
482 #define __itt_thread_set_name_ptr __itt_thread_set_nameW_ptr
483 #else /* UNICODE */
484 #define __itt_thread_set_name __itt_thread_set_nameA
485 #define __itt_thread_set_name_ptr __itt_thread_set_nameA_ptr
486 #endif /* UNICODE */
487 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
488 void ITTAPI __itt_thread_set_name(const char *name);
489 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
490 
491 /** @cond exclude_from_documentation */
492 #ifndef INTEL_NO_MACRO_BODY
493 #ifndef INTEL_NO_ITTNOTIFY_API
494 #if ITT_PLATFORM == ITT_PLATFORM_WIN
495 ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name))
496 ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name))
497 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
498 ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name))
499 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
500 #if ITT_PLATFORM == ITT_PLATFORM_WIN
501 #define __itt_thread_set_nameA ITTNOTIFY_VOID(thread_set_nameA)
502 #define __itt_thread_set_nameA_ptr ITTNOTIFY_NAME(thread_set_nameA)
503 #define __itt_thread_set_nameW ITTNOTIFY_VOID(thread_set_nameW)
504 #define __itt_thread_set_nameW_ptr ITTNOTIFY_NAME(thread_set_nameW)
505 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
506 #define __itt_thread_set_name ITTNOTIFY_VOID(thread_set_name)
507 #define __itt_thread_set_name_ptr ITTNOTIFY_NAME(thread_set_name)
508 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
509 #else /* INTEL_NO_ITTNOTIFY_API */
510 #if ITT_PLATFORM == ITT_PLATFORM_WIN
511 #define __itt_thread_set_nameA(name)
512 #define __itt_thread_set_nameA_ptr 0
513 #define __itt_thread_set_nameW(name)
514 #define __itt_thread_set_nameW_ptr 0
515 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
516 #define __itt_thread_set_name(name)
517 #define __itt_thread_set_name_ptr 0
518 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
519 #endif /* INTEL_NO_ITTNOTIFY_API */
520 #else /* INTEL_NO_MACRO_BODY */
521 #if ITT_PLATFORM == ITT_PLATFORM_WIN
522 #define __itt_thread_set_nameA_ptr 0
523 #define __itt_thread_set_nameW_ptr 0
524 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
525 #define __itt_thread_set_name_ptr 0
526 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
527 #endif /* INTEL_NO_MACRO_BODY */
528 /** @endcond */
529 
530 /** @cond exclude_from_gpa_documentation */
531 
532 /**
533  * @brief Mark current thread as ignored from this point on, for the duration of
534  * its existence.
535  */
536 void ITTAPI __itt_thread_ignore(void);
537 
538 /** @cond exclude_from_documentation */
539 #ifndef INTEL_NO_MACRO_BODY
540 #ifndef INTEL_NO_ITTNOTIFY_API
541 ITT_STUBV(ITTAPI, void, thread_ignore, (void))
542 #define __itt_thread_ignore ITTNOTIFY_VOID(thread_ignore)
543 #define __itt_thread_ignore_ptr ITTNOTIFY_NAME(thread_ignore)
544 #else /* INTEL_NO_ITTNOTIFY_API */
545 #define __itt_thread_ignore()
546 #define __itt_thread_ignore_ptr 0
547 #endif /* INTEL_NO_ITTNOTIFY_API */
548 #else /* INTEL_NO_MACRO_BODY */
549 #define __itt_thread_ignore_ptr 0
550 #endif /* INTEL_NO_MACRO_BODY */
551 /** @endcond */
552 /** @} threads group */
553 
554 /**
555  * @defgroup suppress Error suppression
556  * @ingroup public
557  * General behavior: application continues to run, but errors are suppressed
558  *
559  * @{
560  */
561 
562 /*********************************************************************
563  * @name group of functions used for error suppression in correctness tools
564  *********************************************************************/
565 /** @{ */
566 /**
567  * @hideinitializer
568  * @brief possible value for suppression mask
569  */
570 #define __itt_suppress_all_errors 0x7fffffff
571 
572 /**
573  * @hideinitializer
574  * @brief possible value for suppression mask (suppresses errors from threading
575  * analysis)
576  */
577 #define __itt_suppress_threading_errors 0x000000ff
578 
579 /**
580  * @hideinitializer
581  * @brief possible value for suppression mask (suppresses errors from memory
582  * analysis)
583  */
584 #define __itt_suppress_memory_errors 0x0000ff00
585 
586 /**
587  * @brief Start suppressing errors identified in mask on this thread
588  */
589 void ITTAPI __itt_suppress_push(unsigned int mask);
590 
591 /** @cond exclude_from_documentation */
592 #ifndef INTEL_NO_MACRO_BODY
593 #ifndef INTEL_NO_ITTNOTIFY_API
594 ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask))
595 #define __itt_suppress_push ITTNOTIFY_VOID(suppress_push)
596 #define __itt_suppress_push_ptr ITTNOTIFY_NAME(suppress_push)
597 #else /* INTEL_NO_ITTNOTIFY_API */
598 #define __itt_suppress_push(mask)
599 #define __itt_suppress_push_ptr 0
600 #endif /* INTEL_NO_ITTNOTIFY_API */
601 #else /* INTEL_NO_MACRO_BODY */
602 #define __itt_suppress_push_ptr 0
603 #endif /* INTEL_NO_MACRO_BODY */
604 /** @endcond */
605 
606 /**
607  * @brief Undo the effects of the matching call to __itt_suppress_push
608  */
609 void ITTAPI __itt_suppress_pop(void);
610 
611 /** @cond exclude_from_documentation */
612 #ifndef INTEL_NO_MACRO_BODY
613 #ifndef INTEL_NO_ITTNOTIFY_API
614 ITT_STUBV(ITTAPI, void, suppress_pop, (void))
615 #define __itt_suppress_pop ITTNOTIFY_VOID(suppress_pop)
616 #define __itt_suppress_pop_ptr ITTNOTIFY_NAME(suppress_pop)
617 #else /* INTEL_NO_ITTNOTIFY_API */
618 #define __itt_suppress_pop()
619 #define __itt_suppress_pop_ptr 0
620 #endif /* INTEL_NO_ITTNOTIFY_API */
621 #else /* INTEL_NO_MACRO_BODY */
622 #define __itt_suppress_pop_ptr 0
623 #endif /* INTEL_NO_MACRO_BODY */
624 /** @endcond */
625 
626 /**
627  * @enum __itt_model_disable
628  * @brief Enumerator for the disable methods
629  */
630 typedef enum __itt_suppress_mode {
631   __itt_unsuppress_range,
632   __itt_suppress_range
633 } __itt_suppress_mode_t;
634 
635 /**
636  * @brief Mark a range of memory for error suppression or unsuppression for
637  * error types included in mask
638  */
639 void ITTAPI __itt_suppress_mark_range(__itt_suppress_mode_t mode,
640                                       unsigned int mask, void *address,
641                                       size_t size);
642 
643 /** @cond exclude_from_documentation */
644 #ifndef INTEL_NO_MACRO_BODY
645 #ifndef INTEL_NO_ITTNOTIFY_API
646 ITT_STUBV(ITTAPI, void, suppress_mark_range,
647           (__itt_suppress_mode_t mode, unsigned int mask, void *address,
648            size_t size))
649 #define __itt_suppress_mark_range ITTNOTIFY_VOID(suppress_mark_range)
650 #define __itt_suppress_mark_range_ptr ITTNOTIFY_NAME(suppress_mark_range)
651 #else /* INTEL_NO_ITTNOTIFY_API */
652 #define __itt_suppress_mark_range(mask)
653 #define __itt_suppress_mark_range_ptr 0
654 #endif /* INTEL_NO_ITTNOTIFY_API */
655 #else /* INTEL_NO_MACRO_BODY */
656 #define __itt_suppress_mark_range_ptr 0
657 #endif /* INTEL_NO_MACRO_BODY */
658 /** @endcond */
659 
660 /**
661  * @brief Undo the effect of a matching call to __itt_suppress_mark_range.   If
662  * not matching call is found, nothing is changed.
663  */
664 void ITTAPI __itt_suppress_clear_range(__itt_suppress_mode_t mode,
665                                        unsigned int mask, void *address,
666                                        size_t size);
667 
668 /** @cond exclude_from_documentation */
669 #ifndef INTEL_NO_MACRO_BODY
670 #ifndef INTEL_NO_ITTNOTIFY_API
671 ITT_STUBV(ITTAPI, void, suppress_clear_range,
672           (__itt_suppress_mode_t mode, unsigned int mask, void *address,
673            size_t size))
674 #define __itt_suppress_clear_range ITTNOTIFY_VOID(suppress_clear_range)
675 #define __itt_suppress_clear_range_ptr ITTNOTIFY_NAME(suppress_clear_range)
676 #else /* INTEL_NO_ITTNOTIFY_API */
677 #define __itt_suppress_clear_range(mask)
678 #define __itt_suppress_clear_range_ptr 0
679 #endif /* INTEL_NO_ITTNOTIFY_API */
680 #else /* INTEL_NO_MACRO_BODY */
681 #define __itt_suppress_clear_range_ptr 0
682 #endif /* INTEL_NO_MACRO_BODY */
683 /** @endcond */
684 /** @} */
685 /** @} suppress group */
686 
687 /**
688  * @defgroup sync Synchronization
689  * @ingroup public
690  * Indicate user-written synchronization code
691  * @{
692  */
693 /**
694  * @hideinitializer
695  * @brief possible value of attribute argument for sync object type
696  */
697 #define __itt_attr_barrier 1
698 
699 /**
700  * @hideinitializer
701  * @brief possible value of attribute argument for sync object type
702  */
703 #define __itt_attr_mutex 2
704 
705 /**
706 @brief Name a synchronization object
707 @param[in] addr       Handle for the synchronization object. You should
708 use a real address to uniquely identify the synchronization object.
709 @param[in] objtype    null-terminated object type string. If NULL is
710 passed, the name will be "User Synchronization".
711 @param[in] objname    null-terminated object name string. If NULL,
712 no name will be assigned to the object.
713 @param[in] attribute  one of [#__itt_attr_barrier, #__itt_attr_mutex]
714  */
715 
716 #if ITT_PLATFORM == ITT_PLATFORM_WIN
717 void ITTAPI __itt_sync_createA(void *addr, const char *objtype,
718                                const char *objname, int attribute);
719 void ITTAPI __itt_sync_createW(void *addr, const wchar_t *objtype,
720                                const wchar_t *objname, int attribute);
721 #if defined(UNICODE) || defined(_UNICODE)
722 #define __itt_sync_create __itt_sync_createW
723 #define __itt_sync_create_ptr __itt_sync_createW_ptr
724 #else /* UNICODE */
725 #define __itt_sync_create __itt_sync_createA
726 #define __itt_sync_create_ptr __itt_sync_createA_ptr
727 #endif /* UNICODE */
728 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
729 void ITTAPI __itt_sync_create(void *addr, const char *objtype,
730                               const char *objname, int attribute);
731 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
732 
733 /** @cond exclude_from_documentation */
734 #ifndef INTEL_NO_MACRO_BODY
735 #ifndef INTEL_NO_ITTNOTIFY_API
736 #if ITT_PLATFORM == ITT_PLATFORM_WIN
737 ITT_STUBV(ITTAPI, void, sync_createA,
738           (void *addr, const char *objtype, const char *objname, int attribute))
739 ITT_STUBV(ITTAPI, void, sync_createW,
740           (void *addr, const wchar_t *objtype, const wchar_t *objname,
741            int attribute))
742 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
743 ITT_STUBV(ITTAPI, void, sync_create,
744           (void *addr, const char *objtype, const char *objname, int attribute))
745 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
746 #if ITT_PLATFORM == ITT_PLATFORM_WIN
747 #define __itt_sync_createA ITTNOTIFY_VOID(sync_createA)
748 #define __itt_sync_createA_ptr ITTNOTIFY_NAME(sync_createA)
749 #define __itt_sync_createW ITTNOTIFY_VOID(sync_createW)
750 #define __itt_sync_createW_ptr ITTNOTIFY_NAME(sync_createW)
751 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
752 #define __itt_sync_create ITTNOTIFY_VOID(sync_create)
753 #define __itt_sync_create_ptr ITTNOTIFY_NAME(sync_create)
754 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
755 #else /* INTEL_NO_ITTNOTIFY_API */
756 #if ITT_PLATFORM == ITT_PLATFORM_WIN
757 #define __itt_sync_createA(addr, objtype, objname, attribute)
758 #define __itt_sync_createA_ptr 0
759 #define __itt_sync_createW(addr, objtype, objname, attribute)
760 #define __itt_sync_createW_ptr 0
761 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
762 #define __itt_sync_create(addr, objtype, objname, attribute)
763 #define __itt_sync_create_ptr 0
764 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
765 #endif /* INTEL_NO_ITTNOTIFY_API */
766 #else /* INTEL_NO_MACRO_BODY */
767 #if ITT_PLATFORM == ITT_PLATFORM_WIN
768 #define __itt_sync_createA_ptr 0
769 #define __itt_sync_createW_ptr 0
770 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
771 #define __itt_sync_create_ptr 0
772 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
773 #endif /* INTEL_NO_MACRO_BODY */
774 /** @endcond */
775 
776 /**
777 @brief Rename a synchronization object
778 
779 You can use the rename call to assign or reassign a name to a given
780 synchronization object.
781 @param[in] addr  handle for the synchronization object.
782 @param[in] name  null-terminated object name string.
783 */
784 #if ITT_PLATFORM == ITT_PLATFORM_WIN
785 void ITTAPI __itt_sync_renameA(void *addr, const char *name);
786 void ITTAPI __itt_sync_renameW(void *addr, const wchar_t *name);
787 #if defined(UNICODE) || defined(_UNICODE)
788 #define __itt_sync_rename __itt_sync_renameW
789 #define __itt_sync_rename_ptr __itt_sync_renameW_ptr
790 #else /* UNICODE */
791 #define __itt_sync_rename __itt_sync_renameA
792 #define __itt_sync_rename_ptr __itt_sync_renameA_ptr
793 #endif /* UNICODE */
794 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
795 void ITTAPI __itt_sync_rename(void *addr, const char *name);
796 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
797 
798 /** @cond exclude_from_documentation */
799 #ifndef INTEL_NO_MACRO_BODY
800 #ifndef INTEL_NO_ITTNOTIFY_API
801 #if ITT_PLATFORM == ITT_PLATFORM_WIN
802 ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name))
803 ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name))
804 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
805 ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name))
806 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
807 #if ITT_PLATFORM == ITT_PLATFORM_WIN
808 #define __itt_sync_renameA ITTNOTIFY_VOID(sync_renameA)
809 #define __itt_sync_renameA_ptr ITTNOTIFY_NAME(sync_renameA)
810 #define __itt_sync_renameW ITTNOTIFY_VOID(sync_renameW)
811 #define __itt_sync_renameW_ptr ITTNOTIFY_NAME(sync_renameW)
812 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
813 #define __itt_sync_rename ITTNOTIFY_VOID(sync_rename)
814 #define __itt_sync_rename_ptr ITTNOTIFY_NAME(sync_rename)
815 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
816 #else /* INTEL_NO_ITTNOTIFY_API */
817 #if ITT_PLATFORM == ITT_PLATFORM_WIN
818 #define __itt_sync_renameA(addr, name)
819 #define __itt_sync_renameA_ptr 0
820 #define __itt_sync_renameW(addr, name)
821 #define __itt_sync_renameW_ptr 0
822 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
823 #define __itt_sync_rename(addr, name)
824 #define __itt_sync_rename_ptr 0
825 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
826 #endif /* INTEL_NO_ITTNOTIFY_API */
827 #else /* INTEL_NO_MACRO_BODY */
828 #if ITT_PLATFORM == ITT_PLATFORM_WIN
829 #define __itt_sync_renameA_ptr 0
830 #define __itt_sync_renameW_ptr 0
831 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
832 #define __itt_sync_rename_ptr 0
833 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
834 #endif /* INTEL_NO_MACRO_BODY */
835 /** @endcond */
836 
837 /**
838  @brief Destroy a synchronization object.
839  @param addr Handle for the synchronization object.
840  */
841 void ITTAPI __itt_sync_destroy(void *addr);
842 
843 /** @cond exclude_from_documentation */
844 #ifndef INTEL_NO_MACRO_BODY
845 #ifndef INTEL_NO_ITTNOTIFY_API
846 ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr))
847 #define __itt_sync_destroy ITTNOTIFY_VOID(sync_destroy)
848 #define __itt_sync_destroy_ptr ITTNOTIFY_NAME(sync_destroy)
849 #else /* INTEL_NO_ITTNOTIFY_API */
850 #define __itt_sync_destroy(addr)
851 #define __itt_sync_destroy_ptr 0
852 #endif /* INTEL_NO_ITTNOTIFY_API */
853 #else /* INTEL_NO_MACRO_BODY */
854 #define __itt_sync_destroy_ptr 0
855 #endif /* INTEL_NO_MACRO_BODY */
856 /** @endcond */
857 
858 /*********************************************************************
859  * @name group of functions is used for performance measurement tools
860  *********************************************************************/
861 /** @{ */
862 /**
863  * @brief Enter spin loop on user-defined sync object
864  */
865 void ITTAPI __itt_sync_prepare(void *addr);
866 
867 /** @cond exclude_from_documentation */
868 #ifndef INTEL_NO_MACRO_BODY
869 #ifndef INTEL_NO_ITTNOTIFY_API
870 ITT_STUBV(ITTAPI, void, sync_prepare, (void *addr))
871 #define __itt_sync_prepare ITTNOTIFY_VOID(sync_prepare)
872 #define __itt_sync_prepare_ptr ITTNOTIFY_NAME(sync_prepare)
873 #else /* INTEL_NO_ITTNOTIFY_API */
874 #define __itt_sync_prepare(addr)
875 #define __itt_sync_prepare_ptr 0
876 #endif /* INTEL_NO_ITTNOTIFY_API */
877 #else /* INTEL_NO_MACRO_BODY */
878 #define __itt_sync_prepare_ptr 0
879 #endif /* INTEL_NO_MACRO_BODY */
880 /** @endcond */
881 
882 /**
883  * @brief Quit spin loop without acquiring spin object
884  */
885 void ITTAPI __itt_sync_cancel(void *addr);
886 
887 /** @cond exclude_from_documentation */
888 #ifndef INTEL_NO_MACRO_BODY
889 #ifndef INTEL_NO_ITTNOTIFY_API
890 ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr))
891 #define __itt_sync_cancel ITTNOTIFY_VOID(sync_cancel)
892 #define __itt_sync_cancel_ptr ITTNOTIFY_NAME(sync_cancel)
893 #else /* INTEL_NO_ITTNOTIFY_API */
894 #define __itt_sync_cancel(addr)
895 #define __itt_sync_cancel_ptr 0
896 #endif /* INTEL_NO_ITTNOTIFY_API */
897 #else /* INTEL_NO_MACRO_BODY */
898 #define __itt_sync_cancel_ptr 0
899 #endif /* INTEL_NO_MACRO_BODY */
900 /** @endcond */
901 
902 /**
903  * @brief Successful spin loop completion (sync object acquired)
904  */
905 void ITTAPI __itt_sync_acquired(void *addr);
906 
907 /** @cond exclude_from_documentation */
908 #ifndef INTEL_NO_MACRO_BODY
909 #ifndef INTEL_NO_ITTNOTIFY_API
910 ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr))
911 #define __itt_sync_acquired ITTNOTIFY_VOID(sync_acquired)
912 #define __itt_sync_acquired_ptr ITTNOTIFY_NAME(sync_acquired)
913 #else /* INTEL_NO_ITTNOTIFY_API */
914 #define __itt_sync_acquired(addr)
915 #define __itt_sync_acquired_ptr 0
916 #endif /* INTEL_NO_ITTNOTIFY_API */
917 #else /* INTEL_NO_MACRO_BODY */
918 #define __itt_sync_acquired_ptr 0
919 #endif /* INTEL_NO_MACRO_BODY */
920 /** @endcond */
921 
922 /**
923  * @brief Start sync object releasing code. Is called before the lock release
924  * call.
925  */
926 void ITTAPI __itt_sync_releasing(void *addr);
927 
928 /** @cond exclude_from_documentation */
929 #ifndef INTEL_NO_MACRO_BODY
930 #ifndef INTEL_NO_ITTNOTIFY_API
931 ITT_STUBV(ITTAPI, void, sync_releasing, (void *addr))
932 #define __itt_sync_releasing ITTNOTIFY_VOID(sync_releasing)
933 #define __itt_sync_releasing_ptr ITTNOTIFY_NAME(sync_releasing)
934 #else /* INTEL_NO_ITTNOTIFY_API */
935 #define __itt_sync_releasing(addr)
936 #define __itt_sync_releasing_ptr 0
937 #endif /* INTEL_NO_ITTNOTIFY_API */
938 #else /* INTEL_NO_MACRO_BODY */
939 #define __itt_sync_releasing_ptr 0
940 #endif /* INTEL_NO_MACRO_BODY */
941 /** @endcond */
942 /** @} */
943 
944 /** @} sync group */
945 
946 /******************************************************************
947  * @name group of functions is used for correctness checking tools
948  ******************************************************************/
949 /** @{ */
950 /**
951  * @ingroup legacy
952  * @deprecated Legacy API
953  * @brief Fast synchronization which does no require spinning.
954  * - This special function is to be used by TBB and OpenMP libraries only when
955  * they know there is no spin but they need to suppress TC warnings about shared
956  * variable modifications.
957  * - It only has corresponding pointers in static library and does not have
958  * corresponding function in dynamic library.
959  * @see void __itt_sync_prepare(void* addr);
960  */
961 void ITTAPI __itt_fsync_prepare(void *addr);
962 
963 /** @cond exclude_from_documentation */
964 #ifndef INTEL_NO_MACRO_BODY
965 #ifndef INTEL_NO_ITTNOTIFY_API
966 ITT_STUBV(ITTAPI, void, fsync_prepare, (void *addr))
967 #define __itt_fsync_prepare ITTNOTIFY_VOID(fsync_prepare)
968 #define __itt_fsync_prepare_ptr ITTNOTIFY_NAME(fsync_prepare)
969 #else /* INTEL_NO_ITTNOTIFY_API */
970 #define __itt_fsync_prepare(addr)
971 #define __itt_fsync_prepare_ptr 0
972 #endif /* INTEL_NO_ITTNOTIFY_API */
973 #else /* INTEL_NO_MACRO_BODY */
974 #define __itt_fsync_prepare_ptr 0
975 #endif /* INTEL_NO_MACRO_BODY */
976 /** @endcond */
977 
978 /**
979  * @ingroup legacy
980  * @deprecated Legacy API
981  * @brief Fast synchronization which does no require spinning.
982  * - This special function is to be used by TBB and OpenMP libraries only when
983  * they know there is no spin but they need to suppress TC warnings about shared
984  * variable modifications.
985  * - It only has corresponding pointers in static library and does not have
986  * corresponding function in dynamic library.
987  * @see void __itt_sync_cancel(void *addr);
988  */
989 void ITTAPI __itt_fsync_cancel(void *addr);
990 
991 /** @cond exclude_from_documentation */
992 #ifndef INTEL_NO_MACRO_BODY
993 #ifndef INTEL_NO_ITTNOTIFY_API
994 ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr))
995 #define __itt_fsync_cancel ITTNOTIFY_VOID(fsync_cancel)
996 #define __itt_fsync_cancel_ptr ITTNOTIFY_NAME(fsync_cancel)
997 #else /* INTEL_NO_ITTNOTIFY_API */
998 #define __itt_fsync_cancel(addr)
999 #define __itt_fsync_cancel_ptr 0
1000 #endif /* INTEL_NO_ITTNOTIFY_API */
1001 #else /* INTEL_NO_MACRO_BODY */
1002 #define __itt_fsync_cancel_ptr 0
1003 #endif /* INTEL_NO_MACRO_BODY */
1004 /** @endcond */
1005 
1006 /**
1007  * @ingroup legacy
1008  * @deprecated Legacy API
1009  * @brief Fast synchronization which does no require spinning.
1010  * - This special function is to be used by TBB and OpenMP libraries only when
1011  * they know there is no spin but they need to suppress TC warnings about shared
1012  * variable modifications.
1013  * - It only has corresponding pointers in static library and does not have
1014  * corresponding function in dynamic library.
1015  * @see void __itt_sync_acquired(void *addr);
1016  */
1017 void ITTAPI __itt_fsync_acquired(void *addr);
1018 
1019 /** @cond exclude_from_documentation */
1020 #ifndef INTEL_NO_MACRO_BODY
1021 #ifndef INTEL_NO_ITTNOTIFY_API
1022 ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr))
1023 #define __itt_fsync_acquired ITTNOTIFY_VOID(fsync_acquired)
1024 #define __itt_fsync_acquired_ptr ITTNOTIFY_NAME(fsync_acquired)
1025 #else /* INTEL_NO_ITTNOTIFY_API */
1026 #define __itt_fsync_acquired(addr)
1027 #define __itt_fsync_acquired_ptr 0
1028 #endif /* INTEL_NO_ITTNOTIFY_API */
1029 #else /* INTEL_NO_MACRO_BODY */
1030 #define __itt_fsync_acquired_ptr 0
1031 #endif /* INTEL_NO_MACRO_BODY */
1032 /** @endcond */
1033 
1034 /**
1035  * @ingroup legacy
1036  * @deprecated Legacy API
1037  * @brief Fast synchronization which does no require spinning.
1038  * - This special function is to be used by TBB and OpenMP libraries only when
1039  * they know there is no spin but they need to suppress TC warnings about shared
1040  * variable modifications.
1041  * - It only has corresponding pointers in static library and does not have
1042  * corresponding function in dynamic library.
1043  * @see void __itt_sync_releasing(void* addr);
1044  */
1045 void ITTAPI __itt_fsync_releasing(void *addr);
1046 
1047 /** @cond exclude_from_documentation */
1048 #ifndef INTEL_NO_MACRO_BODY
1049 #ifndef INTEL_NO_ITTNOTIFY_API
1050 ITT_STUBV(ITTAPI, void, fsync_releasing, (void *addr))
1051 #define __itt_fsync_releasing ITTNOTIFY_VOID(fsync_releasing)
1052 #define __itt_fsync_releasing_ptr ITTNOTIFY_NAME(fsync_releasing)
1053 #else /* INTEL_NO_ITTNOTIFY_API */
1054 #define __itt_fsync_releasing(addr)
1055 #define __itt_fsync_releasing_ptr 0
1056 #endif /* INTEL_NO_ITTNOTIFY_API */
1057 #else /* INTEL_NO_MACRO_BODY */
1058 #define __itt_fsync_releasing_ptr 0
1059 #endif /* INTEL_NO_MACRO_BODY */
1060 /** @endcond */
1061 /** @} */
1062 
1063 /**
1064  * @defgroup model Modeling by Intel(R) Parallel Advisor
1065  * @ingroup public
1066  * This is the subset of itt used for modeling by Intel(R) Parallel Advisor.
1067  * This API is called ONLY using annotate.h, by "Annotation" macros
1068  * the user places in their sources during the parallelism modeling steps.
1069  *
1070  * site_begin/end and task_begin/end take the address of handle variables,
1071  * which are writeable by the API.  Handles must be 0 initialized prior
1072  * to the first call to begin, or may cause a run-time failure.
1073  * The handles are initialized in a multi-thread safe way by the API if
1074  * the handle is 0.  The commonly expected idiom is one static handle to
1075  * identify a site or task.  If a site or task of the same name has already
1076  * been started during this collection, the same handle MAY be returned,
1077  * but is not required to be - it is unspecified if data merging is done
1078  * based on name.  These routines also take an instance variable.  Like
1079  * the lexical instance, these must be 0 initialized.  Unlike the lexical
1080  * instance, this is used to track a single dynamic instance.
1081  *
1082  * API used by the Intel(R) Parallel Advisor to describe potential concurrency
1083  * and related activities. User-added source annotations expand to calls
1084  * to these procedures to enable modeling of a hypothetical concurrent
1085  * execution serially.
1086  * @{
1087  */
1088 #if !defined(_ADVISOR_ANNOTATE_H_) || defined(ANNOTATE_EXPAND_NULL)
1089 
1090 typedef void *__itt_model_site; /*!< @brief handle for lexical site     */
1091 typedef void
1092     *__itt_model_site_instance; /*!< @brief handle for dynamic instance */
1093 typedef void *__itt_model_task; /*!< @brief handle for lexical site     */
1094 typedef void
1095     *__itt_model_task_instance; /*!< @brief handle for dynamic instance */
1096 
1097 /**
1098  * @enum __itt_model_disable
1099  * @brief Enumerator for the disable methods
1100  */
1101 typedef enum {
1102   __itt_model_disable_observation,
1103   __itt_model_disable_collection
1104 } __itt_model_disable;
1105 
1106 #endif /* !_ADVISOR_ANNOTATE_H_ || ANNOTATE_EXPAND_NULL */
1107 
1108 /**
1109  * @brief ANNOTATE_SITE_BEGIN/ANNOTATE_SITE_END support.
1110  *
1111  * site_begin/end model a potential concurrency site.
1112  * site instances may be recursively nested with themselves.
1113  * site_end exits the most recently started but unended site for the current
1114  * thread.  The handle passed to end may be used to validate structure.
1115  * Instances of a site encountered on different threads concurrently
1116  * are considered completely distinct. If the site name for two different
1117  * lexical sites match, it is unspecified whether they are treated as the
1118  * same or different for data presentation.
1119  */
1120 void ITTAPI __itt_model_site_begin(__itt_model_site *site,
1121                                    __itt_model_site_instance *instance,
1122                                    const char *name);
1123 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1124 void ITTAPI __itt_model_site_beginW(const wchar_t *name);
1125 #endif
1126 void ITTAPI __itt_model_site_beginA(const char *name);
1127 void ITTAPI __itt_model_site_beginAL(const char *name, size_t siteNameLen);
1128 void ITTAPI __itt_model_site_end(__itt_model_site *site,
1129                                  __itt_model_site_instance *instance);
1130 void ITTAPI __itt_model_site_end_2(void);
1131 
1132 /** @cond exclude_from_documentation */
1133 #ifndef INTEL_NO_MACRO_BODY
1134 #ifndef INTEL_NO_ITTNOTIFY_API
1135 ITT_STUBV(ITTAPI, void, model_site_begin,
1136           (__itt_model_site * site, __itt_model_site_instance *instance,
1137            const char *name))
1138 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1139 ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name))
1140 #endif
1141 ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name))
1142 ITT_STUBV(ITTAPI, void, model_site_beginAL,
1143           (const char *name, size_t siteNameLen))
1144 ITT_STUBV(ITTAPI, void, model_site_end,
1145           (__itt_model_site * site, __itt_model_site_instance *instance))
1146 ITT_STUBV(ITTAPI, void, model_site_end_2, (void))
1147 #define __itt_model_site_begin ITTNOTIFY_VOID(model_site_begin)
1148 #define __itt_model_site_begin_ptr ITTNOTIFY_NAME(model_site_begin)
1149 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1150 #define __itt_model_site_beginW ITTNOTIFY_VOID(model_site_beginW)
1151 #define __itt_model_site_beginW_ptr ITTNOTIFY_NAME(model_site_beginW)
1152 #endif
1153 #define __itt_model_site_beginA ITTNOTIFY_VOID(model_site_beginA)
1154 #define __itt_model_site_beginA_ptr ITTNOTIFY_NAME(model_site_beginA)
1155 #define __itt_model_site_beginAL ITTNOTIFY_VOID(model_site_beginAL)
1156 #define __itt_model_site_beginAL_ptr ITTNOTIFY_NAME(model_site_beginAL)
1157 #define __itt_model_site_end ITTNOTIFY_VOID(model_site_end)
1158 #define __itt_model_site_end_ptr ITTNOTIFY_NAME(model_site_end)
1159 #define __itt_model_site_end_2 ITTNOTIFY_VOID(model_site_end_2)
1160 #define __itt_model_site_end_2_ptr ITTNOTIFY_NAME(model_site_end_2)
1161 #else /* INTEL_NO_ITTNOTIFY_API */
1162 #define __itt_model_site_begin(site, instance, name)
1163 #define __itt_model_site_begin_ptr 0
1164 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1165 #define __itt_model_site_beginW(name)
1166 #define __itt_model_site_beginW_ptr 0
1167 #endif
1168 #define __itt_model_site_beginA(name)
1169 #define __itt_model_site_beginA_ptr 0
1170 #define __itt_model_site_beginAL(name, siteNameLen)
1171 #define __itt_model_site_beginAL_ptr 0
1172 #define __itt_model_site_end(site, instance)
1173 #define __itt_model_site_end_ptr 0
1174 #define __itt_model_site_end_2()
1175 #define __itt_model_site_end_2_ptr 0
1176 #endif /* INTEL_NO_ITTNOTIFY_API */
1177 #else /* INTEL_NO_MACRO_BODY */
1178 #define __itt_model_site_begin_ptr 0
1179 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1180 #define __itt_model_site_beginW_ptr 0
1181 #endif
1182 #define __itt_model_site_beginA_ptr 0
1183 #define __itt_model_site_beginAL_ptr 0
1184 #define __itt_model_site_end_ptr 0
1185 #define __itt_model_site_end_2_ptr 0
1186 #endif /* INTEL_NO_MACRO_BODY */
1187 /** @endcond */
1188 
1189 /**
1190  * @brief ANNOTATE_TASK_BEGIN/ANNOTATE_TASK_END support
1191  *
1192  * task_begin/end model a potential task, which is contained within the most
1193  * closely enclosing dynamic site.  task_end exits the most recently started
1194  * but unended task.  The handle passed to end may be used to validate
1195  * structure.  It is unspecified if bad dynamic nesting is detected.  If it
1196  * is, it should be encoded in the resulting data collection.  The collector
1197  * should not fail due to construct nesting issues, nor attempt to directly
1198  * indicate the problem.
1199  */
1200 void ITTAPI __itt_model_task_begin(__itt_model_task *task,
1201                                    __itt_model_task_instance *instance,
1202                                    const char *name);
1203 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1204 void ITTAPI __itt_model_task_beginW(const wchar_t *name);
1205 void ITTAPI __itt_model_iteration_taskW(const wchar_t *name);
1206 #endif
1207 void ITTAPI __itt_model_task_beginA(const char *name);
1208 void ITTAPI __itt_model_task_beginAL(const char *name, size_t taskNameLen);
1209 void ITTAPI __itt_model_iteration_taskA(const char *name);
1210 void ITTAPI __itt_model_iteration_taskAL(const char *name, size_t taskNameLen);
1211 void ITTAPI __itt_model_task_end(__itt_model_task *task,
1212                                  __itt_model_task_instance *instance);
1213 void ITTAPI __itt_model_task_end_2(void);
1214 
1215 /** @cond exclude_from_documentation */
1216 #ifndef INTEL_NO_MACRO_BODY
1217 #ifndef INTEL_NO_ITTNOTIFY_API
1218 ITT_STUBV(ITTAPI, void, model_task_begin,
1219           (__itt_model_task * task, __itt_model_task_instance *instance,
1220            const char *name))
1221 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1222 ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name))
1223 ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name))
1224 #endif
1225 ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name))
1226 ITT_STUBV(ITTAPI, void, model_task_beginAL,
1227           (const char *name, size_t taskNameLen))
1228 ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name))
1229 ITT_STUBV(ITTAPI, void, model_iteration_taskAL,
1230           (const char *name, size_t taskNameLen))
1231 ITT_STUBV(ITTAPI, void, model_task_end,
1232           (__itt_model_task * task, __itt_model_task_instance *instance))
1233 ITT_STUBV(ITTAPI, void, model_task_end_2, (void))
1234 #define __itt_model_task_begin ITTNOTIFY_VOID(model_task_begin)
1235 #define __itt_model_task_begin_ptr ITTNOTIFY_NAME(model_task_begin)
1236 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1237 #define __itt_model_task_beginW ITTNOTIFY_VOID(model_task_beginW)
1238 #define __itt_model_task_beginW_ptr ITTNOTIFY_NAME(model_task_beginW)
1239 #define __itt_model_iteration_taskW ITTNOTIFY_VOID(model_iteration_taskW)
1240 #define __itt_model_iteration_taskW_ptr ITTNOTIFY_NAME(model_iteration_taskW)
1241 #endif
1242 #define __itt_model_task_beginA ITTNOTIFY_VOID(model_task_beginA)
1243 #define __itt_model_task_beginA_ptr ITTNOTIFY_NAME(model_task_beginA)
1244 #define __itt_model_task_beginAL ITTNOTIFY_VOID(model_task_beginAL)
1245 #define __itt_model_task_beginAL_ptr ITTNOTIFY_NAME(model_task_beginAL)
1246 #define __itt_model_iteration_taskA ITTNOTIFY_VOID(model_iteration_taskA)
1247 #define __itt_model_iteration_taskA_ptr ITTNOTIFY_NAME(model_iteration_taskA)
1248 #define __itt_model_iteration_taskAL ITTNOTIFY_VOID(model_iteration_taskAL)
1249 #define __itt_model_iteration_taskAL_ptr ITTNOTIFY_NAME(model_iteration_taskAL)
1250 #define __itt_model_task_end ITTNOTIFY_VOID(model_task_end)
1251 #define __itt_model_task_end_ptr ITTNOTIFY_NAME(model_task_end)
1252 #define __itt_model_task_end_2 ITTNOTIFY_VOID(model_task_end_2)
1253 #define __itt_model_task_end_2_ptr ITTNOTIFY_NAME(model_task_end_2)
1254 #else /* INTEL_NO_ITTNOTIFY_API */
1255 #define __itt_model_task_begin(task, instance, name)
1256 #define __itt_model_task_begin_ptr 0
1257 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1258 #define __itt_model_task_beginW(name)
1259 #define __itt_model_task_beginW_ptr 0
1260 #endif
1261 #define __itt_model_task_beginA(name)
1262 #define __itt_model_task_beginA_ptr 0
1263 #define __itt_model_task_beginAL(name, siteNameLen)
1264 #define __itt_model_task_beginAL_ptr 0
1265 #define __itt_model_iteration_taskA(name)
1266 #define __itt_model_iteration_taskA_ptr 0
1267 #define __itt_model_iteration_taskAL(name, siteNameLen)
1268 #define __itt_model_iteration_taskAL_ptr 0
1269 #define __itt_model_task_end(task, instance)
1270 #define __itt_model_task_end_ptr 0
1271 #define __itt_model_task_end_2()
1272 #define __itt_model_task_end_2_ptr 0
1273 #endif /* INTEL_NO_ITTNOTIFY_API */
1274 #else /* INTEL_NO_MACRO_BODY */
1275 #define __itt_model_task_begin_ptr 0
1276 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1277 #define __itt_model_task_beginW_ptr 0
1278 #endif
1279 #define __itt_model_task_beginA_ptr 0
1280 #define __itt_model_task_beginAL_ptr 0
1281 #define __itt_model_iteration_taskA_ptr 0
1282 #define __itt_model_iteration_taskAL_ptr 0
1283 #define __itt_model_task_end_ptr 0
1284 #define __itt_model_task_end_2_ptr 0
1285 #endif /* INTEL_NO_MACRO_BODY */
1286 /** @endcond */
1287 
1288 /**
1289  * @brief ANNOTATE_LOCK_ACQUIRE/ANNOTATE_LOCK_RELEASE support
1290  *
1291  * lock_acquire/release model a potential lock for both lockset and
1292  * performance modeling.  Each unique address is modeled as a separate
1293  * lock, with invalid addresses being valid lock IDs.  Specifically:
1294  * no storage is accessed by the API at the specified address - it is only
1295  * used for lock identification.  Lock acquires may be self-nested and are
1296  * unlocked by a corresponding number of releases.
1297  * (These closely correspond to __itt_sync_acquired/__itt_sync_releasing,
1298  * but may not have identical semantics.)
1299  */
1300 void ITTAPI __itt_model_lock_acquire(void *lock);
1301 void ITTAPI __itt_model_lock_acquire_2(void *lock);
1302 void ITTAPI __itt_model_lock_release(void *lock);
1303 void ITTAPI __itt_model_lock_release_2(void *lock);
1304 
1305 /** @cond exclude_from_documentation */
1306 #ifndef INTEL_NO_MACRO_BODY
1307 #ifndef INTEL_NO_ITTNOTIFY_API
1308 ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock))
1309 ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock))
1310 ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock))
1311 ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock))
1312 #define __itt_model_lock_acquire ITTNOTIFY_VOID(model_lock_acquire)
1313 #define __itt_model_lock_acquire_ptr ITTNOTIFY_NAME(model_lock_acquire)
1314 #define __itt_model_lock_acquire_2 ITTNOTIFY_VOID(model_lock_acquire_2)
1315 #define __itt_model_lock_acquire_2_ptr ITTNOTIFY_NAME(model_lock_acquire_2)
1316 #define __itt_model_lock_release ITTNOTIFY_VOID(model_lock_release)
1317 #define __itt_model_lock_release_ptr ITTNOTIFY_NAME(model_lock_release)
1318 #define __itt_model_lock_release_2 ITTNOTIFY_VOID(model_lock_release_2)
1319 #define __itt_model_lock_release_2_ptr ITTNOTIFY_NAME(model_lock_release_2)
1320 #else /* INTEL_NO_ITTNOTIFY_API */
1321 #define __itt_model_lock_acquire(lock)
1322 #define __itt_model_lock_acquire_ptr 0
1323 #define __itt_model_lock_acquire_2(lock)
1324 #define __itt_model_lock_acquire_2_ptr 0
1325 #define __itt_model_lock_release(lock)
1326 #define __itt_model_lock_release_ptr 0
1327 #define __itt_model_lock_release_2(lock)
1328 #define __itt_model_lock_release_2_ptr 0
1329 #endif /* INTEL_NO_ITTNOTIFY_API */
1330 #else /* INTEL_NO_MACRO_BODY */
1331 #define __itt_model_lock_acquire_ptr 0
1332 #define __itt_model_lock_acquire_2_ptr 0
1333 #define __itt_model_lock_release_ptr 0
1334 #define __itt_model_lock_release_2_ptr 0
1335 #endif /* INTEL_NO_MACRO_BODY */
1336 /** @endcond */
1337 
1338 /**
1339  * @brief ANNOTATE_RECORD_ALLOCATION/ANNOTATE_RECORD_DEALLOCATION support
1340  *
1341  * record_allocation/deallocation describe user-defined memory allocator
1342  * behavior, which may be required for correctness modeling to understand
1343  * when storage is not expected to be actually reused across threads.
1344  */
1345 void ITTAPI __itt_model_record_allocation(void *addr, size_t size);
1346 void ITTAPI __itt_model_record_deallocation(void *addr);
1347 
1348 /** @cond exclude_from_documentation */
1349 #ifndef INTEL_NO_MACRO_BODY
1350 #ifndef INTEL_NO_ITTNOTIFY_API
1351 ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size))
1352 ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr))
1353 #define __itt_model_record_allocation ITTNOTIFY_VOID(model_record_allocation)
1354 #define __itt_model_record_allocation_ptr                                      \
1355   ITTNOTIFY_NAME(model_record_allocation)
1356 #define __itt_model_record_deallocation                                        \
1357   ITTNOTIFY_VOID(model_record_deallocation)
1358 #define __itt_model_record_deallocation_ptr                                    \
1359   ITTNOTIFY_NAME(model_record_deallocation)
1360 #else /* INTEL_NO_ITTNOTIFY_API */
1361 #define __itt_model_record_allocation(addr, size)
1362 #define __itt_model_record_allocation_ptr 0
1363 #define __itt_model_record_deallocation(addr)
1364 #define __itt_model_record_deallocation_ptr 0
1365 #endif /* INTEL_NO_ITTNOTIFY_API */
1366 #else /* INTEL_NO_MACRO_BODY */
1367 #define __itt_model_record_allocation_ptr 0
1368 #define __itt_model_record_deallocation_ptr 0
1369 #endif /* INTEL_NO_MACRO_BODY */
1370 /** @endcond */
1371 
1372 /**
1373  * @brief ANNOTATE_INDUCTION_USES support
1374  *
1375  * Note particular storage is inductive through the end of the current site
1376  */
1377 void ITTAPI __itt_model_induction_uses(void *addr, size_t size);
1378 
1379 /** @cond exclude_from_documentation */
1380 #ifndef INTEL_NO_MACRO_BODY
1381 #ifndef INTEL_NO_ITTNOTIFY_API
1382 ITT_STUBV(ITTAPI, void, model_induction_uses, (void *addr, size_t size))
1383 #define __itt_model_induction_uses ITTNOTIFY_VOID(model_induction_uses)
1384 #define __itt_model_induction_uses_ptr ITTNOTIFY_NAME(model_induction_uses)
1385 #else /* INTEL_NO_ITTNOTIFY_API */
1386 #define __itt_model_induction_uses(addr, size)
1387 #define __itt_model_induction_uses_ptr 0
1388 #endif /* INTEL_NO_ITTNOTIFY_API */
1389 #else /* INTEL_NO_MACRO_BODY */
1390 #define __itt_model_induction_uses_ptr 0
1391 #endif /* INTEL_NO_MACRO_BODY */
1392 /** @endcond */
1393 
1394 /**
1395  * @brief ANNOTATE_REDUCTION_USES support
1396  *
1397  * Note particular storage is used for reduction through the end
1398  * of the current site
1399  */
1400 void ITTAPI __itt_model_reduction_uses(void *addr, size_t size);
1401 
1402 /** @cond exclude_from_documentation */
1403 #ifndef INTEL_NO_MACRO_BODY
1404 #ifndef INTEL_NO_ITTNOTIFY_API
1405 ITT_STUBV(ITTAPI, void, model_reduction_uses, (void *addr, size_t size))
1406 #define __itt_model_reduction_uses ITTNOTIFY_VOID(model_reduction_uses)
1407 #define __itt_model_reduction_uses_ptr ITTNOTIFY_NAME(model_reduction_uses)
1408 #else /* INTEL_NO_ITTNOTIFY_API */
1409 #define __itt_model_reduction_uses(addr, size)
1410 #define __itt_model_reduction_uses_ptr 0
1411 #endif /* INTEL_NO_ITTNOTIFY_API */
1412 #else /* INTEL_NO_MACRO_BODY */
1413 #define __itt_model_reduction_uses_ptr 0
1414 #endif /* INTEL_NO_MACRO_BODY */
1415 /** @endcond */
1416 
1417 /**
1418  * @brief ANNOTATE_OBSERVE_USES support
1419  *
1420  * Have correctness modeling record observations about uses of storage
1421  * through the end of the current site
1422  */
1423 void ITTAPI __itt_model_observe_uses(void *addr, size_t size);
1424 
1425 /** @cond exclude_from_documentation */
1426 #ifndef INTEL_NO_MACRO_BODY
1427 #ifndef INTEL_NO_ITTNOTIFY_API
1428 ITT_STUBV(ITTAPI, void, model_observe_uses, (void *addr, size_t size))
1429 #define __itt_model_observe_uses ITTNOTIFY_VOID(model_observe_uses)
1430 #define __itt_model_observe_uses_ptr ITTNOTIFY_NAME(model_observe_uses)
1431 #else /* INTEL_NO_ITTNOTIFY_API */
1432 #define __itt_model_observe_uses(addr, size)
1433 #define __itt_model_observe_uses_ptr 0
1434 #endif /* INTEL_NO_ITTNOTIFY_API */
1435 #else /* INTEL_NO_MACRO_BODY */
1436 #define __itt_model_observe_uses_ptr 0
1437 #endif /* INTEL_NO_MACRO_BODY */
1438 /** @endcond */
1439 
1440 /**
1441  * @brief ANNOTATE_CLEAR_USES support
1442  *
1443  * Clear the special handling of a piece of storage related to induction,
1444  * reduction or observe_uses
1445  */
1446 void ITTAPI __itt_model_clear_uses(void *addr);
1447 
1448 /** @cond exclude_from_documentation */
1449 #ifndef INTEL_NO_MACRO_BODY
1450 #ifndef INTEL_NO_ITTNOTIFY_API
1451 ITT_STUBV(ITTAPI, void, model_clear_uses, (void *addr))
1452 #define __itt_model_clear_uses ITTNOTIFY_VOID(model_clear_uses)
1453 #define __itt_model_clear_uses_ptr ITTNOTIFY_NAME(model_clear_uses)
1454 #else /* INTEL_NO_ITTNOTIFY_API */
1455 #define __itt_model_clear_uses(addr)
1456 #define __itt_model_clear_uses_ptr 0
1457 #endif /* INTEL_NO_ITTNOTIFY_API */
1458 #else /* INTEL_NO_MACRO_BODY */
1459 #define __itt_model_clear_uses_ptr 0
1460 #endif /* INTEL_NO_MACRO_BODY */
1461 /** @endcond */
1462 
1463 /**
1464  * @brief ANNOTATE_DISABLE_*_PUSH/ANNOTATE_DISABLE_*_POP support
1465  *
1466  * disable_push/disable_pop push and pop disabling based on a parameter.
1467  * Disabling observations stops processing of memory references during
1468  * correctness modeling, and all annotations that occur in the disabled
1469  * region.  This allows description of code that is expected to be handled
1470  * specially during conversion to parallelism or that is not recognized
1471  * by tools (e.g. some kinds of synchronization operations.)
1472  * This mechanism causes all annotations in the disabled region, other
1473  * than disable_push and disable_pop, to be ignored.  (For example, this
1474  * might validly be used to disable an entire parallel site and the contained
1475  * tasks and locking in it for data collection purposes.)
1476  * The disable for collection is a more expensive operation, but reduces
1477  * collector overhead significantly.  This applies to BOTH correctness data
1478  * collection and performance data collection.  For example, a site
1479  * containing a task might only enable data collection for the first 10
1480  * iterations.  Both performance and correctness data should reflect this,
1481  * and the program should run as close to full speed as possible when
1482  * collection is disabled.
1483  */
1484 void ITTAPI __itt_model_disable_push(__itt_model_disable x);
1485 void ITTAPI __itt_model_disable_pop(void);
1486 void ITTAPI __itt_model_aggregate_task(size_t x);
1487 
1488 /** @cond exclude_from_documentation */
1489 #ifndef INTEL_NO_MACRO_BODY
1490 #ifndef INTEL_NO_ITTNOTIFY_API
1491 ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x))
1492 ITT_STUBV(ITTAPI, void, model_disable_pop, (void))
1493 ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t x))
1494 #define __itt_model_disable_push ITTNOTIFY_VOID(model_disable_push)
1495 #define __itt_model_disable_push_ptr ITTNOTIFY_NAME(model_disable_push)
1496 #define __itt_model_disable_pop ITTNOTIFY_VOID(model_disable_pop)
1497 #define __itt_model_disable_pop_ptr ITTNOTIFY_NAME(model_disable_pop)
1498 #define __itt_model_aggregate_task ITTNOTIFY_VOID(model_aggregate_task)
1499 #define __itt_model_aggregate_task_ptr ITTNOTIFY_NAME(model_aggregate_task)
1500 #else /* INTEL_NO_ITTNOTIFY_API */
1501 #define __itt_model_disable_push(x)
1502 #define __itt_model_disable_push_ptr 0
1503 #define __itt_model_disable_pop()
1504 #define __itt_model_disable_pop_ptr 0
1505 #define __itt_model_aggregate_task(x)
1506 #define __itt_model_aggregate_task_ptr 0
1507 #endif /* INTEL_NO_ITTNOTIFY_API */
1508 #else /* INTEL_NO_MACRO_BODY */
1509 #define __itt_model_disable_push_ptr 0
1510 #define __itt_model_disable_pop_ptr 0
1511 #define __itt_model_aggregate_task_ptr 0
1512 #endif /* INTEL_NO_MACRO_BODY */
1513 /** @endcond */
1514 /** @} model group */
1515 
1516 /**
1517  * @defgroup heap Heap
1518  * @ingroup public
1519  * Heap group
1520  * @{
1521  */
1522 
1523 typedef void *__itt_heap_function;
1524 
1525 /**
1526  * @brief Create an identification for heap function
1527  * @return non-zero identifier or NULL
1528  */
1529 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1530 __itt_heap_function ITTAPI __itt_heap_function_createA(const char *name,
1531                                                        const char *domain);
1532 __itt_heap_function ITTAPI __itt_heap_function_createW(const wchar_t *name,
1533                                                        const wchar_t *domain);
1534 #if defined(UNICODE) || defined(_UNICODE)
1535 #define __itt_heap_function_create __itt_heap_function_createW
1536 #define __itt_heap_function_create_ptr __itt_heap_function_createW_ptr
1537 #else
1538 #define __itt_heap_function_create __itt_heap_function_createA
1539 #define __itt_heap_function_create_ptr __itt_heap_function_createA_ptr
1540 #endif /* UNICODE */
1541 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1542 __itt_heap_function ITTAPI __itt_heap_function_create(const char *name,
1543                                                       const char *domain);
1544 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1545 
1546 /** @cond exclude_from_documentation */
1547 #ifndef INTEL_NO_MACRO_BODY
1548 #ifndef INTEL_NO_ITTNOTIFY_API
1549 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1550 ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA,
1551          (const char *name, const char *domain))
1552 ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW,
1553          (const wchar_t *name, const wchar_t *domain))
1554 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1555 ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create,
1556          (const char *name, const char *domain))
1557 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1558 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1559 #define __itt_heap_function_createA ITTNOTIFY_DATA(heap_function_createA)
1560 #define __itt_heap_function_createA_ptr ITTNOTIFY_NAME(heap_function_createA)
1561 #define __itt_heap_function_createW ITTNOTIFY_DATA(heap_function_createW)
1562 #define __itt_heap_function_createW_ptr ITTNOTIFY_NAME(heap_function_createW)
1563 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1564 #define __itt_heap_function_create ITTNOTIFY_DATA(heap_function_create)
1565 #define __itt_heap_function_create_ptr ITTNOTIFY_NAME(heap_function_create)
1566 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1567 #else /* INTEL_NO_ITTNOTIFY_API */
1568 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1569 #define __itt_heap_function_createA(name, domain) (__itt_heap_function)0
1570 #define __itt_heap_function_createA_ptr 0
1571 #define __itt_heap_function_createW(name, domain) (__itt_heap_function)0
1572 #define __itt_heap_function_createW_ptr 0
1573 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1574 #define __itt_heap_function_create(name, domain) (__itt_heap_function)0
1575 #define __itt_heap_function_create_ptr 0
1576 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1577 #endif /* INTEL_NO_ITTNOTIFY_API */
1578 #else /* INTEL_NO_MACRO_BODY */
1579 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1580 #define __itt_heap_function_createA_ptr 0
1581 #define __itt_heap_function_createW_ptr 0
1582 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1583 #define __itt_heap_function_create_ptr 0
1584 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1585 #endif /* INTEL_NO_MACRO_BODY */
1586 /** @endcond */
1587 
1588 /**
1589  * @brief Record an allocation begin occurrence.
1590  */
1591 void ITTAPI __itt_heap_allocate_begin(__itt_heap_function h, size_t size,
1592                                       int initialized);
1593 
1594 /** @cond exclude_from_documentation */
1595 #ifndef INTEL_NO_MACRO_BODY
1596 #ifndef INTEL_NO_ITTNOTIFY_API
1597 ITT_STUBV(ITTAPI, void, heap_allocate_begin,
1598           (__itt_heap_function h, size_t size, int initialized))
1599 #define __itt_heap_allocate_begin ITTNOTIFY_VOID(heap_allocate_begin)
1600 #define __itt_heap_allocate_begin_ptr ITTNOTIFY_NAME(heap_allocate_begin)
1601 #else /* INTEL_NO_ITTNOTIFY_API */
1602 #define __itt_heap_allocate_begin(h, size, initialized)
1603 #define __itt_heap_allocate_begin_ptr 0
1604 #endif /* INTEL_NO_ITTNOTIFY_API */
1605 #else /* INTEL_NO_MACRO_BODY */
1606 #define __itt_heap_allocate_begin_ptr 0
1607 #endif /* INTEL_NO_MACRO_BODY */
1608 /** @endcond */
1609 
1610 /**
1611  * @brief Record an allocation end occurrence.
1612  */
1613 void ITTAPI __itt_heap_allocate_end(__itt_heap_function h, void **addr,
1614                                     size_t size, int initialized);
1615 
1616 /** @cond exclude_from_documentation */
1617 #ifndef INTEL_NO_MACRO_BODY
1618 #ifndef INTEL_NO_ITTNOTIFY_API
1619 ITT_STUBV(ITTAPI, void, heap_allocate_end,
1620           (__itt_heap_function h, void **addr, size_t size, int initialized))
1621 #define __itt_heap_allocate_end ITTNOTIFY_VOID(heap_allocate_end)
1622 #define __itt_heap_allocate_end_ptr ITTNOTIFY_NAME(heap_allocate_end)
1623 #else /* INTEL_NO_ITTNOTIFY_API */
1624 #define __itt_heap_allocate_end(h, addr, size, initialized)
1625 #define __itt_heap_allocate_end_ptr 0
1626 #endif /* INTEL_NO_ITTNOTIFY_API */
1627 #else /* INTEL_NO_MACRO_BODY */
1628 #define __itt_heap_allocate_end_ptr 0
1629 #endif /* INTEL_NO_MACRO_BODY */
1630 /** @endcond */
1631 
1632 /**
1633  * @brief Record a free begin occurrence.
1634  */
1635 void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void *addr);
1636 
1637 /** @cond exclude_from_documentation */
1638 #ifndef INTEL_NO_MACRO_BODY
1639 #ifndef INTEL_NO_ITTNOTIFY_API
1640 ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void *addr))
1641 #define __itt_heap_free_begin ITTNOTIFY_VOID(heap_free_begin)
1642 #define __itt_heap_free_begin_ptr ITTNOTIFY_NAME(heap_free_begin)
1643 #else /* INTEL_NO_ITTNOTIFY_API */
1644 #define __itt_heap_free_begin(h, addr)
1645 #define __itt_heap_free_begin_ptr 0
1646 #endif /* INTEL_NO_ITTNOTIFY_API */
1647 #else /* INTEL_NO_MACRO_BODY */
1648 #define __itt_heap_free_begin_ptr 0
1649 #endif /* INTEL_NO_MACRO_BODY */
1650 /** @endcond */
1651 
1652 /**
1653  * @brief Record a free end occurrence.
1654  */
1655 void ITTAPI __itt_heap_free_end(__itt_heap_function h, void *addr);
1656 
1657 /** @cond exclude_from_documentation */
1658 #ifndef INTEL_NO_MACRO_BODY
1659 #ifndef INTEL_NO_ITTNOTIFY_API
1660 ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void *addr))
1661 #define __itt_heap_free_end ITTNOTIFY_VOID(heap_free_end)
1662 #define __itt_heap_free_end_ptr ITTNOTIFY_NAME(heap_free_end)
1663 #else /* INTEL_NO_ITTNOTIFY_API */
1664 #define __itt_heap_free_end(h, addr)
1665 #define __itt_heap_free_end_ptr 0
1666 #endif /* INTEL_NO_ITTNOTIFY_API */
1667 #else /* INTEL_NO_MACRO_BODY */
1668 #define __itt_heap_free_end_ptr 0
1669 #endif /* INTEL_NO_MACRO_BODY */
1670 /** @endcond */
1671 
1672 /**
1673  * @brief Record a reallocation begin occurrence.
1674  */
1675 void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void *addr,
1676                                         size_t new_size, int initialized);
1677 
1678 /** @cond exclude_from_documentation */
1679 #ifndef INTEL_NO_MACRO_BODY
1680 #ifndef INTEL_NO_ITTNOTIFY_API
1681 ITT_STUBV(ITTAPI, void, heap_reallocate_begin,
1682           (__itt_heap_function h, void *addr, size_t new_size, int initialized))
1683 #define __itt_heap_reallocate_begin ITTNOTIFY_VOID(heap_reallocate_begin)
1684 #define __itt_heap_reallocate_begin_ptr ITTNOTIFY_NAME(heap_reallocate_begin)
1685 #else /* INTEL_NO_ITTNOTIFY_API */
1686 #define __itt_heap_reallocate_begin(h, addr, new_size, initialized)
1687 #define __itt_heap_reallocate_begin_ptr 0
1688 #endif /* INTEL_NO_ITTNOTIFY_API */
1689 #else /* INTEL_NO_MACRO_BODY */
1690 #define __itt_heap_reallocate_begin_ptr 0
1691 #endif /* INTEL_NO_MACRO_BODY */
1692 /** @endcond */
1693 
1694 /**
1695  * @brief Record a reallocation end occurrence.
1696  */
1697 void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void *addr,
1698                                       void **new_addr, size_t new_size,
1699                                       int initialized);
1700 
1701 /** @cond exclude_from_documentation */
1702 #ifndef INTEL_NO_MACRO_BODY
1703 #ifndef INTEL_NO_ITTNOTIFY_API
1704 ITT_STUBV(ITTAPI, void, heap_reallocate_end,
1705           (__itt_heap_function h, void *addr, void **new_addr, size_t new_size,
1706            int initialized))
1707 #define __itt_heap_reallocate_end ITTNOTIFY_VOID(heap_reallocate_end)
1708 #define __itt_heap_reallocate_end_ptr ITTNOTIFY_NAME(heap_reallocate_end)
1709 #else /* INTEL_NO_ITTNOTIFY_API */
1710 #define __itt_heap_reallocate_end(h, addr, new_addr, new_size, initialized)
1711 #define __itt_heap_reallocate_end_ptr 0
1712 #endif /* INTEL_NO_ITTNOTIFY_API */
1713 #else /* INTEL_NO_MACRO_BODY */
1714 #define __itt_heap_reallocate_end_ptr 0
1715 #endif /* INTEL_NO_MACRO_BODY */
1716 /** @endcond */
1717 
1718 /** @brief internal access begin */
1719 void ITTAPI __itt_heap_internal_access_begin(void);
1720 
1721 /** @cond exclude_from_documentation */
1722 #ifndef INTEL_NO_MACRO_BODY
1723 #ifndef INTEL_NO_ITTNOTIFY_API
1724 ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void))
1725 #define __itt_heap_internal_access_begin                                       \
1726   ITTNOTIFY_VOID(heap_internal_access_begin)
1727 #define __itt_heap_internal_access_begin_ptr                                   \
1728   ITTNOTIFY_NAME(heap_internal_access_begin)
1729 #else /* INTEL_NO_ITTNOTIFY_API */
1730 #define __itt_heap_internal_access_begin()
1731 #define __itt_heap_internal_access_begin_ptr 0
1732 #endif /* INTEL_NO_ITTNOTIFY_API */
1733 #else /* INTEL_NO_MACRO_BODY */
1734 #define __itt_heap_internal_access_begin_ptr 0
1735 #endif /* INTEL_NO_MACRO_BODY */
1736 /** @endcond */
1737 
1738 /** @brief internal access end */
1739 void ITTAPI __itt_heap_internal_access_end(void);
1740 
1741 /** @cond exclude_from_documentation */
1742 #ifndef INTEL_NO_MACRO_BODY
1743 #ifndef INTEL_NO_ITTNOTIFY_API
1744 ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void))
1745 #define __itt_heap_internal_access_end ITTNOTIFY_VOID(heap_internal_access_end)
1746 #define __itt_heap_internal_access_end_ptr                                     \
1747   ITTNOTIFY_NAME(heap_internal_access_end)
1748 #else /* INTEL_NO_ITTNOTIFY_API */
1749 #define __itt_heap_internal_access_end()
1750 #define __itt_heap_internal_access_end_ptr 0
1751 #endif /* INTEL_NO_ITTNOTIFY_API */
1752 #else /* INTEL_NO_MACRO_BODY */
1753 #define __itt_heap_internal_access_end_ptr 0
1754 #endif /* INTEL_NO_MACRO_BODY */
1755 /** @endcond */
1756 
1757 /** @brief record memory growth begin */
1758 void ITTAPI __itt_heap_record_memory_growth_begin(void);
1759 
1760 /** @cond exclude_from_documentation */
1761 #ifndef INTEL_NO_MACRO_BODY
1762 #ifndef INTEL_NO_ITTNOTIFY_API
1763 ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void))
1764 #define __itt_heap_record_memory_growth_begin                                  \
1765   ITTNOTIFY_VOID(heap_record_memory_growth_begin)
1766 #define __itt_heap_record_memory_growth_begin_ptr                              \
1767   ITTNOTIFY_NAME(heap_record_memory_growth_begin)
1768 #else /* INTEL_NO_ITTNOTIFY_API */
1769 #define __itt_heap_record_memory_growth_begin()
1770 #define __itt_heap_record_memory_growth_begin_ptr 0
1771 #endif /* INTEL_NO_ITTNOTIFY_API */
1772 #else /* INTEL_NO_MACRO_BODY */
1773 #define __itt_heap_record_memory_growth_begin_ptr 0
1774 #endif /* INTEL_NO_MACRO_BODY */
1775 /** @endcond */
1776 
1777 /** @brief record memory growth end */
1778 void ITTAPI __itt_heap_record_memory_growth_end(void);
1779 
1780 /** @cond exclude_from_documentation */
1781 #ifndef INTEL_NO_MACRO_BODY
1782 #ifndef INTEL_NO_ITTNOTIFY_API
1783 ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void))
1784 #define __itt_heap_record_memory_growth_end                                    \
1785   ITTNOTIFY_VOID(heap_record_memory_growth_end)
1786 #define __itt_heap_record_memory_growth_end_ptr                                \
1787   ITTNOTIFY_NAME(heap_record_memory_growth_end)
1788 #else /* INTEL_NO_ITTNOTIFY_API */
1789 #define __itt_heap_record_memory_growth_end()
1790 #define __itt_heap_record_memory_growth_end_ptr 0
1791 #endif /* INTEL_NO_ITTNOTIFY_API */
1792 #else /* INTEL_NO_MACRO_BODY */
1793 #define __itt_heap_record_memory_growth_end_ptr 0
1794 #endif /* INTEL_NO_MACRO_BODY */
1795 /** @endcond */
1796 
1797 /**
1798  * @brief Specify the type of heap detection/reporting to modify.
1799  */
1800 /**
1801  * @hideinitializer
1802  * @brief Report on memory leaks.
1803  */
1804 #define __itt_heap_leaks 0x00000001
1805 
1806 /**
1807  * @hideinitializer
1808  * @brief Report on memory growth.
1809  */
1810 #define __itt_heap_growth 0x00000002
1811 
1812 /** @brief heap reset detection */
1813 void ITTAPI __itt_heap_reset_detection(unsigned int reset_mask);
1814 
1815 /** @cond exclude_from_documentation */
1816 #ifndef INTEL_NO_MACRO_BODY
1817 #ifndef INTEL_NO_ITTNOTIFY_API
1818 ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask))
1819 #define __itt_heap_reset_detection ITTNOTIFY_VOID(heap_reset_detection)
1820 #define __itt_heap_reset_detection_ptr ITTNOTIFY_NAME(heap_reset_detection)
1821 #else /* INTEL_NO_ITTNOTIFY_API */
1822 #define __itt_heap_reset_detection()
1823 #define __itt_heap_reset_detection_ptr 0
1824 #endif /* INTEL_NO_ITTNOTIFY_API */
1825 #else /* INTEL_NO_MACRO_BODY */
1826 #define __itt_heap_reset_detection_ptr 0
1827 #endif /* INTEL_NO_MACRO_BODY */
1828 /** @endcond */
1829 
1830 /** @brief report */
1831 void ITTAPI __itt_heap_record(unsigned int record_mask);
1832 
1833 /** @cond exclude_from_documentation */
1834 #ifndef INTEL_NO_MACRO_BODY
1835 #ifndef INTEL_NO_ITTNOTIFY_API
1836 ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask))
1837 #define __itt_heap_record ITTNOTIFY_VOID(heap_record)
1838 #define __itt_heap_record_ptr ITTNOTIFY_NAME(heap_record)
1839 #else /* INTEL_NO_ITTNOTIFY_API */
1840 #define __itt_heap_record()
1841 #define __itt_heap_record_ptr 0
1842 #endif /* INTEL_NO_ITTNOTIFY_API */
1843 #else /* INTEL_NO_MACRO_BODY */
1844 #define __itt_heap_record_ptr 0
1845 #endif /* INTEL_NO_MACRO_BODY */
1846 /** @endcond */
1847 
1848 /** @} heap group */
1849 /** @endcond */
1850 /* ========================================================================== */
1851 
1852 /**
1853  * @defgroup domains Domains
1854  * @ingroup public
1855  * Domains group
1856  * @{
1857  */
1858 
1859 /** @cond exclude_from_documentation */
1860 #pragma pack(push, 8)
1861 
1862 typedef struct ___itt_domain {
1863   volatile int flags; /*!< Zero if disabled, non-zero if enabled. The meaning of
1864                          different non-zero values is reserved to the runtime */
1865   const char *nameA; /*!< Copy of original name in ASCII. */
1866 #if defined(UNICODE) || defined(_UNICODE)
1867   const wchar_t *nameW; /*!< Copy of original name in UNICODE. */
1868 #else /* UNICODE || _UNICODE */
1869   void *nameW;
1870 #endif /* UNICODE || _UNICODE */
1871   int extra1; /*!< Reserved to the runtime */
1872   void *extra2; /*!< Reserved to the runtime */
1873   struct ___itt_domain *next;
1874 } __itt_domain;
1875 
1876 #pragma pack(pop)
1877 /** @endcond */
1878 
1879 /**
1880  * @ingroup domains
1881  * @brief Create a domain.
1882  * Create domain using some domain name: the URI naming style is recommended.
1883  * Because the set of domains is expected to be static over the application's
1884  * execution time, there is no mechanism to destroy a domain.
1885  * Any domain can be accessed by any thread in the process, regardless of
1886  * which thread created the domain. This call is thread-safe.
1887  * @param[in] name name of domain
1888  */
1889 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1890 __itt_domain *ITTAPI __itt_domain_createA(const char *name);
1891 __itt_domain *ITTAPI __itt_domain_createW(const wchar_t *name);
1892 #if defined(UNICODE) || defined(_UNICODE)
1893 #define __itt_domain_create __itt_domain_createW
1894 #define __itt_domain_create_ptr __itt_domain_createW_ptr
1895 #else /* UNICODE */
1896 #define __itt_domain_create __itt_domain_createA
1897 #define __itt_domain_create_ptr __itt_domain_createA_ptr
1898 #endif /* UNICODE */
1899 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1900 __itt_domain *ITTAPI __itt_domain_create(const char *name);
1901 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1902 
1903 /** @cond exclude_from_documentation */
1904 #ifndef INTEL_NO_MACRO_BODY
1905 #ifndef INTEL_NO_ITTNOTIFY_API
1906 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1907 ITT_STUB(ITTAPI, __itt_domain *, domain_createA, (const char *name))
1908 ITT_STUB(ITTAPI, __itt_domain *, domain_createW, (const wchar_t *name))
1909 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1910 ITT_STUB(ITTAPI, __itt_domain *, domain_create, (const char *name))
1911 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1912 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1913 #define __itt_domain_createA ITTNOTIFY_DATA(domain_createA)
1914 #define __itt_domain_createA_ptr ITTNOTIFY_NAME(domain_createA)
1915 #define __itt_domain_createW ITTNOTIFY_DATA(domain_createW)
1916 #define __itt_domain_createW_ptr ITTNOTIFY_NAME(domain_createW)
1917 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1918 #define __itt_domain_create ITTNOTIFY_DATA(domain_create)
1919 #define __itt_domain_create_ptr ITTNOTIFY_NAME(domain_create)
1920 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1921 #else /* INTEL_NO_ITTNOTIFY_API */
1922 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1923 #define __itt_domain_createA(name) (__itt_domain *)0
1924 #define __itt_domain_createA_ptr 0
1925 #define __itt_domain_createW(name) (__itt_domain *)0
1926 #define __itt_domain_createW_ptr 0
1927 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1928 #define __itt_domain_create(name) (__itt_domain *)0
1929 #define __itt_domain_create_ptr 0
1930 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1931 #endif /* INTEL_NO_ITTNOTIFY_API */
1932 #else /* INTEL_NO_MACRO_BODY */
1933 #if ITT_PLATFORM == ITT_PLATFORM_WIN
1934 #define __itt_domain_createA_ptr 0
1935 #define __itt_domain_createW_ptr 0
1936 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1937 #define __itt_domain_create_ptr 0
1938 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1939 #endif /* INTEL_NO_MACRO_BODY */
1940 /** @endcond */
1941 /** @} domains group */
1942 
1943 /**
1944  * @defgroup ids IDs
1945  * @ingroup public
1946  * IDs group
1947  * @{
1948  */
1949 
1950 /** @cond exclude_from_documentation */
1951 #pragma pack(push, 8)
1952 
1953 typedef struct ___itt_id {
1954   unsigned long long d1, d2, d3;
1955 } __itt_id;
1956 
1957 #pragma pack(pop)
1958 /** @endcond */
1959 
1960 static const __itt_id __itt_null = {0, 0, 0};
1961 
1962 /**
1963  * @ingroup ids
1964  * @brief A convenience function is provided to create an ID without domain
1965  * control.
1966  * @brief This is a convenience function to initialize an __itt_id structure.
1967  * This function does not affect the collector runtime in any way. After you
1968  * make the ID with this function, you still must create it with the
1969  * __itt_id_create function before using the ID to identify a named entity.
1970  * @param[in] addr The address of object; high QWORD of the ID value.
1971  * @param[in] extra The extra data to unique identify object; low QWORD of the
1972  * ID value.
1973  */
1974 
1975 ITT_INLINE __itt_id ITTAPI __itt_id_make(void *addr, unsigned long long extra)
1976     ITT_INLINE_ATTRIBUTE;
__itt_id_make(void * addr,unsigned long long extra)1977 ITT_INLINE __itt_id ITTAPI __itt_id_make(void *addr, unsigned long long extra) {
1978   __itt_id id = __itt_null;
1979   id.d1 = (unsigned long long)((uintptr_t)addr);
1980   id.d2 = (unsigned long long)extra;
1981   id.d3 = (unsigned long long)0; /* Reserved. Must be zero */
1982   return id;
1983 }
1984 
1985 /**
1986  * @ingroup ids
1987  * @brief Create an instance of identifier.
1988  * This establishes the beginning of the lifetime of an instance of
1989  * the given ID in the trace. Once this lifetime starts, the ID
1990  * can be used to tag named entity instances in calls such as
1991  * __itt_task_begin, and to specify relationships among
1992  * identified named entity instances, using the \ref relations APIs.
1993  * Instance IDs are not domain specific!
1994  * @param[in] domain The domain controlling the execution of this call.
1995  * @param[in] id The ID to create.
1996  */
1997 void ITTAPI __itt_id_create(const __itt_domain *domain, __itt_id id);
1998 
1999 /** @cond exclude_from_documentation */
2000 #ifndef INTEL_NO_MACRO_BODY
2001 #ifndef INTEL_NO_ITTNOTIFY_API
2002 ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id))
2003 #define __itt_id_create(d, x) ITTNOTIFY_VOID_D1(id_create, d, x)
2004 #define __itt_id_create_ptr ITTNOTIFY_NAME(id_create)
2005 #else /* INTEL_NO_ITTNOTIFY_API */
2006 #define __itt_id_create(domain, id)
2007 #define __itt_id_create_ptr 0
2008 #endif /* INTEL_NO_ITTNOTIFY_API */
2009 #else /* INTEL_NO_MACRO_BODY */
2010 #define __itt_id_create_ptr 0
2011 #endif /* INTEL_NO_MACRO_BODY */
2012 /** @endcond */
2013 
2014 /**
2015  * @ingroup ids
2016  * @brief Destroy an instance of identifier.
2017  * This ends the lifetime of the current instance of the given ID value in the
2018  * trace. Any relationships that are established after this lifetime ends are
2019  * invalid. This call must be performed before the given ID value can be reused
2020  * for a different named entity instance.
2021  * @param[in] domain The domain controlling the execution of this call.
2022  * @param[in] id The ID to destroy.
2023  */
2024 void ITTAPI __itt_id_destroy(const __itt_domain *domain, __itt_id id);
2025 
2026 /** @cond exclude_from_documentation */
2027 #ifndef INTEL_NO_MACRO_BODY
2028 #ifndef INTEL_NO_ITTNOTIFY_API
2029 ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id))
2030 #define __itt_id_destroy(d, x) ITTNOTIFY_VOID_D1(id_destroy, d, x)
2031 #define __itt_id_destroy_ptr ITTNOTIFY_NAME(id_destroy)
2032 #else /* INTEL_NO_ITTNOTIFY_API */
2033 #define __itt_id_destroy(domain, id)
2034 #define __itt_id_destroy_ptr 0
2035 #endif /* INTEL_NO_ITTNOTIFY_API */
2036 #else /* INTEL_NO_MACRO_BODY */
2037 #define __itt_id_destroy_ptr 0
2038 #endif /* INTEL_NO_MACRO_BODY */
2039 /** @endcond */
2040 /** @} ids group */
2041 
2042 /**
2043  * @defgroup handless String Handles
2044  * @ingroup public
2045  * String Handles group
2046  * @{
2047  */
2048 
2049 /** @cond exclude_from_documentation */
2050 #pragma pack(push, 8)
2051 
2052 typedef struct ___itt_string_handle {
2053   const char *strA; /*!< Copy of original string in ASCII. */
2054 #if defined(UNICODE) || defined(_UNICODE)
2055   const wchar_t *strW; /*!< Copy of original string in UNICODE. */
2056 #else /* UNICODE || _UNICODE */
2057   void *strW;
2058 #endif /* UNICODE || _UNICODE */
2059   int extra1; /*!< Reserved. Must be zero   */
2060   void *extra2; /*!< Reserved. Must be zero   */
2061   struct ___itt_string_handle *next;
2062 } __itt_string_handle;
2063 
2064 #pragma pack(pop)
2065 /** @endcond */
2066 
2067 /**
2068  * @ingroup handles
2069  * @brief Create a string handle.
2070  * Create and return handle value that can be associated with a string.
2071  * Consecutive calls to __itt_string_handle_create with the same name
2072  * return the same value. Because the set of string handles is expected to
2073  * remain static during the application's execution time, there is no mechanism
2074  * to destroy a string handle. Any string handle can be accessed by any thread
2075  * in the process, regardless of which thread created the string handle. This
2076  * call is thread-safe.
2077  * @param[in] name The input string
2078  */
2079 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2080 __itt_string_handle *ITTAPI __itt_string_handle_createA(const char *name);
2081 __itt_string_handle *ITTAPI __itt_string_handle_createW(const wchar_t *name);
2082 #if defined(UNICODE) || defined(_UNICODE)
2083 #define __itt_string_handle_create __itt_string_handle_createW
2084 #define __itt_string_handle_create_ptr __itt_string_handle_createW_ptr
2085 #else /* UNICODE */
2086 #define __itt_string_handle_create __itt_string_handle_createA
2087 #define __itt_string_handle_create_ptr __itt_string_handle_createA_ptr
2088 #endif /* UNICODE */
2089 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2090 __itt_string_handle *ITTAPI __itt_string_handle_create(const char *name);
2091 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2092 
2093 /** @cond exclude_from_documentation */
2094 #ifndef INTEL_NO_MACRO_BODY
2095 #ifndef INTEL_NO_ITTNOTIFY_API
2096 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2097 ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_createA,
2098          (const char *name))
2099 ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_createW,
2100          (const wchar_t *name))
2101 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2102 ITT_STUB(ITTAPI, __itt_string_handle *, string_handle_create,
2103          (const char *name))
2104 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2105 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2106 #define __itt_string_handle_createA ITTNOTIFY_DATA(string_handle_createA)
2107 #define __itt_string_handle_createA_ptr ITTNOTIFY_NAME(string_handle_createA)
2108 #define __itt_string_handle_createW ITTNOTIFY_DATA(string_handle_createW)
2109 #define __itt_string_handle_createW_ptr ITTNOTIFY_NAME(string_handle_createW)
2110 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2111 #define __itt_string_handle_create ITTNOTIFY_DATA(string_handle_create)
2112 #define __itt_string_handle_create_ptr ITTNOTIFY_NAME(string_handle_create)
2113 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2114 #else /* INTEL_NO_ITTNOTIFY_API */
2115 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2116 #define __itt_string_handle_createA(name) (__itt_string_handle *)0
2117 #define __itt_string_handle_createA_ptr 0
2118 #define __itt_string_handle_createW(name) (__itt_string_handle *)0
2119 #define __itt_string_handle_createW_ptr 0
2120 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2121 #define __itt_string_handle_create(name) (__itt_string_handle *)0
2122 #define __itt_string_handle_create_ptr 0
2123 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2124 #endif /* INTEL_NO_ITTNOTIFY_API */
2125 #else /* INTEL_NO_MACRO_BODY */
2126 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2127 #define __itt_string_handle_createA_ptr 0
2128 #define __itt_string_handle_createW_ptr 0
2129 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2130 #define __itt_string_handle_create_ptr 0
2131 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2132 #endif /* INTEL_NO_MACRO_BODY */
2133 /** @endcond */
2134 /** @} handles group */
2135 
2136 /** @cond exclude_from_documentation */
2137 typedef unsigned long long __itt_timestamp;
2138 /** @endcond */
2139 
2140 #define __itt_timestamp_none ((__itt_timestamp)-1LL)
2141 
2142 /** @cond exclude_from_gpa_documentation */
2143 
2144 /**
2145  * @ingroup timestamps
2146  * @brief Return timestamp corresponding to the current moment.
2147  * This returns the timestamp in the format that is the most relevant for the
2148  * current host or platform (RDTSC, QPC, and others). You can use the "<"
2149  * operator to compare __itt_timestamp values.
2150  */
2151 __itt_timestamp ITTAPI __itt_get_timestamp(void);
2152 
2153 /** @cond exclude_from_documentation */
2154 #ifndef INTEL_NO_MACRO_BODY
2155 #ifndef INTEL_NO_ITTNOTIFY_API
2156 ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void))
2157 #define __itt_get_timestamp ITTNOTIFY_DATA(get_timestamp)
2158 #define __itt_get_timestamp_ptr ITTNOTIFY_NAME(get_timestamp)
2159 #else /* INTEL_NO_ITTNOTIFY_API */
2160 #define __itt_get_timestamp()
2161 #define __itt_get_timestamp_ptr 0
2162 #endif /* INTEL_NO_ITTNOTIFY_API */
2163 #else /* INTEL_NO_MACRO_BODY */
2164 #define __itt_get_timestamp_ptr 0
2165 #endif /* INTEL_NO_MACRO_BODY */
2166 /** @endcond */
2167 /** @} timestamps */
2168 /** @endcond */
2169 
2170 /** @cond exclude_from_gpa_documentation */
2171 
2172 /**
2173  * @defgroup regions Regions
2174  * @ingroup public
2175  * Regions group
2176  * @{
2177  */
2178 /**
2179  * @ingroup regions
2180  * @brief Begin of region instance.
2181  * Successive calls to __itt_region_begin with the same ID are ignored
2182  * until a call to __itt_region_end with the same ID
2183  * @param[in] domain The domain for this region instance
2184  * @param[in] id The instance ID for this region instance. Must not be
2185  * __itt_null
2186  * @param[in] parentid The instance ID for the parent of this region instance,
2187  * or __itt_null
2188  * @param[in] name The name of this region
2189  */
2190 void ITTAPI __itt_region_begin(const __itt_domain *domain, __itt_id id,
2191                                __itt_id parentid, __itt_string_handle *name);
2192 
2193 /**
2194  * @ingroup regions
2195  * @brief End of region instance.
2196  * The first call to __itt_region_end with a given ID ends the
2197  * region. Successive calls with the same ID are ignored, as are
2198  * calls that do not have a matching __itt_region_begin call.
2199  * @param[in] domain The domain for this region instance
2200  * @param[in] id The instance ID for this region instance
2201  */
2202 void ITTAPI __itt_region_end(const __itt_domain *domain, __itt_id id);
2203 
2204 /** @cond exclude_from_documentation */
2205 #ifndef INTEL_NO_MACRO_BODY
2206 #ifndef INTEL_NO_ITTNOTIFY_API
2207 ITT_STUBV(ITTAPI, void, region_begin,
2208           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2209            __itt_string_handle *name))
2210 ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id))
2211 #define __itt_region_begin(d, x, y, z)                                         \
2212   ITTNOTIFY_VOID_D3(region_begin, d, x, y, z)
2213 #define __itt_region_begin_ptr ITTNOTIFY_NAME(region_begin)
2214 #define __itt_region_end(d, x) ITTNOTIFY_VOID_D1(region_end, d, x)
2215 #define __itt_region_end_ptr ITTNOTIFY_NAME(region_end)
2216 #else /* INTEL_NO_ITTNOTIFY_API */
2217 #define __itt_region_begin(d, x, y, z)
2218 #define __itt_region_begin_ptr 0
2219 #define __itt_region_end(d, x)
2220 #define __itt_region_end_ptr 0
2221 #endif /* INTEL_NO_ITTNOTIFY_API */
2222 #else /* INTEL_NO_MACRO_BODY */
2223 #define __itt_region_begin_ptr 0
2224 #define __itt_region_end_ptr 0
2225 #endif /* INTEL_NO_MACRO_BODY */
2226 /** @endcond */
2227 /** @} regions group */
2228 
2229 /**
2230  * @defgroup frames Frames
2231  * @ingroup public
2232  * Frames are similar to regions, but are intended to be easier to use and to
2233  * implement. In particular:
2234  * - Frames always represent periods of elapsed time
2235  * - By default, frames have no nesting relationships
2236  * @{
2237  */
2238 
2239 /**
2240  * @ingroup frames
2241  * @brief Begin a frame instance.
2242  * Successive calls to __itt_frame_begin with the
2243  * same ID are ignored until a call to __itt_frame_end with the same ID.
2244  * @param[in] domain The domain for this frame instance
2245  * @param[in] id The instance ID for this frame instance or NULL
2246  */
2247 void ITTAPI __itt_frame_begin_v3(const __itt_domain *domain, __itt_id *id);
2248 
2249 /**
2250  * @ingroup frames
2251  * @brief End a frame instance.
2252  * The first call to __itt_frame_end with a given ID
2253  * ends the frame. Successive calls with the same ID are ignored, as are
2254  * calls that do not have a matching __itt_frame_begin call.
2255  * @param[in] domain The domain for this frame instance
2256  * @param[in] id The instance ID for this frame instance or NULL for current
2257  */
2258 void ITTAPI __itt_frame_end_v3(const __itt_domain *domain, __itt_id *id);
2259 
2260 /**
2261  * @ingroup frames
2262  * @brief Submits a frame instance.
2263  * Successive calls to __itt_frame_begin or __itt_frame_submit with the
2264  * same ID are ignored until a call to __itt_frame_end or __itt_frame_submit
2265  * with the same ID.
2266  * Passing special __itt_timestamp_none value as "end" argument means
2267  * take the current timestamp as the end timestamp.
2268  * @param[in] domain The domain for this frame instance
2269  * @param[in] id The instance ID for this frame instance or NULL
2270  * @param[in] begin Timestamp of the beginning of the frame
2271  * @param[in] end Timestamp of the end of the frame
2272  */
2273 void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id,
2274                                   __itt_timestamp begin, __itt_timestamp end);
2275 
2276 /** @cond exclude_from_documentation */
2277 #ifndef INTEL_NO_MACRO_BODY
2278 #ifndef INTEL_NO_ITTNOTIFY_API
2279 ITT_STUBV(ITTAPI, void, frame_begin_v3,
2280           (const __itt_domain *domain, __itt_id *id))
2281 ITT_STUBV(ITTAPI, void, frame_end_v3,
2282           (const __itt_domain *domain, __itt_id *id))
2283 ITT_STUBV(ITTAPI, void, frame_submit_v3,
2284           (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin,
2285            __itt_timestamp end))
2286 #define __itt_frame_begin_v3(d, x) ITTNOTIFY_VOID_D1(frame_begin_v3, d, x)
2287 #define __itt_frame_begin_v3_ptr ITTNOTIFY_NAME(frame_begin_v3)
2288 #define __itt_frame_end_v3(d, x) ITTNOTIFY_VOID_D1(frame_end_v3, d, x)
2289 #define __itt_frame_end_v3_ptr ITTNOTIFY_NAME(frame_end_v3)
2290 #define __itt_frame_submit_v3(d, x, b, e)                                      \
2291   ITTNOTIFY_VOID_D3(frame_submit_v3, d, x, b, e)
2292 #define __itt_frame_submit_v3_ptr ITTNOTIFY_NAME(frame_submit_v3)
2293 #else /* INTEL_NO_ITTNOTIFY_API */
2294 #define __itt_frame_begin_v3(domain, id)
2295 #define __itt_frame_begin_v3_ptr 0
2296 #define __itt_frame_end_v3(domain, id)
2297 #define __itt_frame_end_v3_ptr 0
2298 #define __itt_frame_submit_v3(domain, id, begin, end)
2299 #define __itt_frame_submit_v3_ptr 0
2300 #endif /* INTEL_NO_ITTNOTIFY_API */
2301 #else /* INTEL_NO_MACRO_BODY */
2302 #define __itt_frame_begin_v3_ptr 0
2303 #define __itt_frame_end_v3_ptr 0
2304 #define __itt_frame_submit_v3_ptr 0
2305 #endif /* INTEL_NO_MACRO_BODY */
2306 /** @endcond */
2307 /** @} frames group */
2308 /** @endcond */
2309 
2310 /**
2311  * @defgroup taskgroup Task Group
2312  * @ingroup public
2313  * Task Group
2314  * @{
2315  */
2316 /**
2317  * @ingroup task_groups
2318  * @brief Denotes a task_group instance.
2319  * Successive calls to __itt_task_group with the same ID are ignored.
2320  * @param[in] domain The domain for this task_group instance
2321  * @param[in] id The instance ID for this task_group instance. Must not be
2322  * __itt_null.
2323  * @param[in] parentid The instance ID for the parent of this task_group
2324  * instance, or __itt_null.
2325  * @param[in] name The name of this task_group
2326  */
2327 void ITTAPI __itt_task_group(const __itt_domain *domain, __itt_id id,
2328                              __itt_id parentid, __itt_string_handle *name);
2329 
2330 /** @cond exclude_from_documentation */
2331 #ifndef INTEL_NO_MACRO_BODY
2332 #ifndef INTEL_NO_ITTNOTIFY_API
2333 ITT_STUBV(ITTAPI, void, task_group,
2334           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2335            __itt_string_handle *name))
2336 #define __itt_task_group(d, x, y, z) ITTNOTIFY_VOID_D3(task_group, d, x, y, z)
2337 #define __itt_task_group_ptr ITTNOTIFY_NAME(task_group)
2338 #else /* INTEL_NO_ITTNOTIFY_API */
2339 #define __itt_task_group(d, x, y, z)
2340 #define __itt_task_group_ptr 0
2341 #endif /* INTEL_NO_ITTNOTIFY_API */
2342 #else /* INTEL_NO_MACRO_BODY */
2343 #define __itt_task_group_ptr 0
2344 #endif /* INTEL_NO_MACRO_BODY */
2345 /** @endcond */
2346 /** @} taskgroup group */
2347 
2348 /**
2349  * @defgroup tasks Tasks
2350  * @ingroup public
2351  * A task instance represents a piece of work performed by a particular
2352  * thread for a period of time. A call to __itt_task_begin creates a
2353  * task instance. This becomes the current instance for that task on that
2354  * thread. A following call to __itt_task_end on the same thread ends the
2355  * instance. There may be multiple simultaneous instances of tasks with the
2356  * same name on different threads. If an ID is specified, the task instance
2357  * receives that ID. Nested tasks are allowed.
2358  *
2359  * Note: The task is defined by the bracketing of __itt_task_begin and
2360  * __itt_task_end on the same thread. If some scheduling mechanism causes
2361  * task switching (the thread executes a different user task) or task
2362  * switching (the user task switches to a different thread) then this breaks
2363  * the notion of  current instance. Additional API calls are required to
2364  * deal with that possibility.
2365  * @{
2366  */
2367 
2368 /**
2369  * @ingroup tasks
2370  * @brief Begin a task instance.
2371  * @param[in] domain The domain for this task
2372  * @param[in] taskid The instance ID for this task instance, or __itt_null
2373  * @param[in] parentid The parent instance to which this task instance belongs,
2374  * or __itt_null
2375  * @param[in] name The name of this task
2376  */
2377 void ITTAPI __itt_task_begin(const __itt_domain *domain, __itt_id taskid,
2378                              __itt_id parentid, __itt_string_handle *name);
2379 
2380 /**
2381  * @ingroup tasks
2382  * @brief Begin a task instance.
2383  * @param[in] domain The domain for this task
2384  * @param[in] taskid The identifier for this task instance (may be 0)
2385  * @param[in] parentid The parent of this task (may be 0)
2386  * @param[in] fn The pointer to the function you are tracing
2387  */
2388 void ITTAPI __itt_task_begin_fn(const __itt_domain *domain, __itt_id taskid,
2389                                 __itt_id parentid, void *fn);
2390 
2391 /**
2392  * @ingroup tasks
2393  * @brief End the current task instance.
2394  * @param[in] domain The domain for this task
2395  */
2396 void ITTAPI __itt_task_end(const __itt_domain *domain);
2397 
2398 /**
2399  * @ingroup tasks
2400  * @brief Begin an overlapped task instance.
2401  * @param[in] domain The domain for this task.
2402  * @param[in] taskid The identifier for this task instance, *cannot* be
2403  * __itt_null.
2404  * @param[in] parentid The parent of this task, or __itt_null.
2405  * @param[in] name The name of this task.
2406  */
2407 void ITTAPI __itt_task_begin_overlapped(const __itt_domain *domain,
2408                                         __itt_id taskid, __itt_id parentid,
2409                                         __itt_string_handle *name);
2410 
2411 /**
2412  * @ingroup tasks
2413  * @brief End an overlapped task instance.
2414  * @param[in] domain The domain for this task
2415  * @param[in] taskid Explicit ID of finished task
2416  */
2417 void ITTAPI __itt_task_end_overlapped(const __itt_domain *domain,
2418                                       __itt_id taskid);
2419 
2420 /** @cond exclude_from_documentation */
2421 #ifndef INTEL_NO_MACRO_BODY
2422 #ifndef INTEL_NO_ITTNOTIFY_API
2423 ITT_STUBV(ITTAPI, void, task_begin,
2424           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2425            __itt_string_handle *name))
2426 ITT_STUBV(ITTAPI, void, task_begin_fn,
2427           (const __itt_domain *domain, __itt_id id, __itt_id parentid,
2428            void *fn))
2429 ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain))
2430 ITT_STUBV(ITTAPI, void, task_begin_overlapped,
2431           (const __itt_domain *domain, __itt_id taskid, __itt_id parentid,
2432            __itt_string_handle *name))
2433 ITT_STUBV(ITTAPI, void, task_end_overlapped,
2434           (const __itt_domain *domain, __itt_id taskid))
2435 #define __itt_task_begin(d, x, y, z) ITTNOTIFY_VOID_D3(task_begin, d, x, y, z)
2436 #define __itt_task_begin_ptr ITTNOTIFY_NAME(task_begin)
2437 #define __itt_task_begin_fn(d, x, y, z)                                        \
2438   ITTNOTIFY_VOID_D3(task_begin_fn, d, x, y, z)
2439 #define __itt_task_begin_fn_ptr ITTNOTIFY_NAME(task_begin_fn)
2440 #define __itt_task_end(d) ITTNOTIFY_VOID_D0(task_end, d)
2441 #define __itt_task_end_ptr ITTNOTIFY_NAME(task_end)
2442 #define __itt_task_begin_overlapped(d, x, y, z)                                \
2443   ITTNOTIFY_VOID_D3(task_begin_overlapped, d, x, y, z)
2444 #define __itt_task_begin_overlapped_ptr ITTNOTIFY_NAME(task_begin_overlapped)
2445 #define __itt_task_end_overlapped(d, x)                                        \
2446   ITTNOTIFY_VOID_D1(task_end_overlapped, d, x)
2447 #define __itt_task_end_overlapped_ptr ITTNOTIFY_NAME(task_end_overlapped)
2448 #else /* INTEL_NO_ITTNOTIFY_API */
2449 #define __itt_task_begin(domain, id, parentid, name)
2450 #define __itt_task_begin_ptr 0
2451 #define __itt_task_begin_fn(domain, id, parentid, fn)
2452 #define __itt_task_begin_fn_ptr 0
2453 #define __itt_task_end(domain)
2454 #define __itt_task_end_ptr 0
2455 #define __itt_task_begin_overlapped(domain, taskid, parentid, name)
2456 #define __itt_task_begin_overlapped_ptr 0
2457 #define __itt_task_end_overlapped(domain, taskid)
2458 #define __itt_task_end_overlapped_ptr 0
2459 #endif /* INTEL_NO_ITTNOTIFY_API */
2460 #else /* INTEL_NO_MACRO_BODY */
2461 #define __itt_task_begin_ptr 0
2462 #define __itt_task_begin_fn_ptr 0
2463 #define __itt_task_end_ptr 0
2464 #define __itt_task_begin_overlapped_ptr 0
2465 #define __itt_task_end_overlapped_ptr 0
2466 #endif /* INTEL_NO_MACRO_BODY */
2467 /** @endcond */
2468 /** @} tasks group */
2469 
2470 /**
2471  * @defgroup markers Markers
2472  * Markers represent a single discreet event in time. Markers have a scope,
2473  * described by an enumerated type __itt_scope. Markers are created by
2474  * the API call __itt_marker. A marker instance can be given an ID for use in
2475  * adding metadata.
2476  * @{
2477  */
2478 
2479 /**
2480  * @brief Describes the scope of an event object in the trace.
2481  */
2482 typedef enum {
2483   __itt_scope_unknown = 0,
2484   __itt_scope_global,
2485   __itt_scope_track_group,
2486   __itt_scope_track,
2487   __itt_scope_task,
2488   __itt_scope_marker
2489 } __itt_scope;
2490 
2491 /** @cond exclude_from_documentation */
2492 #define __itt_marker_scope_unknown __itt_scope_unknown
2493 #define __itt_marker_scope_global __itt_scope_global
2494 #define __itt_marker_scope_process __itt_scope_track_group
2495 #define __itt_marker_scope_thread __itt_scope_track
2496 #define __itt_marker_scope_task __itt_scope_task
2497 /** @endcond */
2498 
2499 /**
2500  * @ingroup markers
2501  * @brief Create a marker instance
2502  * @param[in] domain The domain for this marker
2503  * @param[in] id The instance ID for this marker or __itt_null
2504  * @param[in] name The name for this marker
2505  * @param[in] scope The scope for this marker
2506  */
2507 void ITTAPI __itt_marker(const __itt_domain *domain, __itt_id id,
2508                          __itt_string_handle *name, __itt_scope scope);
2509 
2510 /** @cond exclude_from_documentation */
2511 #ifndef INTEL_NO_MACRO_BODY
2512 #ifndef INTEL_NO_ITTNOTIFY_API
2513 ITT_STUBV(ITTAPI, void, marker,
2514           (const __itt_domain *domain, __itt_id id, __itt_string_handle *name,
2515            __itt_scope scope))
2516 #define __itt_marker(d, x, y, z) ITTNOTIFY_VOID_D3(marker, d, x, y, z)
2517 #define __itt_marker_ptr ITTNOTIFY_NAME(marker)
2518 #else /* INTEL_NO_ITTNOTIFY_API */
2519 #define __itt_marker(domain, id, name, scope)
2520 #define __itt_marker_ptr 0
2521 #endif /* INTEL_NO_ITTNOTIFY_API */
2522 #else /* INTEL_NO_MACRO_BODY */
2523 #define __itt_marker_ptr 0
2524 #endif /* INTEL_NO_MACRO_BODY */
2525 /** @endcond */
2526 /** @} markers group */
2527 
2528 /**
2529  * @defgroup metadata Metadata
2530  * The metadata API is used to attach extra information to named
2531  * entities. Metadata can be attached to an identified named entity by ID,
2532  * or to the current entity (which is always a task).
2533  *
2534  * Conceptually metadata has a type (what kind of metadata), a key (the
2535  * name of the metadata), and a value (the actual data). The encoding of
2536  * the value depends on the type of the metadata.
2537  *
2538  * The type of metadata is specified by an enumerated type __itt_metdata_type.
2539  * @{
2540  */
2541 
2542 /**
2543  * @ingroup parameters
2544  * @brief describes the type of metadata
2545  */
2546 typedef enum {
2547   __itt_metadata_unknown = 0,
2548   __itt_metadata_u64, /**< Unsigned 64-bit integer */
2549   __itt_metadata_s64, /**< Signed 64-bit integer */
2550   __itt_metadata_u32, /**< Unsigned 32-bit integer */
2551   __itt_metadata_s32, /**< Signed 32-bit integer */
2552   __itt_metadata_u16, /**< Unsigned 16-bit integer */
2553   __itt_metadata_s16, /**< Signed 16-bit integer */
2554   __itt_metadata_float, /**< Signed 32-bit floating-point */
2555   __itt_metadata_double /**< SIgned 64-bit floating-point */
2556 } __itt_metadata_type;
2557 
2558 /**
2559  * @ingroup parameters
2560  * @brief Add metadata to an instance of a named entity.
2561  * @param[in] domain The domain controlling the call
2562  * @param[in] id The identifier of the instance to which the metadata is to be
2563  * added, or __itt_null to add to the current task
2564  * @param[in] key The name of the metadata
2565  * @param[in] type The type of the metadata
2566  * @param[in] count The number of elements of the given type. If count == 0, no
2567  * metadata will be added.
2568  * @param[in] data The metadata itself
2569  */
2570 void ITTAPI __itt_metadata_add(const __itt_domain *domain, __itt_id id,
2571                                __itt_string_handle *key,
2572                                __itt_metadata_type type, size_t count,
2573                                void *data);
2574 
2575 /** @cond exclude_from_documentation */
2576 #ifndef INTEL_NO_MACRO_BODY
2577 #ifndef INTEL_NO_ITTNOTIFY_API
2578 ITT_STUBV(ITTAPI, void, metadata_add,
2579           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2580            __itt_metadata_type type, size_t count, void *data))
2581 #define __itt_metadata_add(d, x, y, z, a, b)                                   \
2582   ITTNOTIFY_VOID_D5(metadata_add, d, x, y, z, a, b)
2583 #define __itt_metadata_add_ptr ITTNOTIFY_NAME(metadata_add)
2584 #else /* INTEL_NO_ITTNOTIFY_API */
2585 #define __itt_metadata_add(d, x, y, z, a, b)
2586 #define __itt_metadata_add_ptr 0
2587 #endif /* INTEL_NO_ITTNOTIFY_API */
2588 #else /* INTEL_NO_MACRO_BODY */
2589 #define __itt_metadata_add_ptr 0
2590 #endif /* INTEL_NO_MACRO_BODY */
2591 /** @endcond */
2592 
2593 /**
2594  * @ingroup parameters
2595  * @brief Add string metadata to an instance of a named entity.
2596  * @param[in] domain The domain controlling the call
2597  * @param[in] id The identifier of the instance to which the metadata is to be
2598  * added, or __itt_null to add to the current task
2599  * @param[in] key The name of the metadata
2600  * @param[in] data The metadata itself
2601  * @param[in] length The number of characters in the string, or -1 if the length
2602  * is unknown but the string is null-terminated
2603  */
2604 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2605 void ITTAPI __itt_metadata_str_addA(const __itt_domain *domain, __itt_id id,
2606                                     __itt_string_handle *key, const char *data,
2607                                     size_t length);
2608 void ITTAPI __itt_metadata_str_addW(const __itt_domain *domain, __itt_id id,
2609                                     __itt_string_handle *key,
2610                                     const wchar_t *data, size_t length);
2611 #if defined(UNICODE) || defined(_UNICODE)
2612 #define __itt_metadata_str_add __itt_metadata_str_addW
2613 #define __itt_metadata_str_add_ptr __itt_metadata_str_addW_ptr
2614 #else /* UNICODE */
2615 #define __itt_metadata_str_add __itt_metadata_str_addA
2616 #define __itt_metadata_str_add_ptr __itt_metadata_str_addA_ptr
2617 #endif /* UNICODE */
2618 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2619 void ITTAPI __itt_metadata_str_add(const __itt_domain *domain, __itt_id id,
2620                                    __itt_string_handle *key, const char *data,
2621                                    size_t length);
2622 #endif
2623 
2624 /** @cond exclude_from_documentation */
2625 #ifndef INTEL_NO_MACRO_BODY
2626 #ifndef INTEL_NO_ITTNOTIFY_API
2627 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2628 ITT_STUBV(ITTAPI, void, metadata_str_addA,
2629           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2630            const char *data, size_t length))
2631 ITT_STUBV(ITTAPI, void, metadata_str_addW,
2632           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2633            const wchar_t *data, size_t length))
2634 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2635 ITT_STUBV(ITTAPI, void, metadata_str_add,
2636           (const __itt_domain *domain, __itt_id id, __itt_string_handle *key,
2637            const char *data, size_t length))
2638 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2639 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2640 #define __itt_metadata_str_addA(d, x, y, z, a)                                 \
2641   ITTNOTIFY_VOID_D4(metadata_str_addA, d, x, y, z, a)
2642 #define __itt_metadata_str_addA_ptr ITTNOTIFY_NAME(metadata_str_addA)
2643 #define __itt_metadata_str_addW(d, x, y, z, a)                                 \
2644   ITTNOTIFY_VOID_D4(metadata_str_addW, d, x, y, z, a)
2645 #define __itt_metadata_str_addW_ptr ITTNOTIFY_NAME(metadata_str_addW)
2646 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2647 #define __itt_metadata_str_add(d, x, y, z, a)                                  \
2648   ITTNOTIFY_VOID_D4(metadata_str_add, d, x, y, z, a)
2649 #define __itt_metadata_str_add_ptr ITTNOTIFY_NAME(metadata_str_add)
2650 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2651 #else /* INTEL_NO_ITTNOTIFY_API */
2652 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2653 #define __itt_metadata_str_addA(d, x, y, z, a)
2654 #define __itt_metadata_str_addA_ptr 0
2655 #define __itt_metadata_str_addW(d, x, y, z, a)
2656 #define __itt_metadata_str_addW_ptr 0
2657 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2658 #define __itt_metadata_str_add(d, x, y, z, a)
2659 #define __itt_metadata_str_add_ptr 0
2660 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2661 #endif /* INTEL_NO_ITTNOTIFY_API */
2662 #else /* INTEL_NO_MACRO_BODY */
2663 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2664 #define __itt_metadata_str_addA_ptr 0
2665 #define __itt_metadata_str_addW_ptr 0
2666 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2667 #define __itt_metadata_str_add_ptr 0
2668 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2669 #endif /* INTEL_NO_MACRO_BODY */
2670 /** @endcond */
2671 
2672 /**
2673  * @ingroup parameters
2674  * @brief Add metadata to an instance of a named entity.
2675  * @param[in] domain The domain controlling the call
2676  * @param[in] scope The scope of the instance to which the metadata is to be
2677  added
2678 
2679  * @param[in] id The identifier of the instance to which the metadata is to be
2680  added, or __itt_null to add to the current task
2681 
2682  * @param[in] key The name of the metadata
2683  * @param[in] type The type of the metadata
2684  * @param[in] count The number of elements of the given type. If count == 0, no
2685  metadata will be added.
2686  * @param[in] data The metadata itself
2687 */
2688 void ITTAPI __itt_metadata_add_with_scope(const __itt_domain *domain,
2689                                           __itt_scope scope,
2690                                           __itt_string_handle *key,
2691                                           __itt_metadata_type type,
2692                                           size_t count, void *data);
2693 
2694 /** @cond exclude_from_documentation */
2695 #ifndef INTEL_NO_MACRO_BODY
2696 #ifndef INTEL_NO_ITTNOTIFY_API
2697 ITT_STUBV(ITTAPI, void, metadata_add_with_scope,
2698           (const __itt_domain *domain, __itt_scope scope,
2699            __itt_string_handle *key, __itt_metadata_type type, size_t count,
2700            void *data))
2701 #define __itt_metadata_add_with_scope(d, x, y, z, a, b)                        \
2702   ITTNOTIFY_VOID_D5(metadata_add_with_scope, d, x, y, z, a, b)
2703 #define __itt_metadata_add_with_scope_ptr                                      \
2704   ITTNOTIFY_NAME(metadata_add_with_scope)
2705 #else /* INTEL_NO_ITTNOTIFY_API */
2706 #define __itt_metadata_add_with_scope(d, x, y, z, a, b)
2707 #define __itt_metadata_add_with_scope_ptr 0
2708 #endif /* INTEL_NO_ITTNOTIFY_API */
2709 #else /* INTEL_NO_MACRO_BODY */
2710 #define __itt_metadata_add_with_scope_ptr 0
2711 #endif /* INTEL_NO_MACRO_BODY */
2712 /** @endcond */
2713 
2714 /**
2715  * @ingroup parameters
2716  * @brief Add string metadata to an instance of a named entity.
2717  * @param[in] domain The domain controlling the call
2718  * @param[in] scope The scope of the instance to which the metadata is to be
2719  added
2720 
2721  * @param[in] id The identifier of the instance to which the metadata is to be
2722  added, or __itt_null to add to the current task
2723 
2724  * @param[in] key The name of the metadata
2725  * @param[in] data The metadata itself
2726  * @param[in] length The number of characters in the string, or -1 if the length
2727  is unknown but the string is null-terminated
2728 */
2729 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2730 void ITTAPI __itt_metadata_str_add_with_scopeA(const __itt_domain *domain,
2731                                                __itt_scope scope,
2732                                                __itt_string_handle *key,
2733                                                const char *data, size_t length);
2734 void ITTAPI __itt_metadata_str_add_with_scopeW(const __itt_domain *domain,
2735                                                __itt_scope scope,
2736                                                __itt_string_handle *key,
2737                                                const wchar_t *data,
2738                                                size_t length);
2739 #if defined(UNICODE) || defined(_UNICODE)
2740 #define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeW
2741 #define __itt_metadata_str_add_with_scope_ptr                                  \
2742   __itt_metadata_str_add_with_scopeW_ptr
2743 #else /* UNICODE */
2744 #define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeA
2745 #define __itt_metadata_str_add_with_scope_ptr                                  \
2746   __itt_metadata_str_add_with_scopeA_ptr
2747 #endif /* UNICODE */
2748 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2749 void ITTAPI __itt_metadata_str_add_with_scope(const __itt_domain *domain,
2750                                               __itt_scope scope,
2751                                               __itt_string_handle *key,
2752                                               const char *data, size_t length);
2753 #endif
2754 
2755 /** @cond exclude_from_documentation */
2756 #ifndef INTEL_NO_MACRO_BODY
2757 #ifndef INTEL_NO_ITTNOTIFY_API
2758 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2759 ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA,
2760           (const __itt_domain *domain, __itt_scope scope,
2761            __itt_string_handle *key, const char *data, size_t length))
2762 ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW,
2763           (const __itt_domain *domain, __itt_scope scope,
2764            __itt_string_handle *key, const wchar_t *data, size_t length))
2765 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2766 ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope,
2767           (const __itt_domain *domain, __itt_scope scope,
2768            __itt_string_handle *key, const char *data, size_t length))
2769 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2770 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2771 #define __itt_metadata_str_add_with_scopeA(d, x, y, z, a)                      \
2772   ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeA, d, x, y, z, a)
2773 #define __itt_metadata_str_add_with_scopeA_ptr                                 \
2774   ITTNOTIFY_NAME(metadata_str_add_with_scopeA)
2775 #define __itt_metadata_str_add_with_scopeW(d, x, y, z, a)                      \
2776   ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeW, d, x, y, z, a)
2777 #define __itt_metadata_str_add_with_scopeW_ptr                                 \
2778   ITTNOTIFY_NAME(metadata_str_add_with_scopeW)
2779 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2780 #define __itt_metadata_str_add_with_scope(d, x, y, z, a)                       \
2781   ITTNOTIFY_VOID_D4(metadata_str_add_with_scope, d, x, y, z, a)
2782 #define __itt_metadata_str_add_with_scope_ptr                                  \
2783   ITTNOTIFY_NAME(metadata_str_add_with_scope)
2784 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2785 #else /* INTEL_NO_ITTNOTIFY_API */
2786 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2787 #define __itt_metadata_str_add_with_scopeA(d, x, y, z, a)
2788 #define __itt_metadata_str_add_with_scopeA_ptr 0
2789 #define __itt_metadata_str_add_with_scopeW(d, x, y, z, a)
2790 #define __itt_metadata_str_add_with_scopeW_ptr 0
2791 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2792 #define __itt_metadata_str_add_with_scope(d, x, y, z, a)
2793 #define __itt_metadata_str_add_with_scope_ptr 0
2794 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2795 #endif /* INTEL_NO_ITTNOTIFY_API */
2796 #else /* INTEL_NO_MACRO_BODY */
2797 #if ITT_PLATFORM == ITT_PLATFORM_WIN
2798 #define __itt_metadata_str_add_with_scopeA_ptr 0
2799 #define __itt_metadata_str_add_with_scopeW_ptr 0
2800 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2801 #define __itt_metadata_str_add_with_scope_ptr 0
2802 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2803 #endif /* INTEL_NO_MACRO_BODY */
2804 /** @endcond */
2805 
2806 /** @} metadata group */
2807 
2808 /**
2809  * @defgroup relations Relations
2810  * Instances of named entities can be explicitly associated with other
2811  * instances using instance IDs and the relationship API calls.
2812  *
2813  * @{
2814  */
2815 
2816 /**
2817  * @ingroup relations
2818  * @brief The kind of relation between two instances is specified by the
2819  * enumerated type __itt_relation. Relations between instances can be added with
2820  * an API call. The relation API uses instance IDs. Relations can be added
2821  * before or after the actual instances are created and persist independently of
2822  * the instances. This is the motivation for having different lifetimes for
2823  * instance IDs and the actual instances.
2824  */
2825 typedef enum {
2826   __itt_relation_is_unknown = 0,
2827   __itt_relation_is_dependent_on, /**< "A is dependent on B" means that A cannot
2828                                      start until B completes */
2829   __itt_relation_is_sibling_of, /**< "A is sibling of B" means that A and B were
2830                                    created as a group */
2831   __itt_relation_is_parent_of, /**< "A is parent of B" means that A created B */
2832   __itt_relation_is_continuation_of, /**< "A is continuation of B" means that A
2833                                         assumes the dependencies of B */
2834   __itt_relation_is_child_of, /**< "A is child of B" means that A was created by
2835                                  B (inverse of is_parent_of) */
2836   __itt_relation_is_continued_by, /**< "A is continued by B" means that B
2837                                      assumes the dependencies of A (inverse of
2838                                      is_continuation_of) */
2839   __itt_relation_is_predecessor_to /**< "A is predecessor to B" means that B
2840                                       cannot start until A completes (inverse of
2841                                       is_dependent_on) */
2842 } __itt_relation;
2843 
2844 /**
2845  * @ingroup relations
2846  * @brief Add a relation to the current task instance.
2847  * The current task instance is the head of the relation.
2848  * @param[in] domain The domain controlling this call
2849  * @param[in] relation The kind of relation
2850  * @param[in] tail The ID for the tail of the relation
2851  */
2852 void ITTAPI __itt_relation_add_to_current(const __itt_domain *domain,
2853                                           __itt_relation relation,
2854                                           __itt_id tail);
2855 
2856 /**
2857  * @ingroup relations
2858  * @brief Add a relation between two instance identifiers.
2859  * @param[in] domain The domain controlling this call
2860  * @param[in] head The ID for the head of the relation
2861  * @param[in] relation The kind of relation
2862  * @param[in] tail The ID for the tail of the relation
2863  */
2864 void ITTAPI __itt_relation_add(const __itt_domain *domain, __itt_id head,
2865                                __itt_relation relation, __itt_id tail);
2866 
2867 /** @cond exclude_from_documentation */
2868 #ifndef INTEL_NO_MACRO_BODY
2869 #ifndef INTEL_NO_ITTNOTIFY_API
2870 ITT_STUBV(ITTAPI, void, relation_add_to_current,
2871           (const __itt_domain *domain, __itt_relation relation, __itt_id tail))
2872 ITT_STUBV(ITTAPI, void, relation_add,
2873           (const __itt_domain *domain, __itt_id head, __itt_relation relation,
2874            __itt_id tail))
2875 #define __itt_relation_add_to_current(d, x, y)                                 \
2876   ITTNOTIFY_VOID_D2(relation_add_to_current, d, x, y)
2877 #define __itt_relation_add_to_current_ptr                                      \
2878   ITTNOTIFY_NAME(relation_add_to_current)
2879 #define __itt_relation_add(d, x, y, z)                                         \
2880   ITTNOTIFY_VOID_D3(relation_add, d, x, y, z)
2881 #define __itt_relation_add_ptr ITTNOTIFY_NAME(relation_add)
2882 #else /* INTEL_NO_ITTNOTIFY_API */
2883 #define __itt_relation_add_to_current(d, x, y)
2884 #define __itt_relation_add_to_current_ptr 0
2885 #define __itt_relation_add(d, x, y, z)
2886 #define __itt_relation_add_ptr 0
2887 #endif /* INTEL_NO_ITTNOTIFY_API */
2888 #else /* INTEL_NO_MACRO_BODY */
2889 #define __itt_relation_add_to_current_ptr 0
2890 #define __itt_relation_add_ptr 0
2891 #endif /* INTEL_NO_MACRO_BODY */
2892 /** @endcond */
2893 /** @} relations group */
2894 
2895 /** @cond exclude_from_documentation */
2896 #pragma pack(push, 8)
2897 
2898 typedef struct ___itt_clock_info {
2899   unsigned long long clock_freq; /*!< Clock domain frequency */
2900   unsigned long long clock_base; /*!< Clock domain base timestamp */
2901 } __itt_clock_info;
2902 
2903 #pragma pack(pop)
2904 /** @endcond */
2905 
2906 /** @cond exclude_from_documentation */
2907 typedef void(ITTAPI *__itt_get_clock_info_fn)(__itt_clock_info *clock_info,
2908                                               void *data);
2909 /** @endcond */
2910 
2911 /** @cond exclude_from_documentation */
2912 #pragma pack(push, 8)
2913 
2914 typedef struct ___itt_clock_domain {
2915   __itt_clock_info info; /*!< Most recent clock domain info */
2916   __itt_get_clock_info_fn fn; /*!< Callback function pointer */
2917   void *fn_data; /*!< Input argument for the callback function */
2918   int extra1; /*!< Reserved. Must be zero */
2919   void *extra2; /*!< Reserved. Must be zero */
2920   struct ___itt_clock_domain *next;
2921 } __itt_clock_domain;
2922 
2923 #pragma pack(pop)
2924 /** @endcond */
2925 
2926 /**
2927  * @ingroup clockdomains
2928  * @brief Create a clock domain.
2929  * Certain applications require the capability to trace their application using
2930  * a clock domain different than the CPU, for instance the instrumentation of
2931  * events that occur on a GPU. Because the set of domains is expected to be
2932  * static over the application's execution time, there is no mechanism to
2933  * destroy a domain. Any domain can be accessed by any thread in the process,
2934  * regardless of which thread created the domain. This call is thread-safe.
2935  * @param[in] fn A pointer to a callback function which retrieves alternative
2936  * CPU timestamps
2937  * @param[in] fn_data Argument for a callback function; may be NULL
2938  */
2939 __itt_clock_domain *ITTAPI __itt_clock_domain_create(__itt_get_clock_info_fn fn,
2940                                                      void *fn_data);
2941 
2942 /** @cond exclude_from_documentation */
2943 #ifndef INTEL_NO_MACRO_BODY
2944 #ifndef INTEL_NO_ITTNOTIFY_API
2945 ITT_STUB(ITTAPI, __itt_clock_domain *, clock_domain_create,
2946          (__itt_get_clock_info_fn fn, void *fn_data))
2947 #define __itt_clock_domain_create ITTNOTIFY_DATA(clock_domain_create)
2948 #define __itt_clock_domain_create_ptr ITTNOTIFY_NAME(clock_domain_create)
2949 #else /* INTEL_NO_ITTNOTIFY_API */
2950 #define __itt_clock_domain_create(fn, fn_data) (__itt_clock_domain *)0
2951 #define __itt_clock_domain_create_ptr 0
2952 #endif /* INTEL_NO_ITTNOTIFY_API */
2953 #else /* INTEL_NO_MACRO_BODY */
2954 #define __itt_clock_domain_create_ptr 0
2955 #endif /* INTEL_NO_MACRO_BODY */
2956 /** @endcond */
2957 
2958 /**
2959  * @ingroup clockdomains
2960  * @brief Recalculate clock domains frequencies and clock base timestamps.
2961  */
2962 void ITTAPI __itt_clock_domain_reset(void);
2963 
2964 /** @cond exclude_from_documentation */
2965 #ifndef INTEL_NO_MACRO_BODY
2966 #ifndef INTEL_NO_ITTNOTIFY_API
2967 ITT_STUBV(ITTAPI, void, clock_domain_reset, (void))
2968 #define __itt_clock_domain_reset ITTNOTIFY_VOID(clock_domain_reset)
2969 #define __itt_clock_domain_reset_ptr ITTNOTIFY_NAME(clock_domain_reset)
2970 #else /* INTEL_NO_ITTNOTIFY_API */
2971 #define __itt_clock_domain_reset()
2972 #define __itt_clock_domain_reset_ptr 0
2973 #endif /* INTEL_NO_ITTNOTIFY_API */
2974 #else /* INTEL_NO_MACRO_BODY */
2975 #define __itt_clock_domain_reset_ptr 0
2976 #endif /* INTEL_NO_MACRO_BODY */
2977 /** @endcond */
2978 
2979 /**
2980  * @ingroup clockdomain
2981  * @brief Create an instance of identifier. This establishes the beginning of
2982  * the lifetime of an instance of the given ID in the trace. Once this lifetime
2983  * starts, the ID can be used to tag named entity instances in calls such as
2984  * __itt_task_begin, and to specify relationships among identified named entity
2985  * instances, using the \ref relations APIs.
2986  * @param[in] domain The domain controlling the execution of this call.
2987  * @param[in] clock_domain The clock domain controlling the execution of this
2988  * call.
2989  * @param[in] timestamp The user defined timestamp.
2990  * @param[in] id The ID to create.
2991  */
2992 void ITTAPI __itt_id_create_ex(const __itt_domain *domain,
2993                                __itt_clock_domain *clock_domain,
2994                                unsigned long long timestamp, __itt_id id);
2995 
2996 /**
2997  * @ingroup clockdomain
2998  * @brief Destroy an instance of identifier. This ends the lifetime of the
2999  * current instance of the given ID value in the trace. Any relationships that
3000  * are established after this lifetime ends are invalid. This call must be
3001  * performed before the given ID value can be reused for a different named
3002  * entity instance.
3003  * @param[in] domain The domain controlling the execution of this call.
3004  * @param[in] clock_domain The clock domain controlling the execution of this
3005  * call.
3006  * @param[in] timestamp The user defined timestamp.
3007  * @param[in] id The ID to destroy.
3008  */
3009 void ITTAPI __itt_id_destroy_ex(const __itt_domain *domain,
3010                                 __itt_clock_domain *clock_domain,
3011                                 unsigned long long timestamp, __itt_id id);
3012 
3013 /** @cond exclude_from_documentation */
3014 #ifndef INTEL_NO_MACRO_BODY
3015 #ifndef INTEL_NO_ITTNOTIFY_API
3016 ITT_STUBV(ITTAPI, void, id_create_ex,
3017           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3018            unsigned long long timestamp, __itt_id id))
3019 ITT_STUBV(ITTAPI, void, id_destroy_ex,
3020           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3021            unsigned long long timestamp, __itt_id id))
3022 #define __itt_id_create_ex(d, x, y, z)                                         \
3023   ITTNOTIFY_VOID_D3(id_create_ex, d, x, y, z)
3024 #define __itt_id_create_ex_ptr ITTNOTIFY_NAME(id_create_ex)
3025 #define __itt_id_destroy_ex(d, x, y, z)                                        \
3026   ITTNOTIFY_VOID_D3(id_destroy_ex, d, x, y, z)
3027 #define __itt_id_destroy_ex_ptr ITTNOTIFY_NAME(id_destroy_ex)
3028 #else /* INTEL_NO_ITTNOTIFY_API */
3029 #define __itt_id_create_ex(domain, clock_domain, timestamp, id)
3030 #define __itt_id_create_ex_ptr 0
3031 #define __itt_id_destroy_ex(domain, clock_domain, timestamp, id)
3032 #define __itt_id_destroy_ex_ptr 0
3033 #endif /* INTEL_NO_ITTNOTIFY_API */
3034 #else /* INTEL_NO_MACRO_BODY */
3035 #define __itt_id_create_ex_ptr 0
3036 #define __itt_id_destroy_ex_ptr 0
3037 #endif /* INTEL_NO_MACRO_BODY */
3038 /** @endcond */
3039 
3040 /**
3041  * @ingroup clockdomain
3042  * @brief Begin a task instance.
3043  * @param[in] domain The domain for this task
3044  * @param[in] clock_domain The clock domain controlling the execution of this
3045  * call.
3046  * @param[in] timestamp The user defined timestamp.
3047  * @param[in] taskid The instance ID for this task instance, or __itt_null
3048  * @param[in] parentid The parent instance to which this task instance belongs,
3049  * or __itt_null
3050  * @param[in] name The name of this task
3051  */
3052 void ITTAPI __itt_task_begin_ex(const __itt_domain *domain,
3053                                 __itt_clock_domain *clock_domain,
3054                                 unsigned long long timestamp, __itt_id taskid,
3055                                 __itt_id parentid, __itt_string_handle *name);
3056 
3057 /**
3058  * @ingroup clockdomain
3059  * @brief Begin a task instance.
3060  * @param[in] domain The domain for this task
3061  * @param[in] clock_domain The clock domain controlling the execution of this
3062  * call.
3063  * @param[in] timestamp The user defined timestamp.
3064  * @param[in] taskid The identifier for this task instance, or __itt_null
3065  * @param[in] parentid The parent of this task, or __itt_null
3066  * @param[in] fn The pointer to the function you are tracing
3067  */
3068 void ITTAPI __itt_task_begin_fn_ex(const __itt_domain *domain,
3069                                    __itt_clock_domain *clock_domain,
3070                                    unsigned long long timestamp,
3071                                    __itt_id taskid, __itt_id parentid,
3072                                    void *fn);
3073 
3074 /**
3075  * @ingroup clockdomain
3076  * @brief End the current task instance.
3077  * @param[in] domain The domain for this task
3078  * @param[in] clock_domain The clock domain controlling the execution of this
3079  * call.
3080  * @param[in] timestamp The user defined timestamp.
3081  */
3082 void ITTAPI __itt_task_end_ex(const __itt_domain *domain,
3083                               __itt_clock_domain *clock_domain,
3084                               unsigned long long timestamp);
3085 
3086 /** @cond exclude_from_documentation */
3087 #ifndef INTEL_NO_MACRO_BODY
3088 #ifndef INTEL_NO_ITTNOTIFY_API
3089 ITT_STUBV(ITTAPI, void, task_begin_ex,
3090           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3091            unsigned long long timestamp, __itt_id id, __itt_id parentid,
3092            __itt_string_handle *name))
3093 ITT_STUBV(ITTAPI, void, task_begin_fn_ex,
3094           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3095            unsigned long long timestamp, __itt_id id, __itt_id parentid,
3096            void *fn))
3097 ITT_STUBV(ITTAPI, void, task_end_ex,
3098           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3099            unsigned long long timestamp))
3100 #define __itt_task_begin_ex(d, x, y, z, a, b)                                  \
3101   ITTNOTIFY_VOID_D5(task_begin_ex, d, x, y, z, a, b)
3102 #define __itt_task_begin_ex_ptr ITTNOTIFY_NAME(task_begin_ex)
3103 #define __itt_task_begin_fn_ex(d, x, y, z, a, b)                               \
3104   ITTNOTIFY_VOID_D5(task_begin_fn_ex, d, x, y, z, a, b)
3105 #define __itt_task_begin_fn_ex_ptr ITTNOTIFY_NAME(task_begin_fn_ex)
3106 #define __itt_task_end_ex(d, x, y) ITTNOTIFY_VOID_D2(task_end_ex, d, x, y)
3107 #define __itt_task_end_ex_ptr ITTNOTIFY_NAME(task_end_ex)
3108 #else /* INTEL_NO_ITTNOTIFY_API */
3109 #define __itt_task_begin_ex(domain, clock_domain, timestamp, id, parentid, name)
3110 #define __itt_task_begin_ex_ptr 0
3111 #define __itt_task_begin_fn_ex(domain, clock_domain, timestamp, id, parentid,  \
3112                                fn)
3113 #define __itt_task_begin_fn_ex_ptr 0
3114 #define __itt_task_end_ex(domain, clock_domain, timestamp)
3115 #define __itt_task_end_ex_ptr 0
3116 #endif /* INTEL_NO_ITTNOTIFY_API */
3117 #else /* INTEL_NO_MACRO_BODY */
3118 #define __itt_task_begin_ex_ptr 0
3119 #define __itt_task_begin_fn_ex_ptr 0
3120 #define __itt_task_end_ex_ptr 0
3121 #endif /* INTEL_NO_MACRO_BODY */
3122 /** @endcond */
3123 
3124 /**
3125  * @defgroup counters Counters
3126  * @ingroup public
3127  * Counters are user-defined objects with a monotonically increasing
3128  * value. Counter values are 64-bit unsigned integers.
3129  * Counters have names that can be displayed in
3130  * the tools.
3131  * @{
3132  */
3133 
3134 /**
3135  * @brief opaque structure for counter identification
3136  */
3137 /** @cond exclude_from_documentation */
3138 
3139 typedef struct ___itt_counter *__itt_counter;
3140 
3141 /**
3142  * @brief Create an unsigned 64 bits integer counter with given name/domain
3143  *
3144  * After __itt_counter_create() is called, __itt_counter_inc(id),
3145  * __itt_counter_inc_delta(id, delta),
3146  * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id,
3147  * clock_domain, timestamp, value_ptr) can be used to change the value of the
3148  * counter, where value_ptr is a pointer to an unsigned 64 bits integer
3149  *
3150  * The call is equal to __itt_counter_create_typed(name, domain,
3151  * __itt_metadata_u64)
3152  */
3153 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3154 __itt_counter ITTAPI __itt_counter_createA(const char *name,
3155                                            const char *domain);
3156 __itt_counter ITTAPI __itt_counter_createW(const wchar_t *name,
3157                                            const wchar_t *domain);
3158 #if defined(UNICODE) || defined(_UNICODE)
3159 #define __itt_counter_create __itt_counter_createW
3160 #define __itt_counter_create_ptr __itt_counter_createW_ptr
3161 #else /* UNICODE */
3162 #define __itt_counter_create __itt_counter_createA
3163 #define __itt_counter_create_ptr __itt_counter_createA_ptr
3164 #endif /* UNICODE */
3165 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3166 __itt_counter ITTAPI __itt_counter_create(const char *name, const char *domain);
3167 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3168 
3169 #ifndef INTEL_NO_MACRO_BODY
3170 #ifndef INTEL_NO_ITTNOTIFY_API
3171 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3172 ITT_STUB(ITTAPI, __itt_counter, counter_createA,
3173          (const char *name, const char *domain))
3174 ITT_STUB(ITTAPI, __itt_counter, counter_createW,
3175          (const wchar_t *name, const wchar_t *domain))
3176 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3177 ITT_STUB(ITTAPI, __itt_counter, counter_create,
3178          (const char *name, const char *domain))
3179 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3180 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3181 #define __itt_counter_createA ITTNOTIFY_DATA(counter_createA)
3182 #define __itt_counter_createA_ptr ITTNOTIFY_NAME(counter_createA)
3183 #define __itt_counter_createW ITTNOTIFY_DATA(counter_createW)
3184 #define __itt_counter_createW_ptr ITTNOTIFY_NAME(counter_createW)
3185 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3186 #define __itt_counter_create ITTNOTIFY_DATA(counter_create)
3187 #define __itt_counter_create_ptr ITTNOTIFY_NAME(counter_create)
3188 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3189 #else /* INTEL_NO_ITTNOTIFY_API */
3190 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3191 #define __itt_counter_createA(name, domain)
3192 #define __itt_counter_createA_ptr 0
3193 #define __itt_counter_createW(name, domain)
3194 #define __itt_counter_createW_ptr 0
3195 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3196 #define __itt_counter_create(name, domain)
3197 #define __itt_counter_create_ptr 0
3198 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3199 #endif /* INTEL_NO_ITTNOTIFY_API */
3200 #else /* INTEL_NO_MACRO_BODY */
3201 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3202 #define __itt_counter_createA_ptr 0
3203 #define __itt_counter_createW_ptr 0
3204 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3205 #define __itt_counter_create_ptr 0
3206 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3207 #endif /* INTEL_NO_MACRO_BODY */
3208 /** @endcond */
3209 
3210 /**
3211  * @brief Increment the unsigned 64 bits integer counter value
3212  *
3213  * Calling this function to non-unsigned 64 bits integer counters has no effect
3214  */
3215 void ITTAPI __itt_counter_inc(__itt_counter id);
3216 
3217 #ifndef INTEL_NO_MACRO_BODY
3218 #ifndef INTEL_NO_ITTNOTIFY_API
3219 ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id))
3220 #define __itt_counter_inc ITTNOTIFY_VOID(counter_inc)
3221 #define __itt_counter_inc_ptr ITTNOTIFY_NAME(counter_inc)
3222 #else /* INTEL_NO_ITTNOTIFY_API */
3223 #define __itt_counter_inc(id)
3224 #define __itt_counter_inc_ptr 0
3225 #endif /* INTEL_NO_ITTNOTIFY_API */
3226 #else /* INTEL_NO_MACRO_BODY */
3227 #define __itt_counter_inc_ptr 0
3228 #endif /* INTEL_NO_MACRO_BODY */
3229 /** @endcond */
3230 /**
3231  * @brief Increment the unsigned 64 bits integer counter value with x
3232  *
3233  * Calling this function to non-unsigned 64 bits integer counters has no effect
3234  */
3235 void ITTAPI __itt_counter_inc_delta(__itt_counter id, unsigned long long value);
3236 
3237 #ifndef INTEL_NO_MACRO_BODY
3238 #ifndef INTEL_NO_ITTNOTIFY_API
3239 ITT_STUBV(ITTAPI, void, counter_inc_delta,
3240           (__itt_counter id, unsigned long long value))
3241 #define __itt_counter_inc_delta ITTNOTIFY_VOID(counter_inc_delta)
3242 #define __itt_counter_inc_delta_ptr ITTNOTIFY_NAME(counter_inc_delta)
3243 #else /* INTEL_NO_ITTNOTIFY_API */
3244 #define __itt_counter_inc_delta(id, value)
3245 #define __itt_counter_inc_delta_ptr 0
3246 #endif /* INTEL_NO_ITTNOTIFY_API */
3247 #else /* INTEL_NO_MACRO_BODY */
3248 #define __itt_counter_inc_delta_ptr 0
3249 #endif /* INTEL_NO_MACRO_BODY */
3250 /** @endcond */
3251 
3252 /**
3253  * @brief Decrement the unsigned 64 bits integer counter value
3254  *
3255  * Calling this function to non-unsigned 64 bits integer counters has no effect
3256  */
3257 void ITTAPI __itt_counter_dec(__itt_counter id);
3258 
3259 #ifndef INTEL_NO_MACRO_BODY
3260 #ifndef INTEL_NO_ITTNOTIFY_API
3261 ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id))
3262 #define __itt_counter_dec ITTNOTIFY_VOID(counter_dec)
3263 #define __itt_counter_dec_ptr ITTNOTIFY_NAME(counter_dec)
3264 #else /* INTEL_NO_ITTNOTIFY_API */
3265 #define __itt_counter_dec(id)
3266 #define __itt_counter_dec_ptr 0
3267 #endif /* INTEL_NO_ITTNOTIFY_API */
3268 #else /* INTEL_NO_MACRO_BODY */
3269 #define __itt_counter_dec_ptr 0
3270 #endif /* INTEL_NO_MACRO_BODY */
3271 /** @endcond */
3272 /**
3273  * @brief Decrement the unsigned 64 bits integer counter value with x
3274  *
3275  * Calling this function to non-unsigned 64 bits integer counters has no effect
3276  */
3277 void ITTAPI __itt_counter_dec_delta(__itt_counter id, unsigned long long value);
3278 
3279 #ifndef INTEL_NO_MACRO_BODY
3280 #ifndef INTEL_NO_ITTNOTIFY_API
3281 ITT_STUBV(ITTAPI, void, counter_dec_delta,
3282           (__itt_counter id, unsigned long long value))
3283 #define __itt_counter_dec_delta ITTNOTIFY_VOID(counter_dec_delta)
3284 #define __itt_counter_dec_delta_ptr ITTNOTIFY_NAME(counter_dec_delta)
3285 #else /* INTEL_NO_ITTNOTIFY_API */
3286 #define __itt_counter_dec_delta(id, value)
3287 #define __itt_counter_dec_delta_ptr 0
3288 #endif /* INTEL_NO_ITTNOTIFY_API */
3289 #else /* INTEL_NO_MACRO_BODY */
3290 #define __itt_counter_dec_delta_ptr 0
3291 #endif /* INTEL_NO_MACRO_BODY */
3292 /** @endcond */
3293 
3294 /**
3295  * @ingroup counters
3296  * @brief Increment a counter by one.
3297  * The first call with a given name creates a counter by that name and sets its
3298  * value to zero. Successive calls increment the counter value.
3299  * @param[in] domain The domain controlling the call. Counter names are not
3300  * domain specific. The domain argument is used only to enable or disable the
3301  * API calls.
3302  * @param[in] name The name of the counter
3303  */
3304 void ITTAPI __itt_counter_inc_v3(const __itt_domain *domain,
3305                                  __itt_string_handle *name);
3306 
3307 /**
3308  * @ingroup counters
3309  * @brief Increment a counter by the value specified in delta.
3310  * @param[in] domain The domain controlling the call. Counter names are not
3311  * domain specific. The domain argument is used only to enable or disable the
3312  * API calls.
3313  * @param[in] name The name of the counter
3314  * @param[in] delta The amount by which to increment the counter
3315  */
3316 void ITTAPI __itt_counter_inc_delta_v3(const __itt_domain *domain,
3317                                        __itt_string_handle *name,
3318                                        unsigned long long delta);
3319 
3320 #ifndef INTEL_NO_MACRO_BODY
3321 #ifndef INTEL_NO_ITTNOTIFY_API
3322 ITT_STUBV(ITTAPI, void, counter_inc_v3,
3323           (const __itt_domain *domain, __itt_string_handle *name))
3324 ITT_STUBV(ITTAPI, void, counter_inc_delta_v3,
3325           (const __itt_domain *domain, __itt_string_handle *name,
3326            unsigned long long delta))
3327 #define __itt_counter_inc_v3(d, x) ITTNOTIFY_VOID_D1(counter_inc_v3, d, x)
3328 #define __itt_counter_inc_v3_ptr ITTNOTIFY_NAME(counter_inc_v3)
3329 #define __itt_counter_inc_delta_v3(d, x, y)                                    \
3330   ITTNOTIFY_VOID_D2(counter_inc_delta_v3, d, x, y)
3331 #define __itt_counter_inc_delta_v3_ptr ITTNOTIFY_NAME(counter_inc_delta_v3)
3332 #else /* INTEL_NO_ITTNOTIFY_API */
3333 #define __itt_counter_inc_v3(domain, name)
3334 #define __itt_counter_inc_v3_ptr 0
3335 #define __itt_counter_inc_delta_v3(domain, name, delta)
3336 #define __itt_counter_inc_delta_v3_ptr 0
3337 #endif /* INTEL_NO_ITTNOTIFY_API */
3338 #else /* INTEL_NO_MACRO_BODY */
3339 #define __itt_counter_inc_v3_ptr 0
3340 #define __itt_counter_inc_delta_v3_ptr 0
3341 #endif /* INTEL_NO_MACRO_BODY */
3342 /** @endcond */
3343 
3344 /**
3345  * @ingroup counters
3346  * @brief Decrement a counter by one.
3347  * The first call with a given name creates a counter by that name and sets its
3348  * value to zero. Successive calls decrement the counter value.
3349  * @param[in] domain The domain controlling the call. Counter names are not
3350  * domain specific. The domain argument is used only to enable or disable the
3351  * API calls.
3352  * @param[in] name The name of the counter
3353  */
3354 void ITTAPI __itt_counter_dec_v3(const __itt_domain *domain,
3355                                  __itt_string_handle *name);
3356 
3357 /**
3358  * @ingroup counters
3359  * @brief Decrement a counter by the value specified in delta.
3360  * @param[in] domain The domain controlling the call. Counter names are not
3361  * domain specific. The domain argument is used only to enable or disable the
3362  * API calls.
3363  * @param[in] name The name of the counter
3364  * @param[in] delta The amount by which to decrement the counter
3365  */
3366 void ITTAPI __itt_counter_dec_delta_v3(const __itt_domain *domain,
3367                                        __itt_string_handle *name,
3368                                        unsigned long long delta);
3369 
3370 #ifndef INTEL_NO_MACRO_BODY
3371 #ifndef INTEL_NO_ITTNOTIFY_API
3372 ITT_STUBV(ITTAPI, void, counter_dec_v3,
3373           (const __itt_domain *domain, __itt_string_handle *name))
3374 ITT_STUBV(ITTAPI, void, counter_dec_delta_v3,
3375           (const __itt_domain *domain, __itt_string_handle *name,
3376            unsigned long long delta))
3377 #define __itt_counter_dec_v3(d, x) ITTNOTIFY_VOID_D1(counter_dec_v3, d, x)
3378 #define __itt_counter_dec_v3_ptr ITTNOTIFY_NAME(counter_dec_v3)
3379 #define __itt_counter_dec_delta_v3(d, x, y)                                    \
3380   ITTNOTIFY_VOID_D2(counter_dec_delta_v3, d, x, y)
3381 #define __itt_counter_dec_delta_v3_ptr ITTNOTIFY_NAME(counter_dec_delta_v3)
3382 #else /* INTEL_NO_ITTNOTIFY_API */
3383 #define __itt_counter_dec_v3(domain, name)
3384 #define __itt_counter_dec_v3_ptr 0
3385 #define __itt_counter_dec_delta_v3(domain, name, delta)
3386 #define __itt_counter_dec_delta_v3_ptr 0
3387 #endif /* INTEL_NO_ITTNOTIFY_API */
3388 #else /* INTEL_NO_MACRO_BODY */
3389 #define __itt_counter_dec_v3_ptr 0
3390 #define __itt_counter_dec_delta_v3_ptr 0
3391 #endif /* INTEL_NO_MACRO_BODY */
3392 /** @endcond */
3393 
3394 /** @} counters group */
3395 
3396 /**
3397  * @brief Set the counter value
3398  */
3399 void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr);
3400 
3401 #ifndef INTEL_NO_MACRO_BODY
3402 #ifndef INTEL_NO_ITTNOTIFY_API
3403 ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr))
3404 #define __itt_counter_set_value ITTNOTIFY_VOID(counter_set_value)
3405 #define __itt_counter_set_value_ptr ITTNOTIFY_NAME(counter_set_value)
3406 #else /* INTEL_NO_ITTNOTIFY_API */
3407 #define __itt_counter_set_value(id, value_ptr)
3408 #define __itt_counter_set_value_ptr 0
3409 #endif /* INTEL_NO_ITTNOTIFY_API */
3410 #else /* INTEL_NO_MACRO_BODY */
3411 #define __itt_counter_set_value_ptr 0
3412 #endif /* INTEL_NO_MACRO_BODY */
3413 /** @endcond */
3414 
3415 /**
3416  * @brief Set the counter value
3417  */
3418 void ITTAPI __itt_counter_set_value_ex(__itt_counter id,
3419                                        __itt_clock_domain *clock_domain,
3420                                        unsigned long long timestamp,
3421                                        void *value_ptr);
3422 
3423 /** @cond exclude_from_documentation */
3424 #ifndef INTEL_NO_MACRO_BODY
3425 #ifndef INTEL_NO_ITTNOTIFY_API
3426 ITT_STUBV(ITTAPI, void, counter_set_value_ex,
3427           (__itt_counter id, __itt_clock_domain *clock_domain,
3428            unsigned long long timestamp, void *value_ptr))
3429 #define __itt_counter_set_value_ex ITTNOTIFY_VOID(counter_set_value_ex)
3430 #define __itt_counter_set_value_ex_ptr ITTNOTIFY_NAME(counter_set_value_ex)
3431 #else /* INTEL_NO_ITTNOTIFY_API */
3432 #define __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
3433 #define __itt_counter_set_value_ex_ptr 0
3434 #endif /* INTEL_NO_ITTNOTIFY_API */
3435 #else /* INTEL_NO_MACRO_BODY */
3436 #define __itt_counter_set_value_ex_ptr 0
3437 #endif /* INTEL_NO_MACRO_BODY */
3438 /** @endcond */
3439 
3440 /**
3441  * @brief Create a typed counter with given name/domain
3442  *
3443  * After __itt_counter_create_typed() is called, __itt_counter_inc(id),
3444  * __itt_counter_inc_delta(id, delta),
3445  * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id,
3446  * clock_domain, timestamp, value_ptr) can be used to change the value of the
3447  * counter
3448  */
3449 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3450 __itt_counter ITTAPI __itt_counter_create_typedA(const char *name,
3451                                                  const char *domain,
3452                                                  __itt_metadata_type type);
3453 __itt_counter ITTAPI __itt_counter_create_typedW(const wchar_t *name,
3454                                                  const wchar_t *domain,
3455                                                  __itt_metadata_type type);
3456 #if defined(UNICODE) || defined(_UNICODE)
3457 #define __itt_counter_create_typed __itt_counter_create_typedW
3458 #define __itt_counter_create_typed_ptr __itt_counter_create_typedW_ptr
3459 #else /* UNICODE */
3460 #define __itt_counter_create_typed __itt_counter_create_typedA
3461 #define __itt_counter_create_typed_ptr __itt_counter_create_typedA_ptr
3462 #endif /* UNICODE */
3463 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3464 __itt_counter ITTAPI __itt_counter_create_typed(const char *name,
3465                                                 const char *domain,
3466                                                 __itt_metadata_type type);
3467 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3468 
3469 #ifndef INTEL_NO_MACRO_BODY
3470 #ifndef INTEL_NO_ITTNOTIFY_API
3471 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3472 ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA,
3473          (const char *name, const char *domain, __itt_metadata_type type))
3474 ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW,
3475          (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type))
3476 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3477 ITT_STUB(ITTAPI, __itt_counter, counter_create_typed,
3478          (const char *name, const char *domain, __itt_metadata_type type))
3479 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3480 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3481 #define __itt_counter_create_typedA ITTNOTIFY_DATA(counter_create_typedA)
3482 #define __itt_counter_create_typedA_ptr ITTNOTIFY_NAME(counter_create_typedA)
3483 #define __itt_counter_create_typedW ITTNOTIFY_DATA(counter_create_typedW)
3484 #define __itt_counter_create_typedW_ptr ITTNOTIFY_NAME(counter_create_typedW)
3485 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3486 #define __itt_counter_create_typed ITTNOTIFY_DATA(counter_create_typed)
3487 #define __itt_counter_create_typed_ptr ITTNOTIFY_NAME(counter_create_typed)
3488 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3489 #else /* INTEL_NO_ITTNOTIFY_API */
3490 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3491 #define __itt_counter_create_typedA(name, domain, type)
3492 #define __itt_counter_create_typedA_ptr 0
3493 #define __itt_counter_create_typedW(name, domain, type)
3494 #define __itt_counter_create_typedW_ptr 0
3495 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3496 #define __itt_counter_create_typed(name, domain, type)
3497 #define __itt_counter_create_typed_ptr 0
3498 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3499 #endif /* INTEL_NO_ITTNOTIFY_API */
3500 #else /* INTEL_NO_MACRO_BODY */
3501 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3502 #define __itt_counter_create_typedA_ptr 0
3503 #define __itt_counter_create_typedW_ptr 0
3504 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3505 #define __itt_counter_create_typed_ptr 0
3506 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3507 #endif /* INTEL_NO_MACRO_BODY */
3508 /** @endcond */
3509 
3510 /**
3511  * @brief Destroy the counter identified by the pointer previously returned by
3512  * __itt_counter_create() or
3513  * __itt_counter_create_typed()
3514  */
3515 void ITTAPI __itt_counter_destroy(__itt_counter id);
3516 
3517 #ifndef INTEL_NO_MACRO_BODY
3518 #ifndef INTEL_NO_ITTNOTIFY_API
3519 ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id))
3520 #define __itt_counter_destroy ITTNOTIFY_VOID(counter_destroy)
3521 #define __itt_counter_destroy_ptr ITTNOTIFY_NAME(counter_destroy)
3522 #else /* INTEL_NO_ITTNOTIFY_API */
3523 #define __itt_counter_destroy(id)
3524 #define __itt_counter_destroy_ptr 0
3525 #endif /* INTEL_NO_ITTNOTIFY_API */
3526 #else /* INTEL_NO_MACRO_BODY */
3527 #define __itt_counter_destroy_ptr 0
3528 #endif /* INTEL_NO_MACRO_BODY */
3529 /** @endcond */
3530 /** @} counters group */
3531 
3532 /**
3533  * @ingroup markers
3534  * @brief Create a marker instance.
3535  * @param[in] domain The domain for this marker
3536  * @param[in] clock_domain The clock domain controlling the execution of this
3537  * call.
3538  * @param[in] timestamp The user defined timestamp.
3539  * @param[in] id The instance ID for this marker, or __itt_null
3540  * @param[in] name The name for this marker
3541  * @param[in] scope The scope for this marker
3542  */
3543 void ITTAPI __itt_marker_ex(const __itt_domain *domain,
3544                             __itt_clock_domain *clock_domain,
3545                             unsigned long long timestamp, __itt_id id,
3546                             __itt_string_handle *name, __itt_scope scope);
3547 
3548 /** @cond exclude_from_documentation */
3549 #ifndef INTEL_NO_MACRO_BODY
3550 #ifndef INTEL_NO_ITTNOTIFY_API
3551 ITT_STUBV(ITTAPI, void, marker_ex,
3552           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3553            unsigned long long timestamp, __itt_id id, __itt_string_handle *name,
3554            __itt_scope scope))
3555 #define __itt_marker_ex(d, x, y, z, a, b)                                      \
3556   ITTNOTIFY_VOID_D5(marker_ex, d, x, y, z, a, b)
3557 #define __itt_marker_ex_ptr ITTNOTIFY_NAME(marker_ex)
3558 #else /* INTEL_NO_ITTNOTIFY_API */
3559 #define __itt_marker_ex(domain, clock_domain, timestamp, id, name, scope)
3560 #define __itt_marker_ex_ptr 0
3561 #endif /* INTEL_NO_ITTNOTIFY_API */
3562 #else /* INTEL_NO_MACRO_BODY */
3563 #define __itt_marker_ex_ptr 0
3564 #endif /* INTEL_NO_MACRO_BODY */
3565 /** @endcond */
3566 
3567 /**
3568  * @ingroup clockdomain
3569  * @brief Add a relation to the current task instance.
3570  * The current task instance is the head of the relation.
3571  * @param[in] domain The domain controlling this call
3572  * @param[in] clock_domain The clock domain controlling the execution of this
3573  * call.
3574  * @param[in] timestamp The user defined timestamp.
3575  * @param[in] relation The kind of relation
3576  * @param[in] tail The ID for the tail of the relation
3577  */
3578 void ITTAPI __itt_relation_add_to_current_ex(const __itt_domain *domain,
3579                                              __itt_clock_domain *clock_domain,
3580                                              unsigned long long timestamp,
3581                                              __itt_relation relation,
3582                                              __itt_id tail);
3583 
3584 /**
3585  * @ingroup clockdomain
3586  * @brief Add a relation between two instance identifiers.
3587  * @param[in] domain The domain controlling this call
3588  * @param[in] clock_domain The clock domain controlling the execution of this
3589  * call.
3590  * @param[in] timestamp The user defined timestamp.
3591  * @param[in] head The ID for the head of the relation
3592  * @param[in] relation The kind of relation
3593  * @param[in] tail The ID for the tail of the relation
3594  */
3595 void ITTAPI __itt_relation_add_ex(const __itt_domain *domain,
3596                                   __itt_clock_domain *clock_domain,
3597                                   unsigned long long timestamp, __itt_id head,
3598                                   __itt_relation relation, __itt_id tail);
3599 
3600 /** @cond exclude_from_documentation */
3601 #ifndef INTEL_NO_MACRO_BODY
3602 #ifndef INTEL_NO_ITTNOTIFY_API
3603 ITT_STUBV(ITTAPI, void, relation_add_to_current_ex,
3604           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3605            unsigned long long timestamp, __itt_relation relation,
3606            __itt_id tail))
3607 ITT_STUBV(ITTAPI, void, relation_add_ex,
3608           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
3609            unsigned long long timestamp, __itt_id head, __itt_relation relation,
3610            __itt_id tail))
3611 #define __itt_relation_add_to_current_ex(d, x, y, z, a)                        \
3612   ITTNOTIFY_VOID_D4(relation_add_to_current_ex, d, x, y, z, a)
3613 #define __itt_relation_add_to_current_ex_ptr                                   \
3614   ITTNOTIFY_NAME(relation_add_to_current_ex)
3615 #define __itt_relation_add_ex(d, x, y, z, a, b)                                \
3616   ITTNOTIFY_VOID_D5(relation_add_ex, d, x, y, z, a, b)
3617 #define __itt_relation_add_ex_ptr ITTNOTIFY_NAME(relation_add_ex)
3618 #else /* INTEL_NO_ITTNOTIFY_API */
3619 #define __itt_relation_add_to_current_ex(domain, clock_domain, timestame,      \
3620                                          relation, tail)
3621 #define __itt_relation_add_to_current_ex_ptr 0
3622 #define __itt_relation_add_ex(domain, clock_domain, timestamp, head, relation, \
3623                               tail)
3624 #define __itt_relation_add_ex_ptr 0
3625 #endif /* INTEL_NO_ITTNOTIFY_API */
3626 #else /* INTEL_NO_MACRO_BODY */
3627 #define __itt_relation_add_to_current_ex_ptr 0
3628 #define __itt_relation_add_ex_ptr 0
3629 #endif /* INTEL_NO_MACRO_BODY */
3630 /** @endcond */
3631 
3632 /** @cond exclude_from_documentation */
3633 typedef enum ___itt_track_group_type {
3634   __itt_track_group_type_normal = 0
3635 } __itt_track_group_type;
3636 /** @endcond */
3637 
3638 /** @cond exclude_from_documentation */
3639 #pragma pack(push, 8)
3640 
3641 typedef struct ___itt_track_group {
3642   __itt_string_handle *name; /*!< Name of the track group */
3643   struct ___itt_track *track; /*!< List of child tracks    */
3644   __itt_track_group_type tgtype; /*!< Type of the track group */
3645   int extra1; /*!< Reserved. Must be zero  */
3646   void *extra2; /*!< Reserved. Must be zero  */
3647   struct ___itt_track_group *next;
3648 } __itt_track_group;
3649 
3650 #pragma pack(pop)
3651 /** @endcond */
3652 
3653 /**
3654  * @brief Placeholder for custom track types. Currently, "normal" custom track
3655  * is the only available track type.
3656  */
3657 typedef enum ___itt_track_type {
3658   __itt_track_type_normal = 0
3659 #ifdef INTEL_ITTNOTIFY_API_PRIVATE
3660   ,
3661   __itt_track_type_queue
3662 #endif /* INTEL_ITTNOTIFY_API_PRIVATE */
3663 } __itt_track_type;
3664 
3665 /** @cond exclude_from_documentation */
3666 #pragma pack(push, 8)
3667 
3668 typedef struct ___itt_track {
3669   __itt_string_handle *name; /*!< Name of the track group */
3670   __itt_track_group *group; /*!< Parent group to a track */
3671   __itt_track_type ttype; /*!< Type of the track       */
3672   int extra1; /*!< Reserved. Must be zero  */
3673   void *extra2; /*!< Reserved. Must be zero  */
3674   struct ___itt_track *next;
3675 } __itt_track;
3676 
3677 #pragma pack(pop)
3678 /** @endcond */
3679 
3680 /**
3681  * @brief Create logical track group.
3682  */
3683 __itt_track_group *ITTAPI __itt_track_group_create(
3684     __itt_string_handle *name, __itt_track_group_type track_group_type);
3685 
3686 /** @cond exclude_from_documentation */
3687 #ifndef INTEL_NO_MACRO_BODY
3688 #ifndef INTEL_NO_ITTNOTIFY_API
3689 ITT_STUB(ITTAPI, __itt_track_group *, track_group_create,
3690          (__itt_string_handle * name, __itt_track_group_type track_group_type))
3691 #define __itt_track_group_create ITTNOTIFY_DATA(track_group_create)
3692 #define __itt_track_group_create_ptr ITTNOTIFY_NAME(track_group_create)
3693 #else /* INTEL_NO_ITTNOTIFY_API */
3694 #define __itt_track_group_create(name) (__itt_track_group *)0
3695 #define __itt_track_group_create_ptr 0
3696 #endif /* INTEL_NO_ITTNOTIFY_API */
3697 #else /* INTEL_NO_MACRO_BODY */
3698 #define __itt_track_group_create_ptr 0
3699 #endif /* INTEL_NO_MACRO_BODY */
3700 /** @endcond */
3701 
3702 /**
3703  * @brief Create logical track.
3704  */
3705 __itt_track *ITTAPI __itt_track_create(__itt_track_group *track_group,
3706                                        __itt_string_handle *name,
3707                                        __itt_track_type track_type);
3708 
3709 /** @cond exclude_from_documentation */
3710 #ifndef INTEL_NO_MACRO_BODY
3711 #ifndef INTEL_NO_ITTNOTIFY_API
3712 ITT_STUB(ITTAPI, __itt_track *, track_create,
3713          (__itt_track_group * track_group, __itt_string_handle *name,
3714           __itt_track_type track_type))
3715 #define __itt_track_create ITTNOTIFY_DATA(track_create)
3716 #define __itt_track_create_ptr ITTNOTIFY_NAME(track_create)
3717 #else /* INTEL_NO_ITTNOTIFY_API */
3718 #define __itt_track_create(track_group, name, track_type) (__itt_track *)0
3719 #define __itt_track_create_ptr 0
3720 #endif /* INTEL_NO_ITTNOTIFY_API */
3721 #else /* INTEL_NO_MACRO_BODY */
3722 #define __itt_track_create_ptr 0
3723 #endif /* INTEL_NO_MACRO_BODY */
3724 /** @endcond */
3725 
3726 /**
3727  * @brief Set the logical track.
3728  */
3729 void ITTAPI __itt_set_track(__itt_track *track);
3730 
3731 /** @cond exclude_from_documentation */
3732 #ifndef INTEL_NO_MACRO_BODY
3733 #ifndef INTEL_NO_ITTNOTIFY_API
3734 ITT_STUBV(ITTAPI, void, set_track, (__itt_track * track))
3735 #define __itt_set_track ITTNOTIFY_VOID(set_track)
3736 #define __itt_set_track_ptr ITTNOTIFY_NAME(set_track)
3737 #else /* INTEL_NO_ITTNOTIFY_API */
3738 #define __itt_set_track(track)
3739 #define __itt_set_track_ptr 0
3740 #endif /* INTEL_NO_ITTNOTIFY_API */
3741 #else /* INTEL_NO_MACRO_BODY */
3742 #define __itt_set_track_ptr 0
3743 #endif /* INTEL_NO_MACRO_BODY */
3744 /** @endcond */
3745 
3746 /* ========================================================================== */
3747 /** @cond exclude_from_gpa_documentation */
3748 /**
3749  * @defgroup events Events
3750  * @ingroup public
3751  * Events group
3752  * @{
3753  */
3754 /** @brief user event type */
3755 typedef int __itt_event;
3756 
3757 /**
3758  * @brief Create an event notification
3759  * @note name or namelen being null/name and namelen not matching, user event
3760  * feature not enabled
3761  * @return non-zero event identifier upon success and __itt_err otherwise
3762  */
3763 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3764 __itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen);
3765 __itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen);
3766 #if defined(UNICODE) || defined(_UNICODE)
3767 #define __itt_event_create __itt_event_createW
3768 #define __itt_event_create_ptr __itt_event_createW_ptr
3769 #else
3770 #define __itt_event_create __itt_event_createA
3771 #define __itt_event_create_ptr __itt_event_createA_ptr
3772 #endif /* UNICODE */
3773 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3774 __itt_event LIBITTAPI __itt_event_create(const char *name, int namelen);
3775 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3776 
3777 /** @cond exclude_from_documentation */
3778 #ifndef INTEL_NO_MACRO_BODY
3779 #ifndef INTEL_NO_ITTNOTIFY_API
3780 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3781 ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen))
3782 ITT_STUB(LIBITTAPI, __itt_event, event_createW,
3783          (const wchar_t *name, int namelen))
3784 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3785 ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen))
3786 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3787 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3788 #define __itt_event_createA ITTNOTIFY_DATA(event_createA)
3789 #define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA)
3790 #define __itt_event_createW ITTNOTIFY_DATA(event_createW)
3791 #define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW)
3792 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3793 #define __itt_event_create ITTNOTIFY_DATA(event_create)
3794 #define __itt_event_create_ptr ITTNOTIFY_NAME(event_create)
3795 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3796 #else /* INTEL_NO_ITTNOTIFY_API */
3797 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3798 #define __itt_event_createA(name, namelen) (__itt_event)0
3799 #define __itt_event_createA_ptr 0
3800 #define __itt_event_createW(name, namelen) (__itt_event)0
3801 #define __itt_event_createW_ptr 0
3802 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3803 #define __itt_event_create(name, namelen) (__itt_event)0
3804 #define __itt_event_create_ptr 0
3805 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3806 #endif /* INTEL_NO_ITTNOTIFY_API */
3807 #else /* INTEL_NO_MACRO_BODY */
3808 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3809 #define __itt_event_createA_ptr 0
3810 #define __itt_event_createW_ptr 0
3811 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3812 #define __itt_event_create_ptr 0
3813 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3814 #endif /* INTEL_NO_MACRO_BODY */
3815 /** @endcond */
3816 
3817 /**
3818  * @brief Record an event occurrence.
3819  * @return __itt_err upon failure (invalid event id/user event feature not
3820  * enabled)
3821  */
3822 int LIBITTAPI __itt_event_start(__itt_event event);
3823 
3824 /** @cond exclude_from_documentation */
3825 #ifndef INTEL_NO_MACRO_BODY
3826 #ifndef INTEL_NO_ITTNOTIFY_API
3827 ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event))
3828 #define __itt_event_start ITTNOTIFY_DATA(event_start)
3829 #define __itt_event_start_ptr ITTNOTIFY_NAME(event_start)
3830 #else /* INTEL_NO_ITTNOTIFY_API */
3831 #define __itt_event_start(event) (int)0
3832 #define __itt_event_start_ptr 0
3833 #endif /* INTEL_NO_ITTNOTIFY_API */
3834 #else /* INTEL_NO_MACRO_BODY */
3835 #define __itt_event_start_ptr 0
3836 #endif /* INTEL_NO_MACRO_BODY */
3837 /** @endcond */
3838 
3839 /**
3840  * @brief Record an event end occurrence.
3841  * @note It is optional if events do not have durations.
3842  * @return __itt_err upon failure (invalid event id/user event feature not
3843  * enabled)
3844  */
3845 int LIBITTAPI __itt_event_end(__itt_event event);
3846 
3847 /** @cond exclude_from_documentation */
3848 #ifndef INTEL_NO_MACRO_BODY
3849 #ifndef INTEL_NO_ITTNOTIFY_API
3850 ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event))
3851 #define __itt_event_end ITTNOTIFY_DATA(event_end)
3852 #define __itt_event_end_ptr ITTNOTIFY_NAME(event_end)
3853 #else /* INTEL_NO_ITTNOTIFY_API */
3854 #define __itt_event_end(event) (int)0
3855 #define __itt_event_end_ptr 0
3856 #endif /* INTEL_NO_ITTNOTIFY_API */
3857 #else /* INTEL_NO_MACRO_BODY */
3858 #define __itt_event_end_ptr 0
3859 #endif /* INTEL_NO_MACRO_BODY */
3860 /** @endcond */
3861 /** @} events group */
3862 
3863 /**
3864  * @defgroup arrays Arrays Visualizer
3865  * @ingroup public
3866  * Visualize arrays
3867  * @{
3868  */
3869 
3870 /**
3871  * @enum __itt_av_data_type
3872  * @brief Defines types of arrays data (for C/C++ intrinsic types)
3873  */
3874 typedef enum {
3875   __itt_e_first = 0,
3876   __itt_e_char = 0, /* 1-byte integer */
3877   __itt_e_uchar, /* 1-byte unsigned integer */
3878   __itt_e_int16, /* 2-byte integer */
3879   __itt_e_uint16, /* 2-byte unsigned integer  */
3880   __itt_e_int32, /* 4-byte integer */
3881   __itt_e_uint32, /* 4-byte unsigned integer */
3882   __itt_e_int64, /* 8-byte integer */
3883   __itt_e_uint64, /* 8-byte unsigned integer */
3884   __itt_e_float, /* 4-byte floating */
3885   __itt_e_double, /* 8-byte floating */
3886   __itt_e_last = __itt_e_double
3887 } __itt_av_data_type;
3888 
3889 /**
3890  * @brief Save an array data to a file.
3891  * Output format is defined by the file extension. The csv and bmp formats are
3892  * supported (bmp - for 2-dimensional array only).
3893  * @param[in] data - pointer to the array data
3894  * @param[in] rank - the rank of the array
3895  * @param[in] dimensions - pointer to an array of integers, which specifies the
3896  * array dimensions. The size of dimensions must be equal to the rank
3897  * @param[in] type - the type of the array, specified as one of the
3898  * __itt_av_data_type values (for intrinsic types)
3899  * @param[in] filePath - the file path; the output format is defined by the file
3900  * extension
3901  * @param[in] columnOrder - defines how the array is stored in the linear
3902  * memory. It should be 1 for column-major order (e.g. in FORTRAN) or 0 - for
3903  * row-major order (e.g. in C).
3904  */
3905 
3906 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3907 int ITTAPI __itt_av_saveA(void *data, int rank, const int *dimensions, int type,
3908                           const char *filePath, int columnOrder);
3909 int ITTAPI __itt_av_saveW(void *data, int rank, const int *dimensions, int type,
3910                           const wchar_t *filePath, int columnOrder);
3911 #if defined(UNICODE) || defined(_UNICODE)
3912 #define __itt_av_save __itt_av_saveW
3913 #define __itt_av_save_ptr __itt_av_saveW_ptr
3914 #else /* UNICODE */
3915 #define __itt_av_save __itt_av_saveA
3916 #define __itt_av_save_ptr __itt_av_saveA_ptr
3917 #endif /* UNICODE */
3918 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3919 int ITTAPI __itt_av_save(void *data, int rank, const int *dimensions, int type,
3920                          const char *filePath, int columnOrder);
3921 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3922 
3923 /** @cond exclude_from_documentation */
3924 #ifndef INTEL_NO_MACRO_BODY
3925 #ifndef INTEL_NO_ITTNOTIFY_API
3926 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3927 ITT_STUB(ITTAPI, int, av_saveA,
3928          (void *data, int rank, const int *dimensions, int type,
3929           const char *filePath, int columnOrder))
3930 ITT_STUB(ITTAPI, int, av_saveW,
3931          (void *data, int rank, const int *dimensions, int type,
3932           const wchar_t *filePath, int columnOrder))
3933 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3934 ITT_STUB(ITTAPI, int, av_save,
3935          (void *data, int rank, const int *dimensions, int type,
3936           const char *filePath, int columnOrder))
3937 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3938 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3939 #define __itt_av_saveA ITTNOTIFY_DATA(av_saveA)
3940 #define __itt_av_saveA_ptr ITTNOTIFY_NAME(av_saveA)
3941 #define __itt_av_saveW ITTNOTIFY_DATA(av_saveW)
3942 #define __itt_av_saveW_ptr ITTNOTIFY_NAME(av_saveW)
3943 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3944 #define __itt_av_save ITTNOTIFY_DATA(av_save)
3945 #define __itt_av_save_ptr ITTNOTIFY_NAME(av_save)
3946 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3947 #else /* INTEL_NO_ITTNOTIFY_API */
3948 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3949 #define __itt_av_saveA(name)
3950 #define __itt_av_saveA_ptr 0
3951 #define __itt_av_saveW(name)
3952 #define __itt_av_saveW_ptr 0
3953 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3954 #define __itt_av_save(name)
3955 #define __itt_av_save_ptr 0
3956 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3957 #endif /* INTEL_NO_ITTNOTIFY_API */
3958 #else /* INTEL_NO_MACRO_BODY */
3959 #if ITT_PLATFORM == ITT_PLATFORM_WIN
3960 #define __itt_av_saveA_ptr 0
3961 #define __itt_av_saveW_ptr 0
3962 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3963 #define __itt_av_save_ptr 0
3964 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3965 #endif /* INTEL_NO_MACRO_BODY */
3966 /** @endcond */
3967 
3968 void ITTAPI __itt_enable_attach(void);
3969 
3970 /** @cond exclude_from_documentation */
3971 #ifndef INTEL_NO_MACRO_BODY
3972 #ifndef INTEL_NO_ITTNOTIFY_API
3973 ITT_STUBV(ITTAPI, void, enable_attach, (void))
3974 #define __itt_enable_attach ITTNOTIFY_VOID(enable_attach)
3975 #define __itt_enable_attach_ptr ITTNOTIFY_NAME(enable_attach)
3976 #else /* INTEL_NO_ITTNOTIFY_API */
3977 #define __itt_enable_attach()
3978 #define __itt_enable_attach_ptr 0
3979 #endif /* INTEL_NO_ITTNOTIFY_API */
3980 #else /* INTEL_NO_MACRO_BODY */
3981 #define __itt_enable_attach_ptr 0
3982 #endif /* INTEL_NO_MACRO_BODY */
3983 /** @endcond */
3984 
3985 /** @cond exclude_from_gpa_documentation */
3986 
3987 /** @} arrays group */
3988 
3989 /** @endcond */
3990 
3991 /**
3992  * @brief Module load notification
3993  * This API is used to report necessary information in case of bypassing default
3994  * system loader. Notification should be done immidiatelly after this module is
3995  * loaded to process memory.
3996  * @param[in] start_addr - module start address
3997  * @param[in] end_addr - module end address
3998  * @param[in] path - file system full path to the module
3999  */
4000 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4001 void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr,
4002                                const char *path);
4003 void ITTAPI __itt_module_loadW(void *start_addr, void *end_addr,
4004                                const wchar_t *path);
4005 #if defined(UNICODE) || defined(_UNICODE)
4006 #define __itt_module_load __itt_module_loadW
4007 #define __itt_module_load_ptr __itt_module_loadW_ptr
4008 #else /* UNICODE */
4009 #define __itt_module_load __itt_module_loadA
4010 #define __itt_module_load_ptr __itt_module_loadA_ptr
4011 #endif /* UNICODE */
4012 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4013 void ITTAPI __itt_module_load(void *start_addr, void *end_addr,
4014                               const char *path);
4015 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4016 
4017 /** @cond exclude_from_documentation */
4018 #ifndef INTEL_NO_MACRO_BODY
4019 #ifndef INTEL_NO_ITTNOTIFY_API
4020 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4021 ITT_STUB(ITTAPI, void, module_loadA,
4022          (void *start_addr, void *end_addr, const char *path))
4023 ITT_STUB(ITTAPI, void, module_loadW,
4024          (void *start_addr, void *end_addr, const wchar_t *path))
4025 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4026 ITT_STUB(ITTAPI, void, module_load,
4027          (void *start_addr, void *end_addr, const char *path))
4028 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4029 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4030 #define __itt_module_loadA ITTNOTIFY_VOID(module_loadA)
4031 #define __itt_module_loadA_ptr ITTNOTIFY_NAME(module_loadA)
4032 #define __itt_module_loadW ITTNOTIFY_VOID(module_loadW)
4033 #define __itt_module_loadW_ptr ITTNOTIFY_NAME(module_loadW)
4034 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4035 #define __itt_module_load ITTNOTIFY_VOID(module_load)
4036 #define __itt_module_load_ptr ITTNOTIFY_NAME(module_load)
4037 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4038 #else /* INTEL_NO_ITTNOTIFY_API */
4039 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4040 #define __itt_module_loadA(start_addr, end_addr, path)
4041 #define __itt_module_loadA_ptr 0
4042 #define __itt_module_loadW(start_addr, end_addr, path)
4043 #define __itt_module_loadW_ptr 0
4044 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4045 #define __itt_module_load(start_addr, end_addr, path)
4046 #define __itt_module_load_ptr 0
4047 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4048 #endif /* INTEL_NO_ITTNOTIFY_API */
4049 #else /* INTEL_NO_MACRO_BODY */
4050 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4051 #define __itt_module_loadA_ptr 0
4052 #define __itt_module_loadW_ptr 0
4053 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4054 #define __itt_module_load_ptr 0
4055 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4056 #endif /* INTEL_NO_MACRO_BODY */
4057 /** @endcond */
4058 
4059 /**
4060  * @brief Report module unload
4061  * This API is used to report necessary information in case of bypassing default
4062  * system loader. Notification should be done just before the module is unloaded
4063  * from process memory.
4064  * @param[in] addr - base address of loaded module
4065  */
4066 void ITTAPI __itt_module_unload(void *addr);
4067 
4068 /** @cond exclude_from_documentation */
4069 #ifndef INTEL_NO_MACRO_BODY
4070 #ifndef INTEL_NO_ITTNOTIFY_API
4071 ITT_STUBV(ITTAPI, void, module_unload, (void *addr))
4072 #define __itt_module_unload ITTNOTIFY_VOID(module_unload)
4073 #define __itt_module_unload_ptr ITTNOTIFY_NAME(module_unload)
4074 #else /* INTEL_NO_ITTNOTIFY_API */
4075 #define __itt_module_unload(addr)
4076 #define __itt_module_unload_ptr 0
4077 #endif /* INTEL_NO_ITTNOTIFY_API */
4078 #else /* INTEL_NO_MACRO_BODY */
4079 #define __itt_module_unload_ptr 0
4080 #endif /* INTEL_NO_MACRO_BODY */
4081 /** @endcond */
4082 
4083 /** @cond exclude_from_documentation */
4084 typedef enum {
4085   __itt_module_type_unknown = 0,
4086   __itt_module_type_elf,
4087   __itt_module_type_coff
4088 } __itt_module_type;
4089 /** @endcond */
4090 
4091 /** @cond exclude_from_documentation */
4092 typedef enum {
4093   itt_section_type_unknown,
4094   itt_section_type_bss, /* notifies that the section contains uninitialized
4095                          * data. These are the relevant section types and the
4096                          * modules that contain them: ELF module:  SHT_NOBITS
4097                          * section type COFF module:
4098                          * IMAGE_SCN_CNT_UNINITIALIZED_DATA section type
4099                          */
4100   itt_section_type_data, /* notifies that section contains initialized data.
4101                           * These are the relevant section types and the modules
4102                           * that contain them: ELF module:  SHT_PROGBITS section
4103                           * type COFF module: IMAGE_SCN_CNT_INITIALIZED_DATA
4104                           * section type
4105                           */
4106   itt_section_type_text /* notifies that the section contains executable code.
4107                          * These are the relevant section types and the modules
4108                          * that contain them: ELF module:  SHT_PROGBITS section
4109                          * type COFF module: IMAGE_SCN_CNT_CODE section type
4110                          */
4111 } __itt_section_type;
4112 /** @endcond */
4113 
4114 /**
4115  * @hideinitializer
4116  * @brief bit-mask, detects a section attribute that indicates whether a section
4117  * can be executed as code: These are the relevant section attributes and the
4118  * modules that contain them: ELF module:  PF_X section attribute COFF module:
4119  * IMAGE_SCN_MEM_EXECUTE attribute
4120  */
4121 #define __itt_section_exec 0x20000000
4122 
4123 /**
4124  * @hideinitializer
4125  * @brief bit-mask, detects a section attribute that indicates whether a section
4126  * can be read. These are the relevant section attributes and the modules that
4127  * contain them: ELF module:  PF_R attribute COFF module: IMAGE_SCN_MEM_READ
4128  * attribute
4129  */
4130 #define __itt_section_read 0x40000000
4131 
4132 /**
4133  * @hideinitializer
4134  * @brief bit-mask, detects a section attribute that indicates whether a section
4135  * can be written to. These are the relevant section attributes and the modules
4136  * that contain them: ELF module:  PF_W attribute COFF module:
4137  * IMAGE_SCN_MEM_WRITE attribute
4138  */
4139 #define __itt_section_write 0x80000000
4140 
4141 /** @cond exclude_from_documentation */
4142 #pragma pack(push, 8)
4143 
4144 typedef struct ___itt_section_info {
4145   const char *name; /*!< Section name in UTF8 */
4146   __itt_section_type type; /*!< Section content and semantics description */
4147   size_t flags; /*!< Section bit flags that describe attributes using bit mask
4148                  * Zero if disabled, non-zero if enabled
4149                  */
4150   void *start_addr; /*!< Section load(relocated) start address */
4151   size_t size; /*!< Section file offset */
4152   size_t file_offset; /*!< Section size */
4153 } __itt_section_info;
4154 
4155 #pragma pack(pop)
4156 /** @endcond */
4157 
4158 /** @cond exclude_from_documentation */
4159 #pragma pack(push, 8)
4160 
4161 typedef struct ___itt_module_object {
4162   unsigned int version; /*!< API version*/
4163   __itt_id module_id; /*!< Unique identifier. This is unchanged for sections
4164                          that belong to the same module */
4165   __itt_module_type module_type; /*!< Binary module format */
4166   const char *module_name; /*!< Unique module name or path to module in UTF8
4167                             * Contains module name when module_bufer and
4168                             * module_size exist Contains module path when
4169                             * module_bufer and module_size absent module_name
4170                             * remains the same for the certain module_id
4171                             */
4172   void *module_buffer; /*!< Module buffer content */
4173   size_t module_size; /*!< Module buffer size */
4174   /*!< If module_buffer and module_size exist, the binary module is dumped onto
4175    * the system. If module_buffer and module_size do not exist, the binary
4176    * module exists on the system already. The module_name parameter contains the
4177    * path to the module.
4178    */
4179   __itt_section_info *section_array; /*!< Reference to section information */
4180   size_t section_number;
4181 } __itt_module_object;
4182 
4183 #pragma pack(pop)
4184 /** @endcond */
4185 
4186 /**
4187  * @brief Load module content and its loaded(relocated) sections.
4188  * This API is useful to save a module, or specify its location on the system
4189  * and report information about loaded sections. The target module is saved on
4190  * the system if module buffer content and size are available. If module buffer
4191  * content and size are unavailable, the module name contains the path to the
4192  * existing binary module.
4193  * @param[in] module_obj - provides module and section information, along with
4194  * unique module identifiers (name,module ID) which bind the binary module to
4195  * particular sections.
4196  */
4197 void ITTAPI __itt_module_load_with_sections(__itt_module_object *module_obj);
4198 
4199 /** @cond exclude_from_documentation */
4200 #ifndef INTEL_NO_MACRO_BODY
4201 #ifndef INTEL_NO_ITTNOTIFY_API
4202 ITT_STUBV(ITTAPI, void, module_load_with_sections,
4203           (__itt_module_object * module_obj))
4204 #define __itt_module_load_with_sections                                        \
4205   ITTNOTIFY_VOID(module_load_with_sections)
4206 #define __itt_module_load_with_sections_ptr                                    \
4207   ITTNOTIFY_NAME(module_load_with_sections)
4208 #else /* INTEL_NO_ITTNOTIFY_API */
4209 #define __itt_module_load_with_sections(module_obj)
4210 #define __itt_module_load_with_sections_ptr 0
4211 #endif /* INTEL_NO_ITTNOTIFY_API */
4212 #else /* INTEL_NO_MACRO_BODY */
4213 #define __itt_module_load_with_sections_ptr 0
4214 #endif /* INTEL_NO_MACRO_BODY */
4215 /** @endcond */
4216 
4217 /**
4218  * @brief Unload a module and its loaded(relocated) sections.
4219  * This API notifies that the module and its sections were unloaded.
4220  * @param[in] module_obj - provides module and sections information, along with
4221  * unique module identifiers (name,module ID) which bind the binary module to
4222  * particular sections.
4223  */
4224 void ITTAPI __itt_module_unload_with_sections(__itt_module_object *module_obj);
4225 
4226 /** @cond exclude_from_documentation */
4227 #ifndef INTEL_NO_MACRO_BODY
4228 #ifndef INTEL_NO_ITTNOTIFY_API
4229 ITT_STUBV(ITTAPI, void, module_unload_with_sections,
4230           (__itt_module_object * module_obj))
4231 #define __itt_module_unload_with_sections                                      \
4232   ITTNOTIFY_VOID(module_unload_with_sections)
4233 #define __itt_module_unload_with_sections_ptr                                  \
4234   ITTNOTIFY_NAME(module_unload_with_sections)
4235 #else /* INTEL_NO_ITTNOTIFY_API */
4236 #define __itt_module_unload_with_sections(module_obj)
4237 #define __itt_module_unload_with_sections_ptr 0
4238 #endif /* INTEL_NO_ITTNOTIFY_API */
4239 #else /* INTEL_NO_MACRO_BODY */
4240 #define __itt_module_unload_with_sections_ptr 0
4241 #endif /* INTEL_NO_MACRO_BODY */
4242 /** @endcond */
4243 
4244 /** @cond exclude_from_documentation */
4245 #pragma pack(push, 8)
4246 
4247 typedef struct ___itt_histogram {
4248   const __itt_domain *domain; /*!< Domain of the histogram*/
4249   const char *nameA; /*!< Name of the histogram */
4250 #if defined(UNICODE) || defined(_UNICODE)
4251   const wchar_t *nameW;
4252 #else /* UNICODE || _UNICODE */
4253   void *nameW;
4254 #endif /* UNICODE || _UNICODE */
4255   __itt_metadata_type x_type; /*!< Type of the histogram X axis */
4256   __itt_metadata_type y_type; /*!< Type of the histogram Y axis */
4257   int extra1; /*!< Reserved to the runtime */
4258   void *extra2; /*!< Reserved to the runtime */
4259   struct ___itt_histogram *next;
4260 } __itt_histogram;
4261 
4262 #pragma pack(pop)
4263 /** @endcond */
4264 
4265 /**
4266  * @brief Create a typed histogram instance with given name/domain.
4267  * @param[in] domain The domain controlling the call.
4268  * @param[in] name   The name of the histogram.
4269  * @param[in] x_type The type of the X axis in histogram (may be 0 to calculate
4270  * batch statistics).
4271  * @param[in] y_type The type of the Y axis in histogram.
4272  */
4273 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4274 __itt_histogram *ITTAPI __itt_histogram_createA(const __itt_domain *domain,
4275                                                 const char *name,
4276                                                 __itt_metadata_type x_type,
4277                                                 __itt_metadata_type y_type);
4278 __itt_histogram *ITTAPI __itt_histogram_createW(const __itt_domain *domain,
4279                                                 const wchar_t *name,
4280                                                 __itt_metadata_type x_type,
4281                                                 __itt_metadata_type y_type);
4282 #if defined(UNICODE) || defined(_UNICODE)
4283 #define __itt_histogram_create __itt_histogram_createW
4284 #define __itt_histogram_create_ptr __itt_histogram_createW_ptr
4285 #else /* UNICODE */
4286 #define __itt_histogram_create __itt_histogram_createA
4287 #define __itt_histogram_create_ptr __itt_histogram_createA_ptr
4288 #endif /* UNICODE */
4289 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4290 __itt_histogram *ITTAPI __itt_histogram_create(const __itt_domain *domain,
4291                                                const char *name,
4292                                                __itt_metadata_type x_type,
4293                                                __itt_metadata_type y_type);
4294 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4295 
4296 /** @cond exclude_from_documentation */
4297 #ifndef INTEL_NO_MACRO_BODY
4298 #ifndef INTEL_NO_ITTNOTIFY_API
4299 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4300 ITT_STUB(ITTAPI, __itt_histogram *, histogram_createA,
4301          (const __itt_domain *domain, const char *name,
4302           __itt_metadata_type x_type, __itt_metadata_type y_type))
4303 ITT_STUB(ITTAPI, __itt_histogram *, histogram_createW,
4304          (const __itt_domain *domain, const wchar_t *name,
4305           __itt_metadata_type x_type, __itt_metadata_type y_type))
4306 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4307 ITT_STUB(ITTAPI, __itt_histogram *, histogram_create,
4308          (const __itt_domain *domain, const char *name,
4309           __itt_metadata_type x_type, __itt_metadata_type y_type))
4310 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4311 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4312 #define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
4313 #define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
4314 #define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
4315 #define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
4316 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4317 #define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
4318 #define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
4319 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4320 #else /* INTEL_NO_ITTNOTIFY_API */
4321 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4322 #define __itt_histogram_createA(domain, name, x_type, y_type)                  \
4323   (__itt_histogram *)0
4324 #define __itt_histogram_createA_ptr 0
4325 #define __itt_histogram_createW(domain, name, x_type, y_type)                  \
4326   (__itt_histogram *)0
4327 #define __itt_histogram_createW_ptr 0
4328 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4329 #define __itt_histogram_create(domain, name, x_type, y_type)                   \
4330   (__itt_histogram *)0
4331 #define __itt_histogram_create_ptr 0
4332 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4333 #endif /* INTEL_NO_ITTNOTIFY_API */
4334 #else /* INTEL_NO_MACRO_BODY */
4335 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4336 #define __itt_histogram_createA_ptr 0
4337 #define __itt_histogram_createW_ptr 0
4338 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4339 #define __itt_histogram_create_ptr 0
4340 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4341 #endif /* INTEL_NO_MACRO_BODY */
4342 /** @endcond */
4343 
4344 /**
4345  * @brief Submit statistics for a histogram instance.
4346  * @param[in] hist    Pointer to the histogram instance to which the histogram
4347  * statistic is to be dumped.
4348  * @param[in] length  The number of elements in dumped axis data array.
4349  * @param[in] x_data  The X axis dumped data itself (may be NULL to calculate
4350  * batch statistics).
4351  * @param[in] y_data  The Y axis dumped data itself.
4352  */
4353 void ITTAPI __itt_histogram_submit(__itt_histogram *hist, size_t length,
4354                                    void *x_data, void *y_data);
4355 
4356 /** @cond exclude_from_documentation */
4357 #ifndef INTEL_NO_MACRO_BODY
4358 #ifndef INTEL_NO_ITTNOTIFY_API
4359 ITT_STUBV(ITTAPI, void, histogram_submit,
4360           (__itt_histogram * hist, size_t length, void *x_data, void *y_data))
4361 #define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
4362 #define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
4363 #else /* INTEL_NO_ITTNOTIFY_API */
4364 #define __itt_histogram_submit(hist, length, x_data, y_data)
4365 #define __itt_histogram_submit_ptr 0
4366 #endif /* INTEL_NO_ITTNOTIFY_API */
4367 #else /* INTEL_NO_MACRO_BODY */
4368 #define __itt_histogram_submit_ptr 0
4369 #endif /* INTEL_NO_MACRO_BODY */
4370 /** @endcond */
4371 
4372 #ifdef __cplusplus
4373 }
4374 #endif /* __cplusplus */
4375 
4376 #endif /* _ITTNOTIFY_H_ */
4377 
4378 #ifdef INTEL_ITTNOTIFY_API_PRIVATE
4379 
4380 #ifndef _ITTNOTIFY_PRIVATE_
4381 #define _ITTNOTIFY_PRIVATE_
4382 
4383 #ifdef __cplusplus
4384 extern "C" {
4385 #endif /* __cplusplus */
4386 
4387 /**
4388  * @ingroup clockdomain
4389  * @brief Begin an overlapped task instance.
4390  * @param[in] domain The domain for this task
4391  * @param[in] clock_domain The clock domain controlling the execution of this
4392  * call.
4393  * @param[in] timestamp The user defined timestamp.
4394  * @param[in] taskid The identifier for this task instance, *cannot* be
4395  * __itt_null.
4396  * @param[in] parentid The parent of this task, or __itt_null.
4397  * @param[in] name The name of this task.
4398  */
4399 void ITTAPI __itt_task_begin_overlapped_ex(const __itt_domain *domain,
4400                                            __itt_clock_domain *clock_domain,
4401                                            unsigned long long timestamp,
4402                                            __itt_id taskid, __itt_id parentid,
4403                                            __itt_string_handle *name);
4404 
4405 /**
4406  * @ingroup clockdomain
4407  * @brief End an overlapped task instance.
4408  * @param[in] domain The domain for this task
4409  * @param[in] clock_domain The clock domain controlling the execution of this
4410  * call.
4411  * @param[in] timestamp The user defined timestamp.
4412  * @param[in] taskid Explicit ID of finished task
4413  */
4414 void ITTAPI __itt_task_end_overlapped_ex(const __itt_domain *domain,
4415                                          __itt_clock_domain *clock_domain,
4416                                          unsigned long long timestamp,
4417                                          __itt_id taskid);
4418 
4419 /** @cond exclude_from_documentation */
4420 #ifndef INTEL_NO_MACRO_BODY
4421 #ifndef INTEL_NO_ITTNOTIFY_API
4422 ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex,
4423           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
4424            unsigned long long timestamp, __itt_id taskid, __itt_id parentid,
4425            __itt_string_handle *name))
4426 ITT_STUBV(ITTAPI, void, task_end_overlapped_ex,
4427           (const __itt_domain *domain, __itt_clock_domain *clock_domain,
4428            unsigned long long timestamp, __itt_id taskid))
4429 #define __itt_task_begin_overlapped_ex(d, x, y, z, a, b)                       \
4430   ITTNOTIFY_VOID_D5(task_begin_overlapped_ex, d, x, y, z, a, b)
4431 #define __itt_task_begin_overlapped_ex_ptr                                     \
4432   ITTNOTIFY_NAME(task_begin_overlapped_ex)
4433 #define __itt_task_end_overlapped_ex(d, x, y, z)                               \
4434   ITTNOTIFY_VOID_D3(task_end_overlapped_ex, d, x, y, z)
4435 #define __itt_task_end_overlapped_ex_ptr ITTNOTIFY_NAME(task_end_overlapped_ex)
4436 #else /* INTEL_NO_ITTNOTIFY_API */
4437 #define __itt_task_begin_overlapped_ex(domain, clock_domain, timestamp,        \
4438                                        taskid, parentid, name)
4439 #define __itt_task_begin_overlapped_ex_ptr 0
4440 #define __itt_task_end_overlapped_ex(domain, clock_domain, timestamp, taskid)
4441 #define __itt_task_end_overlapped_ex_ptr 0
4442 #endif /* INTEL_NO_ITTNOTIFY_API */
4443 #else /* INTEL_NO_MACRO_BODY */
4444 #define __itt_task_begin_overlapped_ex_ptr 0
4445 #define __itt_task_end_overlapped_ptr 0
4446 #define __itt_task_end_overlapped_ex_ptr 0
4447 #endif /* INTEL_NO_MACRO_BODY */
4448 /** @endcond */
4449 
4450 /**
4451  * @defgroup makrs_internal Marks
4452  * @ingroup internal
4453  * Marks group
4454  * @warning Internal API:
4455  *   - It is not shipped to outside of Intel
4456  *   - It is delivered to internal Intel teams using e-mail or SVN access only
4457  * @{
4458  */
4459 /** @brief user mark type */
4460 typedef int __itt_mark_type;
4461 
4462 /**
4463  * @brief Creates a user mark type with the specified name using char or Unicode
4464  * string.
4465  * @param[in] name - name of mark to create
4466  * @return Returns a handle to the mark type
4467  */
4468 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4469 __itt_mark_type ITTAPI __itt_mark_createA(const char *name);
4470 __itt_mark_type ITTAPI __itt_mark_createW(const wchar_t *name);
4471 #if defined(UNICODE) || defined(_UNICODE)
4472 #define __itt_mark_create __itt_mark_createW
4473 #define __itt_mark_create_ptr __itt_mark_createW_ptr
4474 #else /* UNICODE */
4475 #define __itt_mark_create __itt_mark_createA
4476 #define __itt_mark_create_ptr __itt_mark_createA_ptr
4477 #endif /* UNICODE */
4478 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4479 __itt_mark_type ITTAPI __itt_mark_create(const char *name);
4480 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4481 
4482 /** @cond exclude_from_documentation */
4483 #ifndef INTEL_NO_MACRO_BODY
4484 #ifndef INTEL_NO_ITTNOTIFY_API
4485 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4486 ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name))
4487 ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name))
4488 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4489 ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name))
4490 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4491 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4492 #define __itt_mark_createA ITTNOTIFY_DATA(mark_createA)
4493 #define __itt_mark_createA_ptr ITTNOTIFY_NAME(mark_createA)
4494 #define __itt_mark_createW ITTNOTIFY_DATA(mark_createW)
4495 #define __itt_mark_createW_ptr ITTNOTIFY_NAME(mark_createW)
4496 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4497 #define __itt_mark_create ITTNOTIFY_DATA(mark_create)
4498 #define __itt_mark_create_ptr ITTNOTIFY_NAME(mark_create)
4499 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4500 #else /* INTEL_NO_ITTNOTIFY_API */
4501 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4502 #define __itt_mark_createA(name) (__itt_mark_type)0
4503 #define __itt_mark_createA_ptr 0
4504 #define __itt_mark_createW(name) (__itt_mark_type)0
4505 #define __itt_mark_createW_ptr 0
4506 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4507 #define __itt_mark_create(name) (__itt_mark_type)0
4508 #define __itt_mark_create_ptr 0
4509 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4510 #endif /* INTEL_NO_ITTNOTIFY_API */
4511 #else /* INTEL_NO_MACRO_BODY */
4512 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4513 #define __itt_mark_createA_ptr 0
4514 #define __itt_mark_createW_ptr 0
4515 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4516 #define __itt_mark_create_ptr 0
4517 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4518 #endif /* INTEL_NO_MACRO_BODY */
4519 /** @endcond */
4520 
4521 /**
4522  * @brief Creates a "discrete" user mark type of the specified type and an
4523  * optional parameter using char or Unicode string.
4524  *
4525  * - The mark of "discrete" type is placed to collection results in case of
4526  * success. It appears in overtime view(s) as a special tick sign.
4527  * - The call is "synchronous" - function returns after mark is actually added
4528  * to results.
4529  * - This function is useful, for example, to mark different phases of
4530  * application (beginning of the next mark automatically meand end of current
4531  * region).
4532  * - Can be used together with "continuous" marks (see below) at the same
4533  * collection session
4534  * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
4535  * @param[in] parameter - string parameter of mark
4536  * @return Returns zero value in case of success, non-zero value otherwise.
4537  */
4538 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4539 int ITTAPI __itt_markA(__itt_mark_type mt, const char *parameter);
4540 int ITTAPI __itt_markW(__itt_mark_type mt, const wchar_t *parameter);
4541 #if defined(UNICODE) || defined(_UNICODE)
4542 #define __itt_mark __itt_markW
4543 #define __itt_mark_ptr __itt_markW_ptr
4544 #else /* UNICODE  */
4545 #define __itt_mark __itt_markA
4546 #define __itt_mark_ptr __itt_markA_ptr
4547 #endif /* UNICODE */
4548 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4549 int ITTAPI __itt_mark(__itt_mark_type mt, const char *parameter);
4550 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4551 
4552 /** @cond exclude_from_documentation */
4553 #ifndef INTEL_NO_MACRO_BODY
4554 #ifndef INTEL_NO_ITTNOTIFY_API
4555 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4556 ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter))
4557 ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter))
4558 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4559 ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter))
4560 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4561 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4562 #define __itt_markA ITTNOTIFY_DATA(markA)
4563 #define __itt_markA_ptr ITTNOTIFY_NAME(markA)
4564 #define __itt_markW ITTNOTIFY_DATA(markW)
4565 #define __itt_markW_ptr ITTNOTIFY_NAME(markW)
4566 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4567 #define __itt_mark ITTNOTIFY_DATA(mark)
4568 #define __itt_mark_ptr ITTNOTIFY_NAME(mark)
4569 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4570 #else /* INTEL_NO_ITTNOTIFY_API */
4571 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4572 #define __itt_markA(mt, parameter) (int)0
4573 #define __itt_markA_ptr 0
4574 #define __itt_markW(mt, parameter) (int)0
4575 #define __itt_markW_ptr 0
4576 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4577 #define __itt_mark(mt, parameter) (int)0
4578 #define __itt_mark_ptr 0
4579 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4580 #endif /* INTEL_NO_ITTNOTIFY_API */
4581 #else /* INTEL_NO_MACRO_BODY */
4582 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4583 #define __itt_markA_ptr 0
4584 #define __itt_markW_ptr 0
4585 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4586 #define __itt_mark_ptr 0
4587 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4588 #endif /* INTEL_NO_MACRO_BODY */
4589 /** @endcond */
4590 
4591 /**
4592  * @brief Use this if necessary to create a "discrete" user event type (mark)
4593  * for process rather then for one thread
4594  * @see int __itt_mark(__itt_mark_type mt, const char* parameter);
4595  */
4596 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4597 int ITTAPI __itt_mark_globalA(__itt_mark_type mt, const char *parameter);
4598 int ITTAPI __itt_mark_globalW(__itt_mark_type mt, const wchar_t *parameter);
4599 #if defined(UNICODE) || defined(_UNICODE)
4600 #define __itt_mark_global __itt_mark_globalW
4601 #define __itt_mark_global_ptr __itt_mark_globalW_ptr
4602 #else /* UNICODE  */
4603 #define __itt_mark_global __itt_mark_globalA
4604 #define __itt_mark_global_ptr __itt_mark_globalA_ptr
4605 #endif /* UNICODE */
4606 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4607 int ITTAPI __itt_mark_global(__itt_mark_type mt, const char *parameter);
4608 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4609 
4610 /** @cond exclude_from_documentation */
4611 #ifndef INTEL_NO_MACRO_BODY
4612 #ifndef INTEL_NO_ITTNOTIFY_API
4613 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4614 ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter))
4615 ITT_STUB(ITTAPI, int, mark_globalW,
4616          (__itt_mark_type mt, const wchar_t *parameter))
4617 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4618 ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter))
4619 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4620 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4621 #define __itt_mark_globalA ITTNOTIFY_DATA(mark_globalA)
4622 #define __itt_mark_globalA_ptr ITTNOTIFY_NAME(mark_globalA)
4623 #define __itt_mark_globalW ITTNOTIFY_DATA(mark_globalW)
4624 #define __itt_mark_globalW_ptr ITTNOTIFY_NAME(mark_globalW)
4625 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4626 #define __itt_mark_global ITTNOTIFY_DATA(mark_global)
4627 #define __itt_mark_global_ptr ITTNOTIFY_NAME(mark_global)
4628 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4629 #else /* INTEL_NO_ITTNOTIFY_API */
4630 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4631 #define __itt_mark_globalA(mt, parameter) (int)0
4632 #define __itt_mark_globalA_ptr 0
4633 #define __itt_mark_globalW(mt, parameter) (int)0
4634 #define __itt_mark_globalW_ptr 0
4635 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4636 #define __itt_mark_global(mt, parameter) (int)0
4637 #define __itt_mark_global_ptr 0
4638 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4639 #endif /* INTEL_NO_ITTNOTIFY_API */
4640 #else /* INTEL_NO_MACRO_BODY */
4641 #if ITT_PLATFORM == ITT_PLATFORM_WIN
4642 #define __itt_mark_globalA_ptr 0
4643 #define __itt_mark_globalW_ptr 0
4644 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4645 #define __itt_mark_global_ptr 0
4646 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
4647 #endif /* INTEL_NO_MACRO_BODY */
4648 /** @endcond */
4649 
4650 /**
4651  * @brief Creates an "end" point for "continuous" mark with specified name.
4652  *
4653  * - Returns zero value in case of success, non-zero value otherwise.
4654  *   Also returns non-zero value when preceding "begin" point for the
4655  *   mark with the same name failed to be created or not created.
4656  * - The mark of "continuous" type is placed to collection results in
4657  *   case of success. It appears in overtime view(s) as a special tick
4658  *   sign (different from "discrete" mark) together with line from
4659  *   corresponding "begin" mark to "end" mark.
4660  * @note Continuous marks can overlap and be nested inside each other.
4661  * Discrete mark can be nested inside marked region
4662  * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
4663  * @return Returns zero value in case of success, non-zero value otherwise.
4664  */
4665 int ITTAPI __itt_mark_off(__itt_mark_type mt);
4666 
4667 /** @cond exclude_from_documentation */
4668 #ifndef INTEL_NO_MACRO_BODY
4669 #ifndef INTEL_NO_ITTNOTIFY_API
4670 ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt))
4671 #define __itt_mark_off ITTNOTIFY_DATA(mark_off)
4672 #define __itt_mark_off_ptr ITTNOTIFY_NAME(mark_off)
4673 #else /* INTEL_NO_ITTNOTIFY_API */
4674 #define __itt_mark_off(mt) (int)0
4675 #define __itt_mark_off_ptr 0
4676 #endif /* INTEL_NO_ITTNOTIFY_API */
4677 #else /* INTEL_NO_MACRO_BODY */
4678 #define __itt_mark_off_ptr 0
4679 #endif /* INTEL_NO_MACRO_BODY */
4680 /** @endcond */
4681 
4682 /**
4683  * @brief Use this if necessary to create an "end" point for mark of process
4684  * @see int __itt_mark_off(__itt_mark_type mt);
4685  */
4686 int ITTAPI __itt_mark_global_off(__itt_mark_type mt);
4687 
4688 /** @cond exclude_from_documentation */
4689 #ifndef INTEL_NO_MACRO_BODY
4690 #ifndef INTEL_NO_ITTNOTIFY_API
4691 ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt))
4692 #define __itt_mark_global_off ITTNOTIFY_DATA(mark_global_off)
4693 #define __itt_mark_global_off_ptr ITTNOTIFY_NAME(mark_global_off)
4694 #else /* INTEL_NO_ITTNOTIFY_API */
4695 #define __itt_mark_global_off(mt) (int)0
4696 #define __itt_mark_global_off_ptr 0
4697 #endif /* INTEL_NO_ITTNOTIFY_API */
4698 #else /* INTEL_NO_MACRO_BODY */
4699 #define __itt_mark_global_off_ptr 0
4700 #endif /* INTEL_NO_MACRO_BODY */
4701 /** @endcond */
4702 /** @} marks group */
4703 
4704 /**
4705  * @defgroup counters_internal Counters
4706  * @ingroup internal
4707  * Counters group
4708  * @{
4709  */
4710 
4711 /**
4712  * @defgroup stitch Stack Stitching
4713  * @ingroup internal
4714  * Stack Stitching group
4715  * @{
4716  */
4717 /**
4718  * @brief opaque structure for counter identification
4719  */
4720 typedef struct ___itt_caller *__itt_caller;
4721 
4722 /**
4723  * @brief Create the stitch point e.g. a point in call stack where other stacks
4724  * should be stitched to. The function returns a unique identifier which is used
4725  * to match the cut points with corresponding stitch points.
4726  */
4727 __itt_caller ITTAPI __itt_stack_caller_create(void);
4728 
4729 /** @cond exclude_from_documentation */
4730 #ifndef INTEL_NO_MACRO_BODY
4731 #ifndef INTEL_NO_ITTNOTIFY_API
4732 ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
4733 #define __itt_stack_caller_create ITTNOTIFY_DATA(stack_caller_create)
4734 #define __itt_stack_caller_create_ptr ITTNOTIFY_NAME(stack_caller_create)
4735 #else /* INTEL_NO_ITTNOTIFY_API */
4736 #define __itt_stack_caller_create() (__itt_caller)0
4737 #define __itt_stack_caller_create_ptr 0
4738 #endif /* INTEL_NO_ITTNOTIFY_API */
4739 #else /* INTEL_NO_MACRO_BODY */
4740 #define __itt_stack_caller_create_ptr 0
4741 #endif /* INTEL_NO_MACRO_BODY */
4742 /** @endcond */
4743 
4744 /**
4745  * @brief Destroy the information about stitch point identified by the pointer
4746  * previously returned by __itt_stack_caller_create()
4747  */
4748 void ITTAPI __itt_stack_caller_destroy(__itt_caller id);
4749 
4750 /** @cond exclude_from_documentation */
4751 #ifndef INTEL_NO_MACRO_BODY
4752 #ifndef INTEL_NO_ITTNOTIFY_API
4753 ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id))
4754 #define __itt_stack_caller_destroy ITTNOTIFY_VOID(stack_caller_destroy)
4755 #define __itt_stack_caller_destroy_ptr ITTNOTIFY_NAME(stack_caller_destroy)
4756 #else /* INTEL_NO_ITTNOTIFY_API */
4757 #define __itt_stack_caller_destroy(id)
4758 #define __itt_stack_caller_destroy_ptr 0
4759 #endif /* INTEL_NO_ITTNOTIFY_API */
4760 #else /* INTEL_NO_MACRO_BODY */
4761 #define __itt_stack_caller_destroy_ptr 0
4762 #endif /* INTEL_NO_MACRO_BODY */
4763 /** @endcond */
4764 
4765 /**
4766  * @brief Sets the cut point. Stack from each event which occurs after this call
4767  * will be cut at the same stack level the function was called and stitched to
4768  * the corresponding stitch point.
4769  */
4770 void ITTAPI __itt_stack_callee_enter(__itt_caller id);
4771 
4772 /** @cond exclude_from_documentation */
4773 #ifndef INTEL_NO_MACRO_BODY
4774 #ifndef INTEL_NO_ITTNOTIFY_API
4775 ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id))
4776 #define __itt_stack_callee_enter ITTNOTIFY_VOID(stack_callee_enter)
4777 #define __itt_stack_callee_enter_ptr ITTNOTIFY_NAME(stack_callee_enter)
4778 #else /* INTEL_NO_ITTNOTIFY_API */
4779 #define __itt_stack_callee_enter(id)
4780 #define __itt_stack_callee_enter_ptr 0
4781 #endif /* INTEL_NO_ITTNOTIFY_API */
4782 #else /* INTEL_NO_MACRO_BODY */
4783 #define __itt_stack_callee_enter_ptr 0
4784 #endif /* INTEL_NO_MACRO_BODY */
4785 /** @endcond */
4786 
4787 /**
4788  * @brief This function eliminates the cut point which was set by latest
4789  * __itt_stack_callee_enter().
4790  */
4791 void ITTAPI __itt_stack_callee_leave(__itt_caller id);
4792 
4793 /** @cond exclude_from_documentation */
4794 #ifndef INTEL_NO_MACRO_BODY
4795 #ifndef INTEL_NO_ITTNOTIFY_API
4796 ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id))
4797 #define __itt_stack_callee_leave ITTNOTIFY_VOID(stack_callee_leave)
4798 #define __itt_stack_callee_leave_ptr ITTNOTIFY_NAME(stack_callee_leave)
4799 #else /* INTEL_NO_ITTNOTIFY_API */
4800 #define __itt_stack_callee_leave(id)
4801 #define __itt_stack_callee_leave_ptr 0
4802 #endif /* INTEL_NO_ITTNOTIFY_API */
4803 #else /* INTEL_NO_MACRO_BODY */
4804 #define __itt_stack_callee_leave_ptr 0
4805 #endif /* INTEL_NO_MACRO_BODY */
4806 /** @endcond */
4807 
4808 /** @} stitch group */
4809 
4810 /* *****************************************************************************************************************************
4811  */
4812 
4813 #include <stdarg.h>
4814 
4815 /** @cond exclude_from_documentation */
4816 typedef enum __itt_error_code {
4817   __itt_error_success = 0, /*!< no error */
4818   __itt_error_no_module = 1, /*!< module can't be loaded */
4819   /* %1$s -- library name; win: %2$d -- system error code; unx: %2$s -- system
4820      error message. */
4821   __itt_error_no_symbol = 2, /*!< symbol not found */
4822   /* %1$s -- library name, %2$s -- symbol name. */
4823   __itt_error_unknown_group = 3, /*!< unknown group specified */
4824   /* %1$s -- env var name, %2$s -- group name. */
4825   __itt_error_cant_read_env = 4, /*!< GetEnvironmentVariable() failed */
4826   /* %1$s -- env var name, %2$d -- system error. */
4827   __itt_error_env_too_long = 5, /*!< variable value too long */
4828   /* %1$s -- env var name, %2$d -- actual length of the var, %3$d -- max allowed
4829      length. */
4830   __itt_error_system =
4831       6 /*!< pthread_mutexattr_init or pthread_mutex_init failed */
4832   /* %1$s -- function name, %2$d -- errno. */
4833 } __itt_error_code;
4834 
4835 typedef void(__itt_error_handler_t)(__itt_error_code code, va_list);
4836 __itt_error_handler_t *__itt_set_error_handler(__itt_error_handler_t *);
4837 
4838 const char *ITTAPI __itt_api_version(void);
4839 /** @endcond */
4840 
4841 /** @cond exclude_from_documentation */
4842 #ifndef INTEL_NO_MACRO_BODY
4843 #ifndef INTEL_NO_ITTNOTIFY_API
4844 #define __itt_error_handler ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, error_handler)
4845 void __itt_error_handler(__itt_error_code code, va_list args);
4846 extern const int ITTNOTIFY_NAME(err);
4847 #define __itt_err ITTNOTIFY_NAME(err)
4848 ITT_STUB(ITTAPI, const char *, api_version, (void))
4849 #define __itt_api_version ITTNOTIFY_DATA(api_version)
4850 #define __itt_api_version_ptr ITTNOTIFY_NAME(api_version)
4851 #else /* INTEL_NO_ITTNOTIFY_API */
4852 #define __itt_api_version() (const char *)0
4853 #define __itt_api_version_ptr 0
4854 #endif /* INTEL_NO_ITTNOTIFY_API */
4855 #else /* INTEL_NO_MACRO_BODY */
4856 #define __itt_api_version_ptr 0
4857 #endif /* INTEL_NO_MACRO_BODY */
4858 /** @endcond */
4859 
4860 #ifdef __cplusplus
4861 }
4862 #endif /* __cplusplus */
4863 
4864 #endif /* _ITTNOTIFY_PRIVATE_ */
4865 
4866 #endif /* INTEL_ITTNOTIFY_API_PRIVATE */
4867