10#ifndef _ITTNOTIFY_CONFIG_H_
11#define _ITTNOTIFY_CONFIG_H_
27#define ITT_OS_FREEBSD 4
31#if defined WIN32 || defined _WIN32
32#define ITT_OS ITT_OS_WIN
33#elif defined(__APPLE__) && defined(__MACH__)
34#define ITT_OS ITT_OS_MAC
35#elif defined(__FreeBSD__)
36#define ITT_OS ITT_OS_FREEBSD
38#define ITT_OS ITT_OS_LINUX
42#ifndef ITT_PLATFORM_WIN
43#define ITT_PLATFORM_WIN 1
46#ifndef ITT_PLATFORM_POSIX
47#define ITT_PLATFORM_POSIX 2
50#ifndef ITT_PLATFORM_MAC
51#define ITT_PLATFORM_MAC 3
54#ifndef ITT_PLATFORM_FREEBSD
55#define ITT_PLATFORM_FREEBSD 4
59#if ITT_OS == ITT_OS_WIN
60#define ITT_PLATFORM ITT_PLATFORM_WIN
61#elif ITT_OS == ITT_OS_MAC
62#define ITT_PLATFORM ITT_PLATFORM_MAC
63#elif ITT_OS == ITT_OS_FREEBSD
64#define ITT_PLATFORM ITT_PLATFORM_FREEBSD
66#define ITT_PLATFORM ITT_PLATFORM_POSIX
70#if defined(_UNICODE) && !defined(UNICODE)
75#if ITT_PLATFORM == ITT_PLATFORM_WIN
79#if defined(UNICODE) || defined(_UNICODE)
85#if ITT_PLATFORM == ITT_PLATFORM_WIN
86#define ITTAPI_CDECL __cdecl
88#if defined _M_IX86 || defined __i386__
89#define ITTAPI_CDECL __attribute__((cdecl))
97#if ITT_PLATFORM == ITT_PLATFORM_WIN
98#define STDCALL __stdcall
100#if defined _M_IX86 || defined __i386__
101#define STDCALL __attribute__((stdcall))
108#define ITTAPI ITTAPI_CDECL
109#define LIBITTAPI ITTAPI_CDECL
112#define ITTAPI_CALL ITTAPI_CDECL
113#define LIBITTAPI_CALL ITTAPI_CDECL
115#if ITT_PLATFORM == ITT_PLATFORM_WIN
117#if defined(__MINGW32__) && !defined(__cplusplus)
119 static __inline__ __attribute__((__always_inline__, __gnu_inline__))
121#define ITT_INLINE static __forceinline
124#define ITT_INLINE_ATTRIBUTE
131#ifdef __STRICT_ANSI__
132#define ITT_INLINE static
133#define ITT_INLINE_ATTRIBUTE __attribute__((unused))
135#define ITT_INLINE static inline
136#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
142#define ITT_ARCH_IA32 1
145#ifndef ITT_ARCH_IA32E
146#define ITT_ARCH_IA32E 2
150#define ITT_ARCH_IA64 3
154#define ITT_ARCH_ARM 4
157#ifndef ITT_ARCH_PPC64
158#define ITT_ARCH_PPC64 5
161#ifndef ITT_ARCH_ARM64
162#define ITT_ARCH_ARM64 6
169#ifndef ITT_ARCH_S390X
170#define ITT_ARCH_S390X 8
174#if defined _M_IX86 || defined __i386__
175#define ITT_ARCH ITT_ARCH_IA32
176#elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__
177#define ITT_ARCH ITT_ARCH_IA32E
178#elif defined _M_IA64 || defined __ia64__
179#define ITT_ARCH ITT_ARCH_IA64
180#elif defined _M_ARM || defined __arm__
181#define ITT_ARCH ITT_ARCH_ARM
182#elif defined __aarch64__
183#define ITT_ARCH ITT_ARCH_ARM64
184#elif defined __powerpc64__
185#define ITT_ARCH ITT_ARCH_PPC64
187#define ITT_ARCH ITT_ARCH_VE
188#elif defined __s390x__
189#define ITT_ARCH ITT_ARCH_S390X
194#define ITT_EXTERN_C extern "C"
195#define ITT_EXTERN_C_BEGIN extern "C" {
196#define ITT_EXTERN_C_END }
199#define ITT_EXTERN_C_BEGIN
200#define ITT_EXTERN_C_END
203#define ITT_TO_STR_AUX(x) #x
204#define ITT_TO_STR(x) ITT_TO_STR_AUX(x)
206#define __ITT_BUILD_ASSERT(expr, suffix) \
208 static char __itt_build_check_##suffix[(expr) ? 1 : -1]; \
209 __itt_build_check_##suffix[0] = 0; \
211#define _ITT_BUILD_ASSERT(expr, suffix) __ITT_BUILD_ASSERT((expr), suffix)
212#define ITT_BUILD_ASSERT(expr) _ITT_BUILD_ASSERT((expr), __LINE__)
215 { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
218#define API_VERSION_BUILD 20180723
220#ifndef API_VERSION_NUM
221#define API_VERSION_NUM 3.20.1
225 "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) " (" ITT_TO_STR( \
226 API_VERSION_BUILD) ")"
229#if ITT_PLATFORM == ITT_PLATFORM_WIN
235#define MUTEX_INITIALIZER \
238#define MUTEX_INITIALIZER \
241#define strong_alias(name, aliasname)
244#if defined(UNICODE) || defined(_UNICODE)
251#define __USE_UNIX98 \
257typedef pthread_t
TIDT;
258typedef pthread_mutex_t
mutex_t;
259#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
260#define _strong_alias(name, aliasname) \
261 extern __typeof(name) aliasname __attribute__((alias(#name)));
262#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
265#if ITT_PLATFORM == ITT_PLATFORM_WIN
266#define __itt_get_proc(lib, name) GetProcAddress(lib, name)
267#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
268#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
269#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
270#define __itt_load_lib(name) LoadLibraryA(name)
271#define __itt_unload_lib(handle) FreeLibrary(handle)
272#define __itt_system_error() (int)GetLastError()
273#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
274#define __itt_fstrnlen(s, l) strnlen_s(s, l)
275#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
276#define __itt_fstrdup(s) _strdup(s)
277#define __itt_thread_id() GetCurrentThreadId()
278#define __itt_thread_yield() SwitchToThread()
279#ifndef ITT_SIMPLE_INIT
283 return InterlockedIncrement(ptr);
287#define DL_SYMBOLS (1)
288#define PTHREAD_SYMBOLS (1)
291#define __itt_get_proc(lib, name) dlsym(lib, name)
292#define __itt_mutex_init(mutex) \
294 pthread_mutexattr_t mutex_attr; \
295 int error_code = pthread_mutexattr_init(&mutex_attr); \
297 __itt_report_error(__itt_error_system, "pthread_mutexattr_init", \
300 pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); \
302 __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \
304 error_code = pthread_mutex_init(mutex, &mutex_attr); \
306 __itt_report_error(__itt_error_system, "pthread_mutex_init", \
308 error_code = pthread_mutexattr_destroy(&mutex_attr); \
310 __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \
313#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
314#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
315#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
316#define __itt_unload_lib(handle) dlclose(handle)
317#define __itt_system_error() errno
318#define __itt_fstrcmp(s1, s2) strcmp(s1, s2)
322#define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l)
324#define __itt_fstrnlen(s, l) strlen(s)
327#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
329#define __itt_fstrcpyn(s1, b, s2, l) \
334 volatile size_t num_to_copy = \
335 (size_t)(b - 1) < (size_t)(l) ? (size_t)(b - 1) : (size_t)(l); \
336 strncpy(s1, s2, num_to_copy); \
337 s1[num_to_copy] = 0; \
342#define __itt_fstrdup(s) strdup(s)
343#define __itt_thread_id() pthread_self()
344#define __itt_thread_yield() sched_yield()
345#if ITT_ARCH == ITT_ARCH_IA64
346#ifdef __INTEL_COMPILER
347#define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val)
351#elif ITT_ARCH == ITT_ARCH_IA32 || \
352 ITT_ARCH == ITT_ARCH_IA32E
353ITT_INLINE
long __TBB_machine_fetchadd4(
volatile void *ptr,
354 long addend) ITT_INLINE_ATTRIBUTE;
355ITT_INLINE
long __TBB_machine_fetchadd4(
volatile void *ptr,
long addend) {
357 __asm__ __volatile__(
"lock\nxadd %0,%1"
358 :
"=r"(
result),
"=m"(*(
volatile int *)ptr)
359 :
"0"(addend),
"m"(*(
volatile int *)ptr)
364#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
366#ifndef ITT_SIMPLE_INIT
370 return __TBB_machine_fetchadd4(ptr, 1) + 1L;
377#define DL_SYMBOLS (dlopen && dlsym && dlclose)
379int pthread_mutex_init(pthread_mutex_t *,
const pthread_mutexattr_t *)
381int pthread_mutex_lock(pthread_mutex_t *)
__attribute__((weak));
382int pthread_mutex_unlock(pthread_mutex_t *)
__attribute__((weak));
383int pthread_mutex_destroy(pthread_mutex_t *)
__attribute__((weak));
384int pthread_mutexattr_init(pthread_mutexattr_t *)
__attribute__((weak));
385int pthread_mutexattr_settype(pthread_mutexattr_t *,
int)
__attribute__((weak));
386int pthread_mutexattr_destroy(pthread_mutexattr_t *)
__attribute__((weak));
388#define PTHREAD_SYMBOLS \
389 (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && \
390 pthread_mutex_destroy && pthread_mutexattr_init && \
391 pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
409#if defined(UNICODE) || defined(_UNICODE)
410 const wchar_t *
nameW;
440#if defined(UNICODE) || defined(_UNICODE)
441 const wchar_t *
nameW;
446#if defined(UNICODE) || defined(_UNICODE)
459struct ___itt_string_handle;
460struct ___itt_histogram;
488#define NEW_THREAD_INFO_W(gptr, h, h_tail, t, s, n) \
490 h = (__itt_thread_info *)malloc(sizeof(__itt_thread_info)); \
494 h->nameW = n ? _wcsdup(n) : NULL; \
499 if (h_tail == NULL) \
500 (gptr)->thread_list = h; \
506#define NEW_THREAD_INFO_A(gptr, h, h_tail, t, s, n) \
508 h = (__itt_thread_info *)malloc(sizeof(__itt_thread_info)); \
511 h->nameA = n ? __itt_fstrdup(n) : NULL; \
517 if (h_tail == NULL) \
518 (gptr)->thread_list = h; \
524#define NEW_DOMAIN_W(gptr, h, h_tail, name) \
526 h = (__itt_domain *)malloc(sizeof(__itt_domain)); \
530 h->nameW = name ? _wcsdup(name) : NULL; \
534 if (h_tail == NULL) \
535 (gptr)->domain_list = h; \
541#define NEW_DOMAIN_A(gptr, h, h_tail, name) \
543 h = (__itt_domain *)malloc(sizeof(__itt_domain)); \
546 h->nameA = name ? __itt_fstrdup(name) : NULL; \
551 if (h_tail == NULL) \
552 (gptr)->domain_list = h; \
558#define NEW_STRING_HANDLE_W(gptr, h, h_tail, name) \
560 h = (__itt_string_handle *)malloc(sizeof(__itt_string_handle)); \
563 h->strW = name ? _wcsdup(name) : NULL; \
567 if (h_tail == NULL) \
568 (gptr)->string_list = h; \
574#define NEW_STRING_HANDLE_A(gptr, h, h_tail, name) \
576 h = (__itt_string_handle *)malloc(sizeof(__itt_string_handle)); \
578 h->strA = name ? __itt_fstrdup(name) : NULL; \
583 if (h_tail == NULL) \
584 (gptr)->string_list = h; \
590#define NEW_COUNTER_W(gptr, h, h_tail, name, domain, type) \
592 h = (__itt_counter_info_t *)malloc(sizeof(__itt_counter_info_t)); \
595 h->nameW = name ? _wcsdup(name) : NULL; \
597 h->domainW = name ? _wcsdup(domain) : NULL; \
601 if (h_tail == NULL) \
602 (gptr)->counter_list = h; \
608#define NEW_COUNTER_A(gptr, h, h_tail, name, domain, type) \
610 h = (__itt_counter_info_t *)malloc(sizeof(__itt_counter_info_t)); \
612 h->nameA = name ? __itt_fstrdup(name) : NULL; \
614 h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
619 if (h_tail == NULL) \
620 (gptr)->counter_list = h; \
626#define NEW_HISTOGRAM_W(gptr, h, h_tail, domain, name, x_type, y_type) \
628 h = (__itt_histogram *)malloc(sizeof(__itt_histogram)); \
630 h->domain = domain; \
632 h->nameW = name ? _wcsdup(name) : NULL; \
633 h->x_type = x_type; \
634 h->y_type = y_type; \
637 if (h_tail == NULL) \
638 (gptr)->histogram_list = h; \
644#define NEW_HISTOGRAM_A(gptr, h, h_tail, domain, name, x_type, y_type) \
646 h = (__itt_histogram *)malloc(sizeof(__itt_histogram)); \
648 h->domain = domain; \
649 h->nameA = name ? __itt_fstrdup(name) : NULL; \
651 h->x_type = x_type; \
652 h->y_type = y_type; \
655 if (h_tail == NULL) \
656 (gptr)->histogram_list = h; \
struct __itt_counter_info __itt_counter_info_t
@ __itt_collection_paused
@ __itt_collection_normal
ITT_INLINE long __itt_interlocked_increment(volatile long *ptr) ITT_INLINE_ATTRIBUTE
struct ___itt_global __itt_global
struct ___itt_api_info_20101001 __itt_api_info_20101001
struct ___itt_api_info __itt_api_info
struct ___itt_thread_info __itt_thread_info
enum ___itt_group_id __itt_group_id
__attribute__((noinline))
struct ___itt_domain * domain_list
volatile long atomic_counter
unsigned long version_minor
unsigned long version_build
struct ___itt_histogram * histogram_list
unsigned int ipt_collect_events
volatile long mutex_initialized
const char ** dll_path_ptr
__itt_counter_info_t * counter_list
__itt_thread_info * thread_list
unsigned long version_major
__itt_api_info * api_list_ptr
struct ___itt_string_handle * string_list
struct ___itt_global * next
volatile long api_initialized
__itt_collection_state state
struct ___itt_thread_info * next
int extra1
Reserved to the runtime.
void * extra2
Reserved to the runtime.
__itt_thread_state state
Thread state (paused or normal)
const char * nameA
Copy of original name in ASCII.
const char * nameA
Copy of original name in ASCII.
void * extra2
Reserved to the runtime.
int extra1
Reserved to the runtime.
struct __itt_counter_info * next
const char * domainA
Copy of original name in ASCII.