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