Coverage Report

Created: 2023-04-25 07:07

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