21 #ifndef _ITTNOTIFY_CONFIG_H_ 22 #define _ITTNOTIFY_CONFIG_H_ 30 # define ITT_OS_LINUX 2 37 #ifndef ITT_OS_FREEBSD 38 # define ITT_OS_FREEBSD 4 42 # if defined WIN32 || defined _WIN32 43 # define ITT_OS ITT_OS_WIN 44 # elif defined( __APPLE__ ) && defined( __MACH__ ) 45 # define ITT_OS ITT_OS_MAC 46 # elif defined( __FreeBSD__ ) 47 # define ITT_OS ITT_OS_FREEBSD 49 # define ITT_OS ITT_OS_LINUX 53 #ifndef ITT_PLATFORM_WIN 54 # define ITT_PLATFORM_WIN 1 57 #ifndef ITT_PLATFORM_POSIX 58 # define ITT_PLATFORM_POSIX 2 61 #ifndef ITT_PLATFORM_MAC 62 # define ITT_PLATFORM_MAC 3 65 #ifndef ITT_PLATFORM_FREEBSD 66 # define ITT_PLATFORM_FREEBSD 4 70 # if ITT_OS==ITT_OS_WIN 71 # define ITT_PLATFORM ITT_PLATFORM_WIN 72 # elif ITT_OS==ITT_OS_MAC 73 # define ITT_PLATFORM ITT_PLATFORM_MAC 74 # elif ITT_OS==ITT_OS_FREEBSD 75 # define ITT_PLATFORM ITT_PLATFORM_FREEBSD 77 # define ITT_PLATFORM ITT_PLATFORM_POSIX 81 #if defined(_UNICODE) && !defined(UNICODE) 86 #if ITT_PLATFORM==ITT_PLATFORM_WIN 90 #if defined(UNICODE) || defined(_UNICODE) 96 # if ITT_PLATFORM==ITT_PLATFORM_WIN 97 # define CDECL __cdecl 99 # if defined _M_IX86 || defined __i386__ 100 # define CDECL __attribute__ ((cdecl)) 108 # if ITT_PLATFORM==ITT_PLATFORM_WIN 109 # define STDCALL __stdcall 111 # if defined _M_IX86 || defined __i386__ 112 # define STDCALL __attribute__ ((stdcall)) 120 #define LIBITTAPI CDECL 123 #define ITTAPI_CALL CDECL 124 #define LIBITTAPI_CALL CDECL 126 #if ITT_PLATFORM==ITT_PLATFORM_WIN 128 #define ITT_INLINE __forceinline 129 #define ITT_INLINE_ATTRIBUTE 136 #ifdef __STRICT_ANSI__ 137 #define ITT_INLINE static 138 #define ITT_INLINE_ATTRIBUTE __attribute__((unused)) 140 #define ITT_INLINE static inline 141 #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused)) 146 #ifndef ITT_ARCH_IA32 147 # define ITT_ARCH_IA32 1 150 #ifndef ITT_ARCH_IA32E 151 # define ITT_ARCH_IA32E 2 155 # define ITT_ARCH_ARM 4 158 #ifndef ITT_ARCH_PPC64 159 # define ITT_ARCH_PPC64 5 163 # if defined _M_IX86 || defined __i386__ 164 # define ITT_ARCH ITT_ARCH_IA32 165 # elif defined _M_X64 || defined _M_AMD64 || defined __x86_64__ 166 # define ITT_ARCH ITT_ARCH_IA32E 167 # elif defined _M_IA64 || defined __ia64__ 168 # define ITT_ARCH ITT_ARCH_IA64 169 # elif defined _M_ARM || __arm__ 170 # define ITT_ARCH ITT_ARCH_ARM 171 # elif defined __powerpc64__ 172 # define ITT_ARCH ITT_ARCH_PPC64 177 # define ITT_EXTERN_C extern "C" 178 # define ITT_EXTERN_C_BEGIN extern "C" { 179 # define ITT_EXTERN_C_END } 181 # define ITT_EXTERN_C 182 # define ITT_EXTERN_C_BEGIN 183 # define ITT_EXTERN_C_END 186 #define ITT_TO_STR_AUX(x) #x 187 #define ITT_TO_STR(x) ITT_TO_STR_AUX(x) 189 #define __ITT_BUILD_ASSERT(expr, suffix) do { \ 190 static char __itt_build_check_##suffix[(expr) ? 1 : -1]; \ 191 __itt_build_check_##suffix[0] = 0; \ 193 #define _ITT_BUILD_ASSERT(expr, suffix) __ITT_BUILD_ASSERT((expr), suffix) 194 #define ITT_BUILD_ASSERT(expr) _ITT_BUILD_ASSERT((expr), __LINE__) 196 #define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 } 199 #define API_VERSION_BUILD 20111111 201 #ifndef API_VERSION_NUM 202 #define API_VERSION_NUM 0.0.0 205 #define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \ 206 " (" ITT_TO_STR(API_VERSION_BUILD) ")" 209 #if ITT_PLATFORM==ITT_PLATFORM_WIN 214 #define MUTEX_INITIALIZER { 0 } 215 #define strong_alias(name, aliasname) 218 #if defined(UNICODE) || defined(_UNICODE) 222 #define _GNU_SOURCE 1 225 #define __USE_UNIX98 1 229 typedef pthread_t
TIDT;
230 typedef pthread_mutex_t
mutex_t;
231 #define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER 232 #define _strong_alias(name, aliasname) \ 233 extern __typeof (name) aliasname __attribute__ ((alias (#name))); 234 #define strong_alias(name, aliasname) _strong_alias(name, aliasname) 237 #if ITT_PLATFORM==ITT_PLATFORM_WIN 238 #define __itt_get_proc(lib, name) GetProcAddress(lib, name) 239 #define __itt_mutex_init(mutex) InitializeCriticalSection(mutex) 240 #define __itt_mutex_lock(mutex) EnterCriticalSection(mutex) 241 #define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex) 242 #define __itt_load_lib(name) LoadLibraryA(name) 243 #define __itt_unload_lib(handle) FreeLibrary(handle) 244 #define __itt_system_error() (int)GetLastError() 245 #define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2) 246 #define __itt_fstrnlen(s, l) strnlen_s(s, l) 247 #define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l) 248 #define __itt_fstrdup(s) _strdup(s) 249 #define __itt_thread_id() GetCurrentThreadId() 250 #define __itt_thread_yield() SwitchToThread() 251 #ifndef ITT_SIMPLE_INIT 256 return InterlockedIncrement(ptr);
260 #define __itt_get_proc(lib, name) dlsym(lib, name) 261 #define __itt_mutex_init(mutex) {\ 262 pthread_mutexattr_t mutex_attr; \ 263 int error_code = pthread_mutexattr_init(&mutex_attr); \ 265 __itt_report_error(__itt_error_system, "pthread_mutexattr_init", \ 267 error_code = pthread_mutexattr_settype(&mutex_attr, \ 268 PTHREAD_MUTEX_RECURSIVE); \ 270 __itt_report_error(__itt_error_system, "pthread_mutexattr_settype", \ 272 error_code = pthread_mutex_init(mutex, &mutex_attr); \ 274 __itt_report_error(__itt_error_system, "pthread_mutex_init", \ 276 error_code = pthread_mutexattr_destroy(&mutex_attr); \ 278 __itt_report_error(__itt_error_system, "pthread_mutexattr_destroy", \ 281 #define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex) 282 #define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex) 283 #define __itt_load_lib(name) dlopen(name, RTLD_LAZY) 284 #define __itt_unload_lib(handle) dlclose(handle) 285 #define __itt_system_error() errno 286 #define __itt_fstrcmp(s1, s2) strcmp(s1, s2) 290 #define __itt_fstrnlen(s, l) SDL_STRNLEN_S(s, l) 292 #define __itt_fstrnlen(s, l) strlen(s) 295 #define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l) 297 #define __itt_fstrcpyn(s1, b, s2, l) { \ 301 volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ? \ 302 (size_t)(b - 1) : (size_t)(l); \ 303 strncpy(s1, s2, num_to_copy); \ 304 s1[num_to_copy] = 0; \ 309 #define __itt_fstrdup(s) strdup(s) 310 #define __itt_thread_id() pthread_self() 311 #define __itt_thread_yield() sched_yield() 312 #if ITT_ARCH==ITT_ARCH_IA64 313 #ifdef __INTEL_COMPILER 314 #define __TBB_machine_fetchadd4(addr, val) __fetchadd4_acq((void *)addr, val) 318 #elif ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_IA32E 324 __asm__ __volatile__(
"lock\nxadd %0,%1" 325 :
"=r"(result),
"=m"(*(
int*)ptr)
326 :
"0"(addend),
"m"(*(
int*)ptr)
330 #elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64 331 #define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val) 333 #ifndef ITT_SIMPLE_INIT 353 #pragma pack(push, 8) 358 #if defined(UNICODE) || defined(_UNICODE) 359 const wchar_t*
nameW;
389 struct ___itt_domain;
390 struct ___itt_string_handle;
416 #define NEW_THREAD_INFO_W(gptr,h,h_tail,t,s,n) { \ 417 h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \ 421 h->nameW = n ? _wcsdup(n) : NULL; \ 426 if (h_tail == NULL) \ 427 (gptr)->thread_list = h; \ 433 #define NEW_THREAD_INFO_A(gptr,h,h_tail,t,s,n) { \ 434 h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \ 437 h->nameA = n ? __itt_fstrdup(n) : NULL; \ 443 if (h_tail == NULL) \ 444 (gptr)->thread_list = h; \ 450 #define NEW_DOMAIN_W(gptr,h,h_tail,name) { \ 451 h = (__itt_domain*)malloc(sizeof(__itt_domain)); \ 455 h->nameW = name ? _wcsdup(name) : NULL; \ 459 if (h_tail == NULL) \ 460 (gptr)->domain_list = h; \ 466 #define NEW_DOMAIN_A(gptr,h,h_tail,name) { \ 467 h = (__itt_domain*)malloc(sizeof(__itt_domain)); \ 470 h->nameA = name ? __itt_fstrdup(name) : NULL; \ 475 if (h_tail == NULL) \ 476 (gptr)->domain_list = h; \ 482 #define NEW_STRING_HANDLE_W(gptr,h,h_tail,name) { \ 483 h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \ 486 h->strW = name ? _wcsdup(name) : NULL; \ 490 if (h_tail == NULL) \ 491 (gptr)->string_list = h; \ 497 #define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \ 498 h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \ 500 h->strA = name ? __itt_fstrdup(name) : NULL; \ 505 if (h_tail == NULL) \ 506 (gptr)->string_list = h; \ struct ___itt_global * next
__itt_api_info * api_list_ptr
struct ___itt_domain * domain_list
__itt_thread_info * thread_list
unsigned long version_major
ITT_INLINE long __itt_interlocked_increment(volatile long *ptr) ITT_INLINE_ATTRIBUTE
volatile long api_initialized
struct ___itt_api_info __itt_api_info
volatile long atomic_counter
unsigned long version_build
volatile long mutex_initialized
unsigned long version_minor
long __TBB_machine_fetchadd4(volatile void *ptr, __int32 addend)
__itt_collection_state state
struct ___itt_string_handle * string_list
const char ** dll_path_ptr
struct ___itt_thread_info __itt_thread_info
struct ___itt_global __itt_global
enum ___itt_group_id __itt_group_id
struct ___itt_thread_info * next
struct ___itt_api_info_20101001 __itt_api_info_20101001