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_ARM64EC || defined __arm64ec__
177#define ITT_ARCH ITT_ARCH_ARM64
178#elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__
179#define ITT_ARCH ITT_ARCH_IA32E
180#elif defined _M_IA64 || defined __ia64__
181#define ITT_ARCH ITT_ARCH_IA64
182#elif defined _M_ARM || defined __arm__
183#define ITT_ARCH ITT_ARCH_ARM
184#elif defined __aarch64__
185#define ITT_ARCH ITT_ARCH_ARM64
186#elif defined __powerpc64__
187#define ITT_ARCH ITT_ARCH_PPC64
189#define ITT_ARCH ITT_ARCH_VE
190#elif defined __s390x__
191#define ITT_ARCH ITT_ARCH_S390X
196#define ITT_EXTERN_C extern "C"
197#define ITT_EXTERN_C_BEGIN extern "C" {
198#define ITT_EXTERN_C_END }
201#define ITT_EXTERN_C_BEGIN
202#define ITT_EXTERN_C_END
205#define ITT_TO_STR_AUX(x) #x
206#define ITT_TO_STR(x) ITT_TO_STR_AUX(x)
208#define __ITT_BUILD_ASSERT(expr, suffix) \
210 static char __itt_build_check_##suffix[(expr) ? 1 : -1]; \
211 __itt_build_check_##suffix[0] = 0; \
213#define _ITT_BUILD_ASSERT(expr, suffix) __ITT_BUILD_ASSERT((expr), suffix)
214#define ITT_BUILD_ASSERT(expr) _ITT_BUILD_ASSERT((expr), __LINE__)
217 { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
220#define API_VERSION_BUILD 20180723
222#ifndef API_VERSION_NUM
223#define API_VERSION_NUM 3.20.1
227 "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) " (" ITT_TO_STR( \
228 API_VERSION_BUILD) ")"
231#if ITT_PLATFORM == ITT_PLATFORM_WIN
237#define MUTEX_INITIALIZER \
240#define MUTEX_INITIALIZER \
243#define strong_alias(name, aliasname)
246#if defined(UNICODE) || defined(_UNICODE)
253#define __USE_UNIX98 \
259typedef pthread_t
TIDT;
260typedef pthread_mutex_t
mutex_t;
261#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
262#define _strong_alias(name, aliasname) \
263 extern __typeof(name) aliasname __attribute__((alias(#name)));
264#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
267#if ITT_PLATFORM == ITT_PLATFORM_WIN
268#define __itt_get_proc(lib, name) GetProcAddress(lib, name)
269#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
270#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
271#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
272#define __itt_load_lib(name) LoadLibraryA(name)
273#define __itt_unload_lib(handle) FreeLibrary(handle)
274#define __itt_system_error() (int)GetLastError()
275#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
276#define __itt_fstrnlen(s, l) strnlen_s(s, l)
277#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
278#define __itt_fstrdup(s) _strdup(s)
279#define __itt_thread_id() GetCurrentThreadId()
280#define __itt_thread_yield() SwitchToThread()
281#ifndef ITT_SIMPLE_INIT
285 return InterlockedIncrement(ptr);
289#define DL_SYMBOLS (1)
290#define PTHREAD_SYMBOLS (1)
293#define __itt_get_proc(lib, name) dlsym(lib, name)
294#define __itt_mutex_init(mutex) \
296 pthread_mutexattr_t mutex_attr; \
297 int error_code = pthread_mutexattr_init(&mutex_attr); \
299 __itt_report_error(__itt_error_system, "pthread_mutexattr_init", \
302 pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); \
304 __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \
306 error_code = pthread_mutex_init(mutex, &mutex_attr); \
308 __itt_report_error(__itt_error_system, "pthread_mutex_init", \
310 error_code = pthread_mutexattr_destroy(&mutex_attr); \
312 __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \
315#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
316#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
317#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
318#define __itt_unload_lib(handle) dlclose(handle)
319#define __itt_system_error() errno
320#define __itt_fstrcmp(s1, s2) strcmp(s1, s2)
324#define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l)
326#define __itt_fstrnlen(s, l) strlen(s)
329#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
331#define __itt_fstrcpyn(s1, b, s2, l) \
336 volatile size_t num_to_copy = \
337 (size_t)(b - 1) < (size_t)(l) ? (size_t)(b - 1) : (size_t)(l); \
338 strncpy(s1, s2, num_to_copy); \
339 s1[num_to_copy] = 0; \
344#define __itt_fstrdup(s) strdup(s)
345#define __itt_thread_id() pthread_self()
346#define __itt_thread_yield() sched_yield()
347#if ITT_ARCH == ITT_ARCH_IA64
348#ifdef __INTEL_COMPILER
349#define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val)
353#elif ITT_ARCH == ITT_ARCH_IA32 || \
354 ITT_ARCH == ITT_ARCH_IA32E
355ITT_INLINE
long __TBB_machine_fetchadd4(
volatile void *ptr,
356 long addend) ITT_INLINE_ATTRIBUTE;
357ITT_INLINE
long __TBB_machine_fetchadd4(
volatile void *ptr,
long addend) {
359 __asm__ __volatile__(
"lock\nxadd %0,%1"
360 :
"=r"(
result),
"=m"(*(
volatile int *)ptr)
361 :
"0"(addend),
"m"(*(
volatile int *)ptr)
366#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
368#ifndef ITT_SIMPLE_INIT
372 return __TBB_machine_fetchadd4(ptr, 1) + 1L;
379#define DL_SYMBOLS (dlopen && dlsym && dlclose)
381int pthread_mutex_init(pthread_mutex_t *,
const pthread_mutexattr_t *)
383int pthread_mutex_lock(pthread_mutex_t *)
__attribute__((weak));
384int pthread_mutex_unlock(pthread_mutex_t *)
__attribute__((weak));
385int pthread_mutex_destroy(pthread_mutex_t *)
__attribute__((weak));
386int pthread_mutexattr_init(pthread_mutexattr_t *)
__attribute__((weak));
387int pthread_mutexattr_settype(pthread_mutexattr_t *,
int)
__attribute__((weak));
388int pthread_mutexattr_destroy(pthread_mutexattr_t *)
__attribute__((weak));
390#define PTHREAD_SYMBOLS \
391 (pthread_mutex_init && pthread_mutex_lock && pthread_mutex_unlock && \
392 pthread_mutex_destroy && pthread_mutexattr_init && \
393 pthread_mutexattr_settype && pthread_mutexattr_destroy && pthread_self)
411#if defined(UNICODE) || defined(_UNICODE)
412 const wchar_t *
nameW;
442#if defined(UNICODE) || defined(_UNICODE)
443 const wchar_t *
nameW;
448#if defined(UNICODE) || defined(_UNICODE)
461struct ___itt_string_handle;
462struct ___itt_histogram;
490#define NEW_THREAD_INFO_W(gptr, h, h_tail, t, s, n) \
492 h = (__itt_thread_info *)malloc(sizeof(__itt_thread_info)); \
496 h->nameW = n ? _wcsdup(n) : NULL; \
501 if (h_tail == NULL) \
502 (gptr)->thread_list = h; \
508#define NEW_THREAD_INFO_A(gptr, h, h_tail, t, s, n) \
510 h = (__itt_thread_info *)malloc(sizeof(__itt_thread_info)); \
513 h->nameA = n ? __itt_fstrdup(n) : NULL; \
519 if (h_tail == NULL) \
520 (gptr)->thread_list = h; \
526#define NEW_DOMAIN_W(gptr, h, h_tail, name) \
528 h = (__itt_domain *)malloc(sizeof(__itt_domain)); \
532 h->nameW = name ? _wcsdup(name) : NULL; \
536 if (h_tail == NULL) \
537 (gptr)->domain_list = h; \
543#define NEW_DOMAIN_A(gptr, h, h_tail, name) \
545 h = (__itt_domain *)malloc(sizeof(__itt_domain)); \
548 h->nameA = name ? __itt_fstrdup(name) : NULL; \
553 if (h_tail == NULL) \
554 (gptr)->domain_list = h; \
560#define NEW_STRING_HANDLE_W(gptr, h, h_tail, name) \
562 h = (__itt_string_handle *)malloc(sizeof(__itt_string_handle)); \
565 h->strW = name ? _wcsdup(name) : NULL; \
569 if (h_tail == NULL) \
570 (gptr)->string_list = h; \
576#define NEW_STRING_HANDLE_A(gptr, h, h_tail, name) \
578 h = (__itt_string_handle *)malloc(sizeof(__itt_string_handle)); \
580 h->strA = name ? __itt_fstrdup(name) : NULL; \
585 if (h_tail == NULL) \
586 (gptr)->string_list = h; \
592#define NEW_COUNTER_W(gptr, h, h_tail, name, domain, type) \
594 h = (__itt_counter_info_t *)malloc(sizeof(__itt_counter_info_t)); \
597 h->nameW = name ? _wcsdup(name) : NULL; \
599 h->domainW = name ? _wcsdup(domain) : NULL; \
603 if (h_tail == NULL) \
604 (gptr)->counter_list = h; \
610#define NEW_COUNTER_A(gptr, h, h_tail, name, domain, type) \
612 h = (__itt_counter_info_t *)malloc(sizeof(__itt_counter_info_t)); \
614 h->nameA = name ? __itt_fstrdup(name) : NULL; \
616 h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
621 if (h_tail == NULL) \
622 (gptr)->counter_list = h; \
628#define NEW_HISTOGRAM_W(gptr, h, h_tail, domain, name, x_type, y_type) \
630 h = (__itt_histogram *)malloc(sizeof(__itt_histogram)); \
632 h->domain = domain; \
634 h->nameW = name ? _wcsdup(name) : NULL; \
635 h->x_type = x_type; \
636 h->y_type = y_type; \
639 if (h_tail == NULL) \
640 (gptr)->histogram_list = h; \
646#define NEW_HISTOGRAM_A(gptr, h, h_tail, domain, name, x_type, y_type) \
648 h = (__itt_histogram *)malloc(sizeof(__itt_histogram)); \
650 h->domain = domain; \
651 h->nameA = name ? __itt_fstrdup(name) : NULL; \
653 h->x_type = x_type; \
654 h->y_type = y_type; \
657 if (h_tail == NULL) \
658 (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.