LLVM OpenMP
ittnotify_config.h
Go to the documentation of this file.
1
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _ITTNOTIFY_CONFIG_H_
11#define _ITTNOTIFY_CONFIG_H_
12
13/** @cond exclude_from_documentation */
14#ifndef ITT_OS_WIN
15#define ITT_OS_WIN 1
16#endif /* ITT_OS_WIN */
17
18#ifndef ITT_OS_LINUX
19#define ITT_OS_LINUX 2
20#endif /* ITT_OS_LINUX */
21
22#ifndef ITT_OS_MAC
23#define ITT_OS_MAC 3
24#endif /* ITT_OS_MAC */
25
26#ifndef ITT_OS_FREEBSD
27#define ITT_OS_FREEBSD 4
28#endif /* ITT_OS_FREEBSD */
29
30#ifndef ITT_OS
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
37#else
38#define ITT_OS ITT_OS_LINUX
39#endif
40#endif /* ITT_OS */
41
42#ifndef ITT_PLATFORM_WIN
43#define ITT_PLATFORM_WIN 1
44#endif /* ITT_PLATFORM_WIN */
45
46#ifndef ITT_PLATFORM_POSIX
47#define ITT_PLATFORM_POSIX 2
48#endif /* ITT_PLATFORM_POSIX */
49
50#ifndef ITT_PLATFORM_MAC
51#define ITT_PLATFORM_MAC 3
52#endif /* ITT_PLATFORM_MAC */
53
54#ifndef ITT_PLATFORM_FREEBSD
55#define ITT_PLATFORM_FREEBSD 4
56#endif /* ITT_PLATFORM_FREEBSD */
57
58#ifndef ITT_PLATFORM
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
65#else
66#define ITT_PLATFORM ITT_PLATFORM_POSIX
67#endif
68#endif /* ITT_PLATFORM */
69
70#if defined(_UNICODE) && !defined(UNICODE)
71#define UNICODE
72#endif
73
74#include <stddef.h>
75#if ITT_PLATFORM == ITT_PLATFORM_WIN
76#include <tchar.h>
77#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
78#include <stdint.h>
79#if defined(UNICODE) || defined(_UNICODE)
80#include <wchar.h>
81#endif /* UNICODE || _UNICODE */
82#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
83
84#ifndef ITTAPI_CDECL
85#if ITT_PLATFORM == ITT_PLATFORM_WIN
86#define ITTAPI_CDECL __cdecl
87#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
88#if defined _M_IX86 || defined __i386__
89#define ITTAPI_CDECL __attribute__((cdecl))
90#else /* _M_IX86 || __i386__ */
91#define ITTAPI_CDECL /* actual only on x86 platform */
92#endif /* _M_IX86 || __i386__ */
93#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
94#endif /* ITTAPI_CDECL */
95
96#ifndef STDCALL
97#if ITT_PLATFORM == ITT_PLATFORM_WIN
98#define STDCALL __stdcall
99#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
100#if defined _M_IX86 || defined __i386__
101#define STDCALL __attribute__((stdcall))
102#else /* _M_IX86 || __i386__ */
103#define STDCALL /* supported only on x86 platform */
104#endif /* _M_IX86 || __i386__ */
105#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
106#endif /* STDCALL */
107
108#define ITTAPI ITTAPI_CDECL
109#define LIBITTAPI ITTAPI_CDECL
110
111/* TODO: Temporary for compatibility! */
112#define ITTAPI_CALL ITTAPI_CDECL
113#define LIBITTAPI_CALL ITTAPI_CDECL
114
115#if ITT_PLATFORM == ITT_PLATFORM_WIN
116/* use __forceinline (VC++ specific) */
117#if defined(__MINGW32__) && !defined(__cplusplus)
118#define ITT_INLINE \
119 static __inline__ __attribute__((__always_inline__, __gnu_inline__))
120#else
121#define ITT_INLINE static __forceinline
122#endif /* __MINGW32__ */
123
124#define ITT_INLINE_ATTRIBUTE /* nothing */
125#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
126/*
127 * Generally, functions are not inlined unless optimization is specified.
128 * For functions declared inline, this attribute inlines the function even
129 * if no optimization level was specified.
130 */
131#ifdef __STRICT_ANSI__
132#define ITT_INLINE static
133#define ITT_INLINE_ATTRIBUTE __attribute__((unused))
134#else /* __STRICT_ANSI__ */
135#define ITT_INLINE static inline
136#define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
137#endif /* __STRICT_ANSI__ */
138#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
139/** @endcond */
140
141#ifndef ITT_ARCH_IA32
142#define ITT_ARCH_IA32 1
143#endif /* ITT_ARCH_IA32 */
144
145#ifndef ITT_ARCH_IA32E
146#define ITT_ARCH_IA32E 2
147#endif /* ITT_ARCH_IA32E */
148
149#ifndef ITT_ARCH_IA64
150#define ITT_ARCH_IA64 3
151#endif /* ITT_ARCH_IA64 */
152
153#ifndef ITT_ARCH_ARM
154#define ITT_ARCH_ARM 4
155#endif /* ITT_ARCH_ARM */
156
157#ifndef ITT_ARCH_PPC64
158#define ITT_ARCH_PPC64 5
159#endif /* ITT_ARCH_PPC64 */
160
161#ifndef ITT_ARCH_ARM64
162#define ITT_ARCH_ARM64 6
163#endif /* ITT_ARCH_ARM64 */
164
165#ifndef ITT_ARCH_VE
166#define ITT_ARCH_VE 8
167#endif /* ITT_ARCH_VE */
168
169#ifndef ITT_ARCH_S390X
170#define ITT_ARCH_S390X 8
171#endif /* ITT_ARCH_S390X */
172
173#ifndef ITT_ARCH
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
188#elif defined __ve__
189#define ITT_ARCH ITT_ARCH_VE
190#elif defined __s390x__
191#define ITT_ARCH ITT_ARCH_S390X
192#endif
193#endif
194
195#ifdef __cplusplus
196#define ITT_EXTERN_C extern "C"
197#define ITT_EXTERN_C_BEGIN extern "C" {
198#define ITT_EXTERN_C_END }
199#else
200#define ITT_EXTERN_C /* nothing */
201#define ITT_EXTERN_C_BEGIN /* nothing */
202#define ITT_EXTERN_C_END /* nothing */
203#endif /* __cplusplus */
204
205#define ITT_TO_STR_AUX(x) #x
206#define ITT_TO_STR(x) ITT_TO_STR_AUX(x)
207
208#define __ITT_BUILD_ASSERT(expr, suffix) \
209 do { \
210 static char __itt_build_check_##suffix[(expr) ? 1 : -1]; \
211 __itt_build_check_##suffix[0] = 0; \
212 } while (0)
213#define _ITT_BUILD_ASSERT(expr, suffix) __ITT_BUILD_ASSERT((expr), suffix)
214#define ITT_BUILD_ASSERT(expr) _ITT_BUILD_ASSERT((expr), __LINE__)
215
216#define ITT_MAGIC \
217 { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
218
219/* Replace with snapshot date YYYYMMDD for promotion build. */
220#define API_VERSION_BUILD 20180723
221
222#ifndef API_VERSION_NUM
223#define API_VERSION_NUM 3.20.1
224#endif /* API_VERSION_NUM */
225
226#define API_VERSION \
227 "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) " (" ITT_TO_STR( \
228 API_VERSION_BUILD) ")"
229
230/* OS communication functions */
231#if ITT_PLATFORM == ITT_PLATFORM_WIN
232#include <windows.h>
233typedef HMODULE lib_t;
234typedef DWORD TIDT;
235typedef CRITICAL_SECTION mutex_t;
236#ifdef __cplusplus
237#define MUTEX_INITIALIZER \
238 {}
239#else
240#define MUTEX_INITIALIZER \
241 { 0 }
242#endif
243#define strong_alias(name, aliasname) /* empty for Windows */
244#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
245#include <dlfcn.h>
246#if defined(UNICODE) || defined(_UNICODE)
247#include <wchar.h>
248#endif /* UNICODE */
249#ifndef _GNU_SOURCE
250#define _GNU_SOURCE 1 /* need for PTHREAD_MUTEX_RECURSIVE */
251#endif /* _GNU_SOURCE */
252#ifndef __USE_UNIX98
253#define __USE_UNIX98 \
254 1 /* need for PTHREAD_MUTEX_RECURSIVE, on SLES11.1 with gcc 4.3.4 wherein \
255 pthread.h missing dependency on __USE_XOPEN2K8 */
256#endif /*__USE_UNIX98*/
257#include <pthread.h>
258typedef void *lib_t;
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)
265#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
266
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
282ITT_INLINE long
283__itt_interlocked_increment(volatile long *ptr) ITT_INLINE_ATTRIBUTE;
284ITT_INLINE long __itt_interlocked_increment(volatile long *ptr) {
285 return InterlockedIncrement(ptr);
286}
287#endif /* ITT_SIMPLE_INIT */
288
289#define DL_SYMBOLS (1)
290#define PTHREAD_SYMBOLS (1)
291
292#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
293#define __itt_get_proc(lib, name) dlsym(lib, name)
294#define __itt_mutex_init(mutex) \
295 { \
296 pthread_mutexattr_t mutex_attr; \
297 int error_code = pthread_mutexattr_init(&mutex_attr); \
298 if (error_code) \
299 __itt_report_error(__itt_error_system, "pthread_mutexattr_init", \
300 error_code); \
301 error_code = \
302 pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); \
303 if (error_code) \
304 __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \
305 error_code); \
306 error_code = pthread_mutex_init(mutex, &mutex_attr); \
307 if (error_code) \
308 __itt_report_error(__itt_error_system, "pthread_mutex_init", \
309 error_code); \
310 error_code = pthread_mutexattr_destroy(&mutex_attr); \
311 if (error_code) \
312 __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \
313 error_code); \
314 }
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)
321
322/* makes customer code define safe APIs for SDL_STRNLEN_S and SDL_STRNCPY_S */
323#ifdef SDL_STRNLEN_S
324#define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l)
325#else
326#define __itt_fstrnlen(s, l) strlen(s)
327#endif /* SDL_STRNLEN_S */
328#ifdef SDL_STRNCPY_S
329#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
330#else
331#define __itt_fstrcpyn(s1, b, s2, l) \
332 { \
333 if (b > 0) { \
334 /* 'volatile' is used to suppress the warning that a destination */ \
335 /* bound depends on the length of the source. */ \
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; \
340 } \
341 }
342#endif /* SDL_STRNCPY_S */
343
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)
350#else /* __INTEL_COMPILER */
351/* TODO: Add Support for not Intel compilers for IA-64 architecture */
352#endif /* __INTEL_COMPILER */
353#elif ITT_ARCH == ITT_ARCH_IA32 || \
354 ITT_ARCH == ITT_ARCH_IA32E /* ITT_ARCH!=ITT_ARCH_IA64 */
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) {
358 long result;
359 __asm__ __volatile__("lock\nxadd %0,%1"
360 : "=r"(result), "=m"(*(volatile int *)ptr)
361 : "0"(addend), "m"(*(volatile int *)ptr)
362 : "memory");
363 return result;
364}
365#else
366#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
367#endif /* ITT_ARCH==ITT_ARCH_IA64 */
368#ifndef ITT_SIMPLE_INIT
369ITT_INLINE long
370__itt_interlocked_increment(volatile long *ptr) ITT_INLINE_ATTRIBUTE;
371ITT_INLINE long __itt_interlocked_increment(volatile long *ptr) {
372 return __TBB_machine_fetchadd4(ptr, 1) + 1L;
373}
374#endif /* ITT_SIMPLE_INIT */
375
376void *dlopen(const char *, int) __attribute__((weak));
377void *dlsym(void *, const char *) __attribute__((weak));
378int dlclose(void *) __attribute__((weak));
379#define DL_SYMBOLS (dlopen && dlsym && dlclose)
380
381int pthread_mutex_init(pthread_mutex_t *, const pthread_mutexattr_t *)
382 __attribute__((weak));
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));
389pthread_t pthread_self(void) __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)
394
395#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
396
401
406
407#pragma pack(push, 8)
408
409typedef struct ___itt_thread_info {
410 const char *nameA; /*!< Copy of original name in ASCII. */
411#if defined(UNICODE) || defined(_UNICODE)
412 const wchar_t *nameW; /*!< Copy of original name in UNICODE. */
413#else /* UNICODE || _UNICODE */
414 void *nameW;
415#endif /* UNICODE || _UNICODE */
417 __itt_thread_state state; /*!< Thread state (paused or normal) */
418 int extra1; /*!< Reserved to the runtime */
419 void *extra2; /*!< Reserved to the runtime */
422
423#include "ittnotify_types.h" /* For __itt_group_id definition */
424
431
439
440typedef struct __itt_counter_info {
441 const char *nameA; /*!< Copy of original name in ASCII. */
442#if defined(UNICODE) || defined(_UNICODE)
443 const wchar_t *nameW; /*!< Copy of original name in UNICODE. */
444#else /* UNICODE || _UNICODE */
445 void *nameW;
446#endif /* UNICODE || _UNICODE */
447 const char *domainA; /*!< Copy of original name in ASCII. */
448#if defined(UNICODE) || defined(_UNICODE)
449 const wchar_t *domainW; /*!< Copy of original name in UNICODE. */
450#else /* UNICODE || _UNICODE */
451 void *domainW;
452#endif /* UNICODE || _UNICODE */
453 int type;
454 long index;
455 int extra1; /*!< Reserved to the runtime */
456 void *extra2; /*!< Reserved to the runtime */
459
460struct ___itt_domain;
461struct ___itt_string_handle;
462struct ___itt_histogram;
463
464typedef struct ___itt_global {
465 unsigned char magic[8];
466 unsigned long version_major;
467 unsigned long version_minor;
468 unsigned long version_build;
469 volatile long api_initialized;
470 volatile long mutex_initialized;
471 volatile long atomic_counter;
475 const char **dll_path_ptr;
478 /* Joinable structures below */
480 struct ___itt_domain *domain_list;
481 struct ___itt_string_handle *string_list;
484 unsigned int ipt_collect_events;
485 struct ___itt_histogram *histogram_list;
487
488#pragma pack(pop)
489
490#define NEW_THREAD_INFO_W(gptr, h, h_tail, t, s, n) \
491 { \
492 h = (__itt_thread_info *)malloc(sizeof(__itt_thread_info)); \
493 if (h != NULL) { \
494 h->tid = t; \
495 h->nameA = NULL; \
496 h->nameW = n ? _wcsdup(n) : NULL; \
497 h->state = s; \
498 h->extra1 = 0; /* reserved */ \
499 h->extra2 = NULL; /* reserved */ \
500 h->next = NULL; \
501 if (h_tail == NULL) \
502 (gptr)->thread_list = h; \
503 else \
504 h_tail->next = h; \
505 } \
506 }
507
508#define NEW_THREAD_INFO_A(gptr, h, h_tail, t, s, n) \
509 { \
510 h = (__itt_thread_info *)malloc(sizeof(__itt_thread_info)); \
511 if (h != NULL) { \
512 h->tid = t; \
513 h->nameA = n ? __itt_fstrdup(n) : NULL; \
514 h->nameW = NULL; \
515 h->state = s; \
516 h->extra1 = 0; /* reserved */ \
517 h->extra2 = NULL; /* reserved */ \
518 h->next = NULL; \
519 if (h_tail == NULL) \
520 (gptr)->thread_list = h; \
521 else \
522 h_tail->next = h; \
523 } \
524 }
525
526#define NEW_DOMAIN_W(gptr, h, h_tail, name) \
527 { \
528 h = (__itt_domain *)malloc(sizeof(__itt_domain)); \
529 if (h != NULL) { \
530 h->flags = 1; /* domain is enabled by default */ \
531 h->nameA = NULL; \
532 h->nameW = name ? _wcsdup(name) : NULL; \
533 h->extra1 = 0; /* reserved */ \
534 h->extra2 = NULL; /* reserved */ \
535 h->next = NULL; \
536 if (h_tail == NULL) \
537 (gptr)->domain_list = h; \
538 else \
539 h_tail->next = h; \
540 } \
541 }
542
543#define NEW_DOMAIN_A(gptr, h, h_tail, name) \
544 { \
545 h = (__itt_domain *)malloc(sizeof(__itt_domain)); \
546 if (h != NULL) { \
547 h->flags = 1; /* domain is enabled by default */ \
548 h->nameA = name ? __itt_fstrdup(name) : NULL; \
549 h->nameW = NULL; \
550 h->extra1 = 0; /* reserved */ \
551 h->extra2 = NULL; /* reserved */ \
552 h->next = NULL; \
553 if (h_tail == NULL) \
554 (gptr)->domain_list = h; \
555 else \
556 h_tail->next = h; \
557 } \
558 }
559
560#define NEW_STRING_HANDLE_W(gptr, h, h_tail, name) \
561 { \
562 h = (__itt_string_handle *)malloc(sizeof(__itt_string_handle)); \
563 if (h != NULL) { \
564 h->strA = NULL; \
565 h->strW = name ? _wcsdup(name) : NULL; \
566 h->extra1 = 0; /* reserved */ \
567 h->extra2 = NULL; /* reserved */ \
568 h->next = NULL; \
569 if (h_tail == NULL) \
570 (gptr)->string_list = h; \
571 else \
572 h_tail->next = h; \
573 } \
574 }
575
576#define NEW_STRING_HANDLE_A(gptr, h, h_tail, name) \
577 { \
578 h = (__itt_string_handle *)malloc(sizeof(__itt_string_handle)); \
579 if (h != NULL) { \
580 h->strA = name ? __itt_fstrdup(name) : NULL; \
581 h->strW = NULL; \
582 h->extra1 = 0; /* reserved */ \
583 h->extra2 = NULL; /* reserved */ \
584 h->next = NULL; \
585 if (h_tail == NULL) \
586 (gptr)->string_list = h; \
587 else \
588 h_tail->next = h; \
589 } \
590 }
591
592#define NEW_COUNTER_W(gptr, h, h_tail, name, domain, type) \
593 { \
594 h = (__itt_counter_info_t *)malloc(sizeof(__itt_counter_info_t)); \
595 if (h != NULL) { \
596 h->nameA = NULL; \
597 h->nameW = name ? _wcsdup(name) : NULL; \
598 h->domainA = NULL; \
599 h->domainW = name ? _wcsdup(domain) : NULL; \
600 h->type = type; \
601 h->index = 0; \
602 h->next = NULL; \
603 if (h_tail == NULL) \
604 (gptr)->counter_list = h; \
605 else \
606 h_tail->next = h; \
607 } \
608 }
609
610#define NEW_COUNTER_A(gptr, h, h_tail, name, domain, type) \
611 { \
612 h = (__itt_counter_info_t *)malloc(sizeof(__itt_counter_info_t)); \
613 if (h != NULL) { \
614 h->nameA = name ? __itt_fstrdup(name) : NULL; \
615 h->nameW = NULL; \
616 h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
617 h->domainW = NULL; \
618 h->type = type; \
619 h->index = 0; \
620 h->next = NULL; \
621 if (h_tail == NULL) \
622 (gptr)->counter_list = h; \
623 else \
624 h_tail->next = h; \
625 } \
626 }
627
628#define NEW_HISTOGRAM_W(gptr, h, h_tail, domain, name, x_type, y_type) \
629 { \
630 h = (__itt_histogram *)malloc(sizeof(__itt_histogram)); \
631 if (h != NULL) { \
632 h->domain = domain; \
633 h->nameA = NULL; \
634 h->nameW = name ? _wcsdup(name) : NULL; \
635 h->x_type = x_type; \
636 h->y_type = y_type; \
637 h->extra1 = 0; \
638 h->extra2 = NULL; \
639 if (h_tail == NULL) \
640 (gptr)->histogram_list = h; \
641 else \
642 h_tail->next = h; \
643 } \
644 }
645
646#define NEW_HISTOGRAM_A(gptr, h, h_tail, domain, name, x_type, y_type) \
647 { \
648 h = (__itt_histogram *)malloc(sizeof(__itt_histogram)); \
649 if (h != NULL) { \
650 h->domain = domain; \
651 h->nameA = name ? __itt_fstrdup(name) : NULL; \
652 h->nameW = NULL; \
653 h->x_type = x_type; \
654 h->y_type = y_type; \
655 h->extra1 = 0; \
656 h->extra2 = NULL; \
657 if (h_tail == NULL) \
658 (gptr)->histogram_list = h; \
659 else \
660 h_tail->next = h; \
661 } \
662 }
663
664#endif /* _ITTNOTIFY_CONFIG_H_ */
int result[2]
__itt_thread_state
@ __itt_thread_normal
@ __itt_thread_ignored
struct __itt_counter_info __itt_counter_info_t
__itt_collection_state
@ __itt_collection_paused
@ __itt_collection_normal
DWORD TIDT
ITT_INLINE long __itt_interlocked_increment(volatile long *ptr) ITT_INLINE_ATTRIBUTE
struct ___itt_global __itt_global
HMODULE lib_t
struct ___itt_api_info_20101001 __itt_api_info_20101001
struct ___itt_api_info __itt_api_info
CRITICAL_SECTION mutex_t
struct ___itt_thread_info __itt_thread_info
enum ___itt_group_id __itt_group_id
__attribute__((noinline))
__itt_group_id group
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
unsigned char magic[8]
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.