17 #ifndef _ITTNOTIFY_CONFIG_H_ 18 #define _ITTNOTIFY_CONFIG_H_ 26 # define ITT_OS_LINUX 2 33 #ifndef ITT_OS_FREEBSD 34 # define ITT_OS_FREEBSD 4 38 # if defined WIN32 || defined _WIN32 39 # define ITT_OS ITT_OS_WIN 40 # elif defined( __APPLE__ ) && defined( __MACH__ ) 41 # define ITT_OS ITT_OS_MAC 42 # elif defined( __FreeBSD__ ) 43 # define ITT_OS ITT_OS_FREEBSD 45 # define ITT_OS ITT_OS_LINUX 49 #ifndef ITT_PLATFORM_WIN 50 # define ITT_PLATFORM_WIN 1 53 #ifndef ITT_PLATFORM_POSIX 54 # define ITT_PLATFORM_POSIX 2 57 #ifndef ITT_PLATFORM_MAC 58 # define ITT_PLATFORM_MAC 3 61 #ifndef ITT_PLATFORM_FREEBSD 62 # define ITT_PLATFORM_FREEBSD 4 66 # if ITT_OS==ITT_OS_WIN 67 # define ITT_PLATFORM ITT_PLATFORM_WIN 68 # elif ITT_OS==ITT_OS_MAC 69 # define ITT_PLATFORM ITT_PLATFORM_MAC 70 # elif ITT_OS==ITT_OS_FREEBSD 71 # define ITT_PLATFORM ITT_PLATFORM_FREEBSD 73 # define ITT_PLATFORM ITT_PLATFORM_POSIX 77 #if defined(_UNICODE) && !defined(UNICODE) 82 #if ITT_PLATFORM==ITT_PLATFORM_WIN 86 #if defined(UNICODE) || defined(_UNICODE) 92 # if ITT_PLATFORM==ITT_PLATFORM_WIN 93 # define CDECL __cdecl 95 # if defined _M_IX86 || defined __i386__ 96 # define CDECL __attribute__ ((cdecl)) 104 # if ITT_PLATFORM==ITT_PLATFORM_WIN 105 # define STDCALL __stdcall 107 # if defined _M_IX86 || defined __i386__ 108 # define STDCALL __attribute__ ((stdcall)) 116 #define LIBITTAPI CDECL 119 #define ITTAPI_CALL CDECL 120 #define LIBITTAPI_CALL CDECL 122 #if ITT_PLATFORM==ITT_PLATFORM_WIN 124 #define ITT_INLINE __forceinline 125 #define ITT_INLINE_ATTRIBUTE 132 #ifdef __STRICT_ANSI__ 133 #define ITT_INLINE static 134 #define ITT_INLINE_ATTRIBUTE __attribute__((unused)) 136 #define ITT_INLINE static inline 137 #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused)) 142 #ifndef ITT_ARCH_IA32 143 # define ITT_ARCH_IA32 1 146 #ifndef ITT_ARCH_IA32E 147 # define ITT_ARCH_IA32E 2 151 # define ITT_ARCH_ARM 4 154 #ifndef ITT_ARCH_PPC64 155 # define ITT_ARCH_PPC64 5 159 # if defined _M_IX86 || defined __i386__ 160 # define ITT_ARCH ITT_ARCH_IA32 161 # elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__ 162 # define ITT_ARCH ITT_ARCH_IA32E 163 # elif defined _M_IA64 || defined __ia64__ 164 # define ITT_ARCH ITT_ARCH_IA64 165 # elif defined _M_ARM || __arm__ 166 # define ITT_ARCH ITT_ARCH_ARM 167 # elif defined __powerpc64__ 168 # define ITT_ARCH ITT_ARCH_PPC64 173 # define ITT_EXTERN_C extern "C" 174 # define ITT_EXTERN_C_BEGIN extern "C" { 175 # define ITT_EXTERN_C_END } 177 # define ITT_EXTERN_C 178 # define ITT_EXTERN_C_BEGIN 179 # define ITT_EXTERN_C_END 182 #define ITT_TO_STR_AUX(x) #x 183 #define ITT_TO_STR(x) ITT_TO_STR_AUX(x) 185 #define __ITT_BUILD_ASSERT(expr, suffix) do { \ 186 static char __itt_build_check_##suffix[(expr) ? 1 : -1]; \ 187 __itt_build_check_##suffix[0] = 0; \ 189 #define _ITT_BUILD_ASSERT(expr, suffix) __ITT_BUILD_ASSERT((expr), suffix) 190 #define ITT_BUILD_ASSERT(expr) _ITT_BUILD_ASSERT((expr), __LINE__) 192 #define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 } 195 #define API_VERSION_BUILD 20111111 197 #ifndef API_VERSION_NUM 198 #define API_VERSION_NUM 0.0.0 201 #define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \ 202 " (" ITT_TO_STR(API_VERSION_BUILD) ")" 205 #if ITT_PLATFORM==ITT_PLATFORM_WIN 210 #define MUTEX_INITIALIZER { 0 } 211 #define strong_alias(name, aliasname) 214 #if defined(UNICODE) || defined(_UNICODE) 218 #define _GNU_SOURCE 1 221 #define __USE_UNIX98 1 225 typedef pthread_t
TIDT;
226 typedef pthread_mutex_t
mutex_t;
227 #define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER 228 #define _strong_alias(name, aliasname) \ 229 extern __typeof (name) aliasname __attribute__ ((alias (#name))); 230 #define strong_alias(name, aliasname) _strong_alias(name, aliasname) 233 #if ITT_PLATFORM==ITT_PLATFORM_WIN 234 #define __itt_get_proc(lib, name) GetProcAddress(lib, name) 235 #define __itt_mutex_init(mutex) InitializeCriticalSection(mutex) 236 #define __itt_mutex_lock(mutex) EnterCriticalSection(mutex) 237 #define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex) 238 #define __itt_load_lib(name) LoadLibraryA(name) 239 #define __itt_unload_lib(handle) FreeLibrary(handle) 240 #define __itt_system_error() (int)GetLastError() 241 #define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2) 242 #define __itt_fstrnlen(s, l) strnlen_s(s, l) 243 #define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l) 244 #define __itt_fstrdup(s) _strdup(s) 245 #define __itt_thread_id() GetCurrentThreadId() 246 #define __itt_thread_yield() SwitchToThread() 247 #ifndef ITT_SIMPLE_INIT 252 return InterlockedIncrement(ptr);
256 #define __itt_get_proc(lib, name) dlsym(lib, name) 257 #define __itt_mutex_init(mutex) {\ 258 pthread_mutexattr_t mutex_attr; \ 259 int error_code = pthread_mutexattr_init(&mutex_attr); \ 261 __itt_report_error(__itt_error_system, "pthread_mutexattr_init", \ 263 error_code = pthread_mutexattr_settype(&mutex_attr, \ 264 PTHREAD_MUTEX_RECURSIVE); \ 266 __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \ 268 error_code = pthread_mutex_init(mutex, &mutex_attr); \ 270 __itt_report_error(__itt_error_system, "pthread_mutex_init", \ 272 error_code = pthread_mutexattr_destroy(&mutex_attr); \ 274 __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \ 277 #define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex) 278 #define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex) 279 #define __itt_load_lib(name) dlopen(name, RTLD_LAZY) 280 #define __itt_unload_lib(handle) dlclose(handle) 281 #define __itt_system_error() errno 282 #define __itt_fstrcmp(s1, s2) strcmp(s1, s2) 286 #define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l) 288 #define __itt_fstrnlen(s, l) strlen(s) 291 #define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l) 293 #define __itt_fstrcpyn(s1, b, s2, l) { \ 297 volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ? \ 298 (size_t)(b - 1) : (size_t)(l); \ 299 strncpy(s1, s2, num_to_copy); \ 300 s1[num_to_copy] = 0; \ 305 #define __itt_fstrdup(s) strdup(s) 306 #define __itt_thread_id() pthread_self() 307 #define __itt_thread_yield() sched_yield() 308 #if ITT_ARCH==ITT_ARCH_IA64 309 #ifdef __INTEL_COMPILER 310 #define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val) 314 #elif ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_IA32E 320 __asm__ __volatile__(
"lock\nxadd %0,%1" 321 :
"=r"(result),
"=m"(*(
int*)ptr)
322 :
"0"(addend),
"m"(*(
int*)ptr)
326 #elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64 327 #define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val) 329 #ifndef ITT_SIMPLE_INIT 349 #pragma pack(push, 8) 354 #if defined(UNICODE) || defined(_UNICODE) 355 const wchar_t*
nameW;
385 struct ___itt_domain;
386 struct ___itt_string_handle;
412 #define NEW_THREAD_INFO_W(gptr,h,h_tail,t,s,n) { \ 413 h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \ 417 h->nameW = n ? _wcsdup(n) : NULL; \ 422 if (h_tail == NULL) \ 423 (gptr)->thread_list = h; \ 429 #define NEW_THREAD_INFO_A(gptr,h,h_tail,t,s,n) { \ 430 h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \ 433 h->nameA = n ? __itt_fstrdup(n) : NULL; \ 439 if (h_tail == NULL) \ 440 (gptr)->thread_list = h; \ 446 #define NEW_DOMAIN_W(gptr,h,h_tail,name) { \ 447 h = (__itt_domain*)malloc(sizeof(__itt_domain)); \ 451 h->nameW = name ? _wcsdup(name) : NULL; \ 455 if (h_tail == NULL) \ 456 (gptr)->domain_list = h; \ 462 #define NEW_DOMAIN_A(gptr,h,h_tail,name) { \ 463 h = (__itt_domain*)malloc(sizeof(__itt_domain)); \ 466 h->nameA = name ? __itt_fstrdup(name) : NULL; \ 471 if (h_tail == NULL) \ 472 (gptr)->domain_list = h; \ 478 #define NEW_STRING_HANDLE_W(gptr,h,h_tail,name) { \ 479 h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \ 482 h->strW = name ? _wcsdup(name) : NULL; \ 486 if (h_tail == NULL) \ 487 (gptr)->string_list = h; \ 493 #define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \ 494 h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \ 496 h->strA = name ? __itt_fstrdup(name) : NULL; \ 501 if (h_tail == NULL) \ 502 (gptr)->string_list = h; \
volatile long atomic_counter
enum ___itt_group_id __itt_group_id
struct ___itt_domain * domain_list
__itt_thread_info * thread_list
unsigned long version_build
struct ___itt_thread_info * next
ITT_INLINE long __itt_interlocked_increment(volatile long *ptr) ITT_INLINE_ATTRIBUTE
long __TBB_machine_fetchadd4(volatile void *ptr, __int32 addend)
volatile long mutex_initialized
__itt_collection_state state
volatile long api_initialized
struct ___itt_api_info_20101001 __itt_api_info_20101001
struct ___itt_global __itt_global
unsigned long version_major
struct ___itt_global * next
struct ___itt_thread_info __itt_thread_info
struct ___itt_api_info __itt_api_info
__itt_api_info * api_list_ptr
struct ___itt_string_handle * string_list
const char ** dll_path_ptr
unsigned long version_minor