Debian Codegraph @

crt/aws-c-common/include/aws/common/external/ittnotify.h

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