10b57cec5SDimitry Andric 20b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 30b57cec5SDimitry Andric // 40b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 50b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 60b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 70b57cec5SDimitry Andric // 80b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 90b57cec5SDimitry Andric 100b57cec5SDimitry Andric #ifndef _LEGACY_ITTNOTIFY_H_ 110b57cec5SDimitry Andric #define _LEGACY_ITTNOTIFY_H_ 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric /** 140b57cec5SDimitry Andric * @file 150b57cec5SDimitry Andric * @brief Legacy User API functions and types 160b57cec5SDimitry Andric */ 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 190b57cec5SDimitry Andric #ifndef ITT_OS_WIN 200b57cec5SDimitry Andric #define ITT_OS_WIN 1 210b57cec5SDimitry Andric #endif /* ITT_OS_WIN */ 220b57cec5SDimitry Andric 230b57cec5SDimitry Andric #ifndef ITT_OS_LINUX 240b57cec5SDimitry Andric #define ITT_OS_LINUX 2 250b57cec5SDimitry Andric #endif /* ITT_OS_LINUX */ 260b57cec5SDimitry Andric 270b57cec5SDimitry Andric #ifndef ITT_OS_MAC 280b57cec5SDimitry Andric #define ITT_OS_MAC 3 290b57cec5SDimitry Andric #endif /* ITT_OS_MAC */ 300b57cec5SDimitry Andric 310b57cec5SDimitry Andric #ifndef ITT_OS_FREEBSD 320b57cec5SDimitry Andric #define ITT_OS_FREEBSD 4 330b57cec5SDimitry Andric #endif /* ITT_OS_FREEBSD */ 340b57cec5SDimitry Andric 350b57cec5SDimitry Andric #ifndef ITT_OS 360b57cec5SDimitry Andric #if defined WIN32 || defined _WIN32 370b57cec5SDimitry Andric #define ITT_OS ITT_OS_WIN 380b57cec5SDimitry Andric #elif defined(__APPLE__) && defined(__MACH__) 390b57cec5SDimitry Andric #define ITT_OS ITT_OS_MAC 400b57cec5SDimitry Andric #elif defined(__FreeBSD__) 410b57cec5SDimitry Andric #define ITT_OS ITT_OS_FREEBSD 420b57cec5SDimitry Andric #else 430b57cec5SDimitry Andric #define ITT_OS ITT_OS_LINUX 440b57cec5SDimitry Andric #endif 450b57cec5SDimitry Andric #endif /* ITT_OS */ 460b57cec5SDimitry Andric 470b57cec5SDimitry Andric #ifndef ITT_PLATFORM_WIN 480b57cec5SDimitry Andric #define ITT_PLATFORM_WIN 1 490b57cec5SDimitry Andric #endif /* ITT_PLATFORM_WIN */ 500b57cec5SDimitry Andric 510b57cec5SDimitry Andric #ifndef ITT_PLATFORM_POSIX 520b57cec5SDimitry Andric #define ITT_PLATFORM_POSIX 2 530b57cec5SDimitry Andric #endif /* ITT_PLATFORM_POSIX */ 540b57cec5SDimitry Andric 550b57cec5SDimitry Andric #ifndef ITT_PLATFORM_MAC 560b57cec5SDimitry Andric #define ITT_PLATFORM_MAC 3 570b57cec5SDimitry Andric #endif /* ITT_PLATFORM_MAC */ 580b57cec5SDimitry Andric 590b57cec5SDimitry Andric #ifndef ITT_PLATFORM_FREEBSD 600b57cec5SDimitry Andric #define ITT_PLATFORM_FREEBSD 4 610b57cec5SDimitry Andric #endif /* ITT_PLATFORM_FREEBSD */ 620b57cec5SDimitry Andric 630b57cec5SDimitry Andric #ifndef ITT_PLATFORM 640b57cec5SDimitry Andric #if ITT_OS == ITT_OS_WIN 650b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_WIN 660b57cec5SDimitry Andric #elif ITT_OS == ITT_OS_MAC 670b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_MAC 680b57cec5SDimitry Andric #elif ITT_OS == ITT_OS_FREEBSD 690b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_FREEBSD 700b57cec5SDimitry Andric #else 710b57cec5SDimitry Andric #define ITT_PLATFORM ITT_PLATFORM_POSIX 720b57cec5SDimitry Andric #endif 730b57cec5SDimitry Andric #endif /* ITT_PLATFORM */ 740b57cec5SDimitry Andric 750b57cec5SDimitry Andric #if defined(_UNICODE) && !defined(UNICODE) 760b57cec5SDimitry Andric #define UNICODE 770b57cec5SDimitry Andric #endif 780b57cec5SDimitry Andric 790b57cec5SDimitry Andric #include <stddef.h> 800b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 810b57cec5SDimitry Andric #include <tchar.h> 820b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 830b57cec5SDimitry Andric #include <stdint.h> 840b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE) 850b57cec5SDimitry Andric #include <wchar.h> 860b57cec5SDimitry Andric #endif /* UNICODE || _UNICODE */ 870b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 880b57cec5SDimitry Andric 890b57cec5SDimitry Andric #ifndef ITTAPI_CDECL 900b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 910b57cec5SDimitry Andric #define ITTAPI_CDECL __cdecl 920b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 930b57cec5SDimitry Andric #if defined _M_IX86 || defined __i386__ 940b57cec5SDimitry Andric #define ITTAPI_CDECL __attribute__((cdecl)) 950b57cec5SDimitry Andric #else /* _M_IX86 || __i386__ */ 960b57cec5SDimitry Andric #define ITTAPI_CDECL /* actual only on x86 platform */ 970b57cec5SDimitry Andric #endif /* _M_IX86 || __i386__ */ 980b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 990b57cec5SDimitry Andric #endif /* ITTAPI_CDECL */ 1000b57cec5SDimitry Andric 1010b57cec5SDimitry Andric #ifndef STDCALL 1020b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 1030b57cec5SDimitry Andric #define STDCALL __stdcall 1040b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 1050b57cec5SDimitry Andric #if defined _M_IX86 || defined __i386__ 1060b57cec5SDimitry Andric #define STDCALL __attribute__((stdcall)) 1070b57cec5SDimitry Andric #else /* _M_IX86 || __i386__ */ 1080b57cec5SDimitry Andric #define STDCALL /* supported only on x86 platform */ 1090b57cec5SDimitry Andric #endif /* _M_IX86 || __i386__ */ 1100b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 1110b57cec5SDimitry Andric #endif /* STDCALL */ 1120b57cec5SDimitry Andric 1130b57cec5SDimitry Andric #define ITTAPI ITTAPI_CDECL 1140b57cec5SDimitry Andric #define LIBITTAPI ITTAPI_CDECL 1150b57cec5SDimitry Andric 1160b57cec5SDimitry Andric /* TODO: Temporary for compatibility! */ 1170b57cec5SDimitry Andric #define ITTAPI_CALL ITTAPI_CDECL 1180b57cec5SDimitry Andric #define LIBITTAPI_CALL ITTAPI_CDECL 1190b57cec5SDimitry Andric 1200b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 1210b57cec5SDimitry Andric /* use __forceinline (VC++ specific) */ 122*349cc55cSDimitry Andric #if defined(__MINGW32__) && !defined(__cplusplus) 123*349cc55cSDimitry Andric #define ITT_INLINE \ 124*349cc55cSDimitry Andric static __inline__ __attribute__((__always_inline__, __gnu_inline__)) 125*349cc55cSDimitry Andric #else 126*349cc55cSDimitry Andric #define ITT_INLINE static __forceinline 127*349cc55cSDimitry Andric #endif /* __MINGW32__ */ 128*349cc55cSDimitry Andric 1290b57cec5SDimitry Andric #define ITT_INLINE_ATTRIBUTE /* nothing */ 1300b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 1310b57cec5SDimitry Andric /* 1320b57cec5SDimitry Andric * Generally, functions are not inlined unless optimization is specified. 1330b57cec5SDimitry Andric * For functions declared inline, this attribute inlines the function even 1340b57cec5SDimitry Andric * if no optimization level was specified. 1350b57cec5SDimitry Andric */ 1360b57cec5SDimitry Andric #ifdef __STRICT_ANSI__ 1370b57cec5SDimitry Andric #define ITT_INLINE static 1380b57cec5SDimitry Andric #define ITT_INLINE_ATTRIBUTE __attribute__((unused)) 1390b57cec5SDimitry Andric #else /* __STRICT_ANSI__ */ 1400b57cec5SDimitry Andric #define ITT_INLINE static inline 1410b57cec5SDimitry Andric #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused)) 1420b57cec5SDimitry Andric #endif /* __STRICT_ANSI__ */ 1430b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 1440b57cec5SDimitry Andric /** @endcond */ 1450b57cec5SDimitry Andric 1460b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 1470b57cec5SDimitry Andric /* Helper macro for joining tokens */ 1480b57cec5SDimitry Andric #define ITT_JOIN_AUX(p, n) p##n 1490b57cec5SDimitry Andric #define ITT_JOIN(p, n) ITT_JOIN_AUX(p, n) 1500b57cec5SDimitry Andric 1510b57cec5SDimitry Andric #ifdef ITT_MAJOR 1520b57cec5SDimitry Andric #undef ITT_MAJOR 1530b57cec5SDimitry Andric #endif 1540b57cec5SDimitry Andric #ifdef ITT_MINOR 1550b57cec5SDimitry Andric #undef ITT_MINOR 1560b57cec5SDimitry Andric #endif 1570b57cec5SDimitry Andric #define ITT_MAJOR 3 1580b57cec5SDimitry Andric #define ITT_MINOR 0 1590b57cec5SDimitry Andric 1600b57cec5SDimitry Andric /* Standard versioning of a token with major and minor version numbers */ 1610b57cec5SDimitry Andric #define ITT_VERSIONIZE(x) \ 162fe6060f1SDimitry Andric ITT_JOIN(x, ITT_JOIN(_, ITT_JOIN(ITT_MAJOR, ITT_JOIN(_, ITT_MINOR)))) 1630b57cec5SDimitry Andric 1640b57cec5SDimitry Andric #ifndef INTEL_ITTNOTIFY_PREFIX 1650b57cec5SDimitry Andric #define INTEL_ITTNOTIFY_PREFIX __itt_ 1660b57cec5SDimitry Andric #endif /* INTEL_ITTNOTIFY_PREFIX */ 1670b57cec5SDimitry Andric #ifndef INTEL_ITTNOTIFY_POSTFIX 1680b57cec5SDimitry Andric #define INTEL_ITTNOTIFY_POSTFIX _ptr_ 1690b57cec5SDimitry Andric #endif /* INTEL_ITTNOTIFY_POSTFIX */ 1700b57cec5SDimitry Andric 1710b57cec5SDimitry Andric #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, n) 172fe6060f1SDimitry Andric #define ITTNOTIFY_NAME(n) \ 173fe6060f1SDimitry Andric ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n, INTEL_ITTNOTIFY_POSTFIX))) 1740b57cec5SDimitry Andric 1750b57cec5SDimitry Andric #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n) 1760b57cec5SDimitry Andric #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n) 1770b57cec5SDimitry Andric 178fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D0(n, d) \ 179fe6060f1SDimitry Andric (!(d)->flags) ? (void)0 \ 180fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? (void)0 \ 181fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d) 182fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D1(n, d, x) \ 183fe6060f1SDimitry Andric (!(d)->flags) ? (void)0 \ 184fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? (void)0 \ 185fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x) 186fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D2(n, d, x, y) \ 187fe6060f1SDimitry Andric (!(d)->flags) ? (void)0 \ 188fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? (void)0 \ 189fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y) 190fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D3(n, d, x, y, z) \ 191fe6060f1SDimitry Andric (!(d)->flags) ? (void)0 \ 192fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? (void)0 \ 193fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y, z) 194fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D4(n, d, x, y, z, a) \ 195fe6060f1SDimitry Andric (!(d)->flags) ? (void)0 \ 196fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? (void)0 \ 197fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y, z, a) 198fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D5(n, d, x, y, z, a, b) \ 199fe6060f1SDimitry Andric (!(d)->flags) ? (void)0 \ 200fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? (void)0 \ 201fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y, z, a, b) 202fe6060f1SDimitry Andric #define ITTNOTIFY_VOID_D6(n, d, x, y, z, a, b, c) \ 203fe6060f1SDimitry Andric (!(d)->flags) ? (void)0 \ 204fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? (void)0 \ 205fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c) 206fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D0(n, d) \ 207fe6060f1SDimitry Andric (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d) 208fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D1(n, d, x) \ 209fe6060f1SDimitry Andric (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x) 210fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D2(n, d, x, y) \ 211fe6060f1SDimitry Andric (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y) 212fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D3(n, d, x, y, z) \ 213fe6060f1SDimitry Andric (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d, x, y, z) 214fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D4(n, d, x, y, z, a) \ 215fe6060f1SDimitry Andric (!(d)->flags) ? 0 \ 216fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? 0 \ 217fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y, z, a) 218fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D5(n, d, x, y, z, a, b) \ 219fe6060f1SDimitry Andric (!(d)->flags) ? 0 \ 220fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? 0 \ 221fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y, z, a, b) 222fe6060f1SDimitry Andric #define ITTNOTIFY_DATA_D6(n, d, x, y, z, a, b, c) \ 223fe6060f1SDimitry Andric (!(d)->flags) ? 0 \ 224fe6060f1SDimitry Andric : (!ITTNOTIFY_NAME(n)) ? 0 \ 225fe6060f1SDimitry Andric : ITTNOTIFY_NAME(n)(d, x, y, z, a, b, c) 2260b57cec5SDimitry Andric 2270b57cec5SDimitry Andric #ifdef ITT_STUB 2280b57cec5SDimitry Andric #undef ITT_STUB 2290b57cec5SDimitry Andric #endif 2300b57cec5SDimitry Andric #ifdef ITT_STUBV 2310b57cec5SDimitry Andric #undef ITT_STUBV 2320b57cec5SDimitry Andric #endif 2330b57cec5SDimitry Andric #define ITT_STUBV(api, type, name, args) \ 2340b57cec5SDimitry Andric typedef type(api *ITT_JOIN(ITTNOTIFY_NAME(name), _t)) args; \ 2350b57cec5SDimitry Andric extern ITT_JOIN(ITTNOTIFY_NAME(name), _t) ITTNOTIFY_NAME(name); 2360b57cec5SDimitry Andric #define ITT_STUB ITT_STUBV 2370b57cec5SDimitry Andric /** @endcond */ 2380b57cec5SDimitry Andric 2390b57cec5SDimitry Andric #ifdef __cplusplus 2400b57cec5SDimitry Andric extern "C" { 2410b57cec5SDimitry Andric #endif /* __cplusplus */ 2420b57cec5SDimitry Andric 2430b57cec5SDimitry Andric /** 2440b57cec5SDimitry Andric * @defgroup legacy Legacy API 2450b57cec5SDimitry Andric * @{ 2460b57cec5SDimitry Andric * @} 2470b57cec5SDimitry Andric */ 2480b57cec5SDimitry Andric 2490b57cec5SDimitry Andric /** 2500b57cec5SDimitry Andric * @defgroup legacy_control Collection Control 2510b57cec5SDimitry Andric * @ingroup legacy 252fe6060f1SDimitry Andric * General behavior: application continues to run, but no profiling information 253fe6060f1SDimitry Andric * is being collected 2540b57cec5SDimitry Andric * 255fe6060f1SDimitry Andric * Pausing occurs not only for the current thread but for all process as well as 256fe6060f1SDimitry Andric * spawned processes 2570b57cec5SDimitry Andric * - Intel(R) Parallel Inspector and Intel(R) Inspector XE: 2580b57cec5SDimitry Andric * - Does not analyze or report errors that involve memory access. 2590b57cec5SDimitry Andric * - Other errors are reported as usual. Pausing data collection in 2600b57cec5SDimitry Andric * Intel(R) Parallel Inspector and Intel(R) Inspector XE 2610b57cec5SDimitry Andric * only pauses tracing and analyzing memory access. 2620b57cec5SDimitry Andric * It does not pause tracing or analyzing threading APIs. 2630b57cec5SDimitry Andric * . 2640b57cec5SDimitry Andric * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE: 2650b57cec5SDimitry Andric * - Does continue to record when new threads are started. 2660b57cec5SDimitry Andric * . 2670b57cec5SDimitry Andric * - Other effects: 2680b57cec5SDimitry Andric * - Possible reduction of runtime overhead. 2690b57cec5SDimitry Andric * . 2700b57cec5SDimitry Andric * @{ 2710b57cec5SDimitry Andric */ 2720b57cec5SDimitry Andric #ifndef _ITTNOTIFY_H_ 2730b57cec5SDimitry Andric /** @brief Pause collection */ 2740b57cec5SDimitry Andric void ITTAPI __itt_pause(void); 2750b57cec5SDimitry Andric /** @brief Resume collection */ 2760b57cec5SDimitry Andric void ITTAPI __itt_resume(void); 2770b57cec5SDimitry Andric /** @brief Detach collection */ 2780b57cec5SDimitry Andric void ITTAPI __itt_detach(void); 2790b57cec5SDimitry Andric 2800b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 2810b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 2820b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 2830b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, pause, (void)) 2840b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, resume, (void)) 2850b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, detach, (void)) 2860b57cec5SDimitry Andric #define __itt_pause ITTNOTIFY_VOID(pause) 2870b57cec5SDimitry Andric #define __itt_pause_ptr ITTNOTIFY_NAME(pause) 2880b57cec5SDimitry Andric #define __itt_resume ITTNOTIFY_VOID(resume) 2890b57cec5SDimitry Andric #define __itt_resume_ptr ITTNOTIFY_NAME(resume) 2900b57cec5SDimitry Andric #define __itt_detach ITTNOTIFY_VOID(detach) 2910b57cec5SDimitry Andric #define __itt_detach_ptr ITTNOTIFY_NAME(detach) 2920b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 2930b57cec5SDimitry Andric #define __itt_pause() 2940b57cec5SDimitry Andric #define __itt_pause_ptr 0 2950b57cec5SDimitry Andric #define __itt_resume() 2960b57cec5SDimitry Andric #define __itt_resume_ptr 0 2970b57cec5SDimitry Andric #define __itt_detach() 2980b57cec5SDimitry Andric #define __itt_detach_ptr 0 2990b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 3000b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 3010b57cec5SDimitry Andric #define __itt_pause_ptr 0 3020b57cec5SDimitry Andric #define __itt_resume_ptr 0 3030b57cec5SDimitry Andric #define __itt_detach_ptr 0 3040b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 3050b57cec5SDimitry Andric /** @endcond */ 3060b57cec5SDimitry Andric #endif /* _ITTNOTIFY_H_ */ 3070b57cec5SDimitry Andric /** @} legacy_control group */ 3080b57cec5SDimitry Andric 3090b57cec5SDimitry Andric /** 3100b57cec5SDimitry Andric * @defgroup legacy_threads Threads 3110b57cec5SDimitry Andric * @ingroup legacy 3120b57cec5SDimitry Andric * Threads group 3130b57cec5SDimitry Andric * @warning Legacy API 3140b57cec5SDimitry Andric * @{ 3150b57cec5SDimitry Andric */ 3160b57cec5SDimitry Andric /** 3170b57cec5SDimitry Andric * @deprecated Legacy API 3180b57cec5SDimitry Andric * @brief Set name to be associated with thread in analysis GUI. 319fe6060f1SDimitry Andric * @return __itt_err upon failure (name or namelen being null,name and namelen 320fe6060f1SDimitry Andric * mismatched) 3210b57cec5SDimitry Andric */ 3220b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 3230b57cec5SDimitry Andric int LIBITTAPI __itt_thr_name_setA(const char *name, int namelen); 3240b57cec5SDimitry Andric int LIBITTAPI __itt_thr_name_setW(const wchar_t *name, int namelen); 3250b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE) 3260b57cec5SDimitry Andric #define __itt_thr_name_set __itt_thr_name_setW 3270b57cec5SDimitry Andric #define __itt_thr_name_set_ptr __itt_thr_name_setW_ptr 3280b57cec5SDimitry Andric #else 3290b57cec5SDimitry Andric #define __itt_thr_name_set __itt_thr_name_setA 3300b57cec5SDimitry Andric #define __itt_thr_name_set_ptr __itt_thr_name_setA_ptr 3310b57cec5SDimitry Andric #endif /* UNICODE */ 3320b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3330b57cec5SDimitry Andric int LIBITTAPI __itt_thr_name_set(const char *name, int namelen); 3340b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3350b57cec5SDimitry Andric 3360b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 3370b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 3380b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 3390b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 3400b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, int, thr_name_setA, (const char *name, int namelen)) 3410b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen)) 3420b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3430b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen)) 3440b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3450b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 3460b57cec5SDimitry Andric #define __itt_thr_name_setA ITTNOTIFY_DATA(thr_name_setA) 3470b57cec5SDimitry Andric #define __itt_thr_name_setA_ptr ITTNOTIFY_NAME(thr_name_setA) 3480b57cec5SDimitry Andric #define __itt_thr_name_setW ITTNOTIFY_DATA(thr_name_setW) 3490b57cec5SDimitry Andric #define __itt_thr_name_setW_ptr ITTNOTIFY_NAME(thr_name_setW) 3500b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3510b57cec5SDimitry Andric #define __itt_thr_name_set ITTNOTIFY_DATA(thr_name_set) 3520b57cec5SDimitry Andric #define __itt_thr_name_set_ptr ITTNOTIFY_NAME(thr_name_set) 3530b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3540b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 3550b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 3560b57cec5SDimitry Andric #define __itt_thr_name_setA(name, namelen) 3570b57cec5SDimitry Andric #define __itt_thr_name_setA_ptr 0 3580b57cec5SDimitry Andric #define __itt_thr_name_setW(name, namelen) 3590b57cec5SDimitry Andric #define __itt_thr_name_setW_ptr 0 3600b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3610b57cec5SDimitry Andric #define __itt_thr_name_set(name, namelen) 3620b57cec5SDimitry Andric #define __itt_thr_name_set_ptr 0 3630b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3640b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 3650b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 3660b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 3670b57cec5SDimitry Andric #define __itt_thr_name_setA_ptr 0 3680b57cec5SDimitry Andric #define __itt_thr_name_setW_ptr 0 3690b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3700b57cec5SDimitry Andric #define __itt_thr_name_set_ptr 0 3710b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 3720b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 3730b57cec5SDimitry Andric /** @endcond */ 3740b57cec5SDimitry Andric 3750b57cec5SDimitry Andric /** 3760b57cec5SDimitry Andric * @deprecated Legacy API 377fe6060f1SDimitry Andric * @brief Mark current thread as ignored from this point on, for the duration of 378fe6060f1SDimitry Andric * its existence. 3790b57cec5SDimitry Andric */ 3800b57cec5SDimitry Andric void LIBITTAPI __itt_thr_ignore(void); 3810b57cec5SDimitry Andric 3820b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 3830b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 3840b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 3850b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, thr_ignore, (void)) 3860b57cec5SDimitry Andric #define __itt_thr_ignore ITTNOTIFY_VOID(thr_ignore) 3870b57cec5SDimitry Andric #define __itt_thr_ignore_ptr ITTNOTIFY_NAME(thr_ignore) 3880b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 3890b57cec5SDimitry Andric #define __itt_thr_ignore() 3900b57cec5SDimitry Andric #define __itt_thr_ignore_ptr 0 3910b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 3920b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 3930b57cec5SDimitry Andric #define __itt_thr_ignore_ptr 0 3940b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 3950b57cec5SDimitry Andric /** @endcond */ 3960b57cec5SDimitry Andric /** @} legacy_threads group */ 3970b57cec5SDimitry Andric 3980b57cec5SDimitry Andric /** 3990b57cec5SDimitry Andric * @defgroup legacy_sync Synchronization 4000b57cec5SDimitry Andric * @ingroup legacy 4010b57cec5SDimitry Andric * Synchronization group 4020b57cec5SDimitry Andric * @warning Legacy API 4030b57cec5SDimitry Andric * @{ 4040b57cec5SDimitry Andric */ 4050b57cec5SDimitry Andric /** 4060b57cec5SDimitry Andric * @hideinitializer 4070b57cec5SDimitry Andric * @brief possible value of attribute argument for sync object type 4080b57cec5SDimitry Andric */ 4090b57cec5SDimitry Andric #define __itt_attr_barrier 1 4100b57cec5SDimitry Andric 4110b57cec5SDimitry Andric /** 4120b57cec5SDimitry Andric * @hideinitializer 4130b57cec5SDimitry Andric * @brief possible value of attribute argument for sync object type 4140b57cec5SDimitry Andric */ 4150b57cec5SDimitry Andric #define __itt_attr_mutex 2 4160b57cec5SDimitry Andric 4170b57cec5SDimitry Andric /** 4180b57cec5SDimitry Andric * @deprecated Legacy API 4190b57cec5SDimitry Andric * @brief Assign a name to a sync object using char or Unicode string 420fe6060f1SDimitry Andric * @param[in] addr - pointer to the sync object. You should use a real 421fe6060f1SDimitry Andric * pointer to your object to make sure that the values don't clash with other 422fe6060f1SDimitry Andric * object addresses 423fe6060f1SDimitry Andric * @param[in] objtype - null-terminated object type string. If NULL is passed, 424fe6060f1SDimitry Andric * the object will be assumed to be of generic "User Synchronization" type 425fe6060f1SDimitry Andric * @param[in] objname - null-terminated object name string. If NULL, no name 426fe6060f1SDimitry Andric * will be assigned to the object -- you can use the __itt_sync_rename call 427fe6060f1SDimitry Andric * later to assign the name 428fe6060f1SDimitry Andric * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values 429fe6060f1SDimitry Andric * which defines the exact semantics of how prepare/acquired/releasing calls 430fe6060f1SDimitry Andric * work. 4310b57cec5SDimitry Andric */ 4320b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 433fe6060f1SDimitry Andric void ITTAPI __itt_sync_set_nameA(void *addr, const char *objtype, 434fe6060f1SDimitry Andric const char *objname, int attribute); 435fe6060f1SDimitry Andric void ITTAPI __itt_sync_set_nameW(void *addr, const wchar_t *objtype, 436fe6060f1SDimitry Andric const wchar_t *objname, int attribute); 4370b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE) 4380b57cec5SDimitry Andric #define __itt_sync_set_name __itt_sync_set_nameW 4390b57cec5SDimitry Andric #define __itt_sync_set_name_ptr __itt_sync_set_nameW_ptr 4400b57cec5SDimitry Andric #else /* UNICODE */ 4410b57cec5SDimitry Andric #define __itt_sync_set_name __itt_sync_set_nameA 4420b57cec5SDimitry Andric #define __itt_sync_set_name_ptr __itt_sync_set_nameA_ptr 4430b57cec5SDimitry Andric #endif /* UNICODE */ 4440b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 445fe6060f1SDimitry Andric void ITTAPI __itt_sync_set_name(void *addr, const char *objtype, 446fe6060f1SDimitry Andric const char *objname, int attribute); 4470b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4480b57cec5SDimitry Andric 4490b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 4500b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 4510b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 4520b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 453fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, sync_set_nameA, 454fe6060f1SDimitry Andric (void *addr, const char *objtype, const char *objname, int attribute)) 455fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, sync_set_nameW, 456fe6060f1SDimitry Andric (void *addr, const wchar_t *objtype, const wchar_t *objname, 457fe6060f1SDimitry Andric int attribute)) 4580b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 459fe6060f1SDimitry Andric ITT_STUBV(ITTAPI, void, sync_set_name, 460fe6060f1SDimitry Andric (void *addr, const char *objtype, const char *objname, int attribute)) 4610b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4620b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 4630b57cec5SDimitry Andric #define __itt_sync_set_nameA ITTNOTIFY_VOID(sync_set_nameA) 4640b57cec5SDimitry Andric #define __itt_sync_set_nameA_ptr ITTNOTIFY_NAME(sync_set_nameA) 4650b57cec5SDimitry Andric #define __itt_sync_set_nameW ITTNOTIFY_VOID(sync_set_nameW) 4660b57cec5SDimitry Andric #define __itt_sync_set_nameW_ptr ITTNOTIFY_NAME(sync_set_nameW) 4670b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4680b57cec5SDimitry Andric #define __itt_sync_set_name ITTNOTIFY_VOID(sync_set_name) 4690b57cec5SDimitry Andric #define __itt_sync_set_name_ptr ITTNOTIFY_NAME(sync_set_name) 4700b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4710b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 4720b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 4730b57cec5SDimitry Andric #define __itt_sync_set_nameA(addr, objtype, objname, attribute) 4740b57cec5SDimitry Andric #define __itt_sync_set_nameA_ptr 0 4750b57cec5SDimitry Andric #define __itt_sync_set_nameW(addr, objtype, objname, attribute) 4760b57cec5SDimitry Andric #define __itt_sync_set_nameW_ptr 0 4770b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4780b57cec5SDimitry Andric #define __itt_sync_set_name(addr, objtype, objname, attribute) 4790b57cec5SDimitry Andric #define __itt_sync_set_name_ptr 0 4800b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4810b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 4820b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 4830b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 4840b57cec5SDimitry Andric #define __itt_sync_set_nameA_ptr 0 4850b57cec5SDimitry Andric #define __itt_sync_set_nameW_ptr 0 4860b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4870b57cec5SDimitry Andric #define __itt_sync_set_name_ptr 0 4880b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 4890b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 4900b57cec5SDimitry Andric /** @endcond */ 4910b57cec5SDimitry Andric 4920b57cec5SDimitry Andric /** 4930b57cec5SDimitry Andric * @deprecated Legacy API 4940b57cec5SDimitry Andric * @brief Assign a name and type to a sync object using char or Unicode string 495fe6060f1SDimitry Andric * @param[in] addr - pointer to the sync object. You should use a real 496fe6060f1SDimitry Andric * pointer to your object to make sure that the values don't clash with other 497fe6060f1SDimitry Andric * object addresses 498fe6060f1SDimitry Andric * @param[in] objtype - null-terminated object type string. If NULL is passed, 499fe6060f1SDimitry Andric * the object will be assumed to be of generic "User Synchronization" type 500fe6060f1SDimitry Andric * @param[in] objname - null-terminated object name string. If NULL, no name 501fe6060f1SDimitry Andric * will be assigned to the object -- you can use the __itt_sync_rename call 502fe6060f1SDimitry Andric * later to assign the name 503fe6060f1SDimitry Andric * @param[in] typelen, namelen - a length of string for appropriate objtype 504fe6060f1SDimitry Andric * and objname parameter 505fe6060f1SDimitry Andric * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values 506fe6060f1SDimitry Andric * which defines the exact semantics of how prepare/acquired/releasing calls 507fe6060f1SDimitry Andric * work. 508fe6060f1SDimitry Andric * @return __itt_err upon failure (name or namelen being null,name and namelen 509fe6060f1SDimitry Andric * mismatched) 5100b57cec5SDimitry Andric */ 5110b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 512fe6060f1SDimitry Andric int LIBITTAPI __itt_notify_sync_nameA(void *addr, const char *objtype, 513fe6060f1SDimitry Andric int typelen, const char *objname, 514fe6060f1SDimitry Andric int namelen, int attribute); 515fe6060f1SDimitry Andric int LIBITTAPI __itt_notify_sync_nameW(void *addr, const wchar_t *objtype, 516fe6060f1SDimitry Andric int typelen, const wchar_t *objname, 517fe6060f1SDimitry Andric int namelen, int attribute); 5180b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE) 5190b57cec5SDimitry Andric #define __itt_notify_sync_name __itt_notify_sync_nameW 5200b57cec5SDimitry Andric #else 5210b57cec5SDimitry Andric #define __itt_notify_sync_name __itt_notify_sync_nameA 5220b57cec5SDimitry Andric #endif 5230b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 524fe6060f1SDimitry Andric int LIBITTAPI __itt_notify_sync_name(void *addr, const char *objtype, 525fe6060f1SDimitry Andric int typelen, const char *objname, 526fe6060f1SDimitry Andric int namelen, int attribute); 5270b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 5280b57cec5SDimitry Andric 5290b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 5300b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 5310b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 5320b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 533fe6060f1SDimitry Andric ITT_STUB(LIBITTAPI, int, notify_sync_nameA, 534fe6060f1SDimitry Andric (void *addr, const char *objtype, int typelen, const char *objname, 535fe6060f1SDimitry Andric int namelen, int attribute)) 536fe6060f1SDimitry Andric ITT_STUB(LIBITTAPI, int, notify_sync_nameW, 537fe6060f1SDimitry Andric (void *addr, const wchar_t *objtype, int typelen, 538fe6060f1SDimitry Andric const wchar_t *objname, int namelen, int attribute)) 5390b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 540fe6060f1SDimitry Andric ITT_STUB(LIBITTAPI, int, notify_sync_name, 541fe6060f1SDimitry Andric (void *addr, const char *objtype, int typelen, const char *objname, 542fe6060f1SDimitry Andric int namelen, int attribute)) 5430b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 5440b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 5450b57cec5SDimitry Andric #define __itt_notify_sync_nameA ITTNOTIFY_DATA(notify_sync_nameA) 5460b57cec5SDimitry Andric #define __itt_notify_sync_nameA_ptr ITTNOTIFY_NAME(notify_sync_nameA) 5470b57cec5SDimitry Andric #define __itt_notify_sync_nameW ITTNOTIFY_DATA(notify_sync_nameW) 5480b57cec5SDimitry Andric #define __itt_notify_sync_nameW_ptr ITTNOTIFY_NAME(notify_sync_nameW) 5490b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 5500b57cec5SDimitry Andric #define __itt_notify_sync_name ITTNOTIFY_DATA(notify_sync_name) 5510b57cec5SDimitry Andric #define __itt_notify_sync_name_ptr ITTNOTIFY_NAME(notify_sync_name) 5520b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 5530b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 5540b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 555fe6060f1SDimitry Andric #define __itt_notify_sync_nameA(addr, objtype, typelen, objname, namelen, \ 556fe6060f1SDimitry Andric attribute) 5570b57cec5SDimitry Andric #define __itt_notify_sync_nameA_ptr 0 558fe6060f1SDimitry Andric #define __itt_notify_sync_nameW(addr, objtype, typelen, objname, namelen, \ 559fe6060f1SDimitry Andric attribute) 5600b57cec5SDimitry Andric #define __itt_notify_sync_nameW_ptr 0 5610b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 562fe6060f1SDimitry Andric #define __itt_notify_sync_name(addr, objtype, typelen, objname, namelen, \ 563fe6060f1SDimitry Andric attribute) 5640b57cec5SDimitry Andric #define __itt_notify_sync_name_ptr 0 5650b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 5660b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 5670b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 5680b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 5690b57cec5SDimitry Andric #define __itt_notify_sync_nameA_ptr 0 5700b57cec5SDimitry Andric #define __itt_notify_sync_nameW_ptr 0 5710b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 5720b57cec5SDimitry Andric #define __itt_notify_sync_name_ptr 0 5730b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 5740b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 5750b57cec5SDimitry Andric /** @endcond */ 5760b57cec5SDimitry Andric 5770b57cec5SDimitry Andric /** 5780b57cec5SDimitry Andric * @deprecated Legacy API 5790b57cec5SDimitry Andric * @brief Enter spin loop on user-defined sync object 5800b57cec5SDimitry Andric */ 5810b57cec5SDimitry Andric void LIBITTAPI __itt_notify_sync_prepare(void *addr); 5820b57cec5SDimitry Andric 5830b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 5840b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 5850b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 5860b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, notify_sync_prepare, (void *addr)) 5870b57cec5SDimitry Andric #define __itt_notify_sync_prepare ITTNOTIFY_VOID(notify_sync_prepare) 5880b57cec5SDimitry Andric #define __itt_notify_sync_prepare_ptr ITTNOTIFY_NAME(notify_sync_prepare) 5890b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 5900b57cec5SDimitry Andric #define __itt_notify_sync_prepare(addr) 5910b57cec5SDimitry Andric #define __itt_notify_sync_prepare_ptr 0 5920b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 5930b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 5940b57cec5SDimitry Andric #define __itt_notify_sync_prepare_ptr 0 5950b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 5960b57cec5SDimitry Andric /** @endcond */ 5970b57cec5SDimitry Andric 5980b57cec5SDimitry Andric /** 5990b57cec5SDimitry Andric * @deprecated Legacy API 6000b57cec5SDimitry Andric * @brief Quit spin loop without acquiring spin object 6010b57cec5SDimitry Andric */ 6020b57cec5SDimitry Andric void LIBITTAPI __itt_notify_sync_cancel(void *addr); 6030b57cec5SDimitry Andric 6040b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 6050b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 6060b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 6070b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, notify_sync_cancel, (void *addr)) 6080b57cec5SDimitry Andric #define __itt_notify_sync_cancel ITTNOTIFY_VOID(notify_sync_cancel) 6090b57cec5SDimitry Andric #define __itt_notify_sync_cancel_ptr ITTNOTIFY_NAME(notify_sync_cancel) 6100b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 6110b57cec5SDimitry Andric #define __itt_notify_sync_cancel(addr) 6120b57cec5SDimitry Andric #define __itt_notify_sync_cancel_ptr 0 6130b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 6140b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 6150b57cec5SDimitry Andric #define __itt_notify_sync_cancel_ptr 0 6160b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 6170b57cec5SDimitry Andric /** @endcond */ 6180b57cec5SDimitry Andric 6190b57cec5SDimitry Andric /** 6200b57cec5SDimitry Andric * @deprecated Legacy API 6210b57cec5SDimitry Andric * @brief Successful spin loop completion (sync object acquired) 6220b57cec5SDimitry Andric */ 6230b57cec5SDimitry Andric void LIBITTAPI __itt_notify_sync_acquired(void *addr); 6240b57cec5SDimitry Andric 6250b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 6260b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 6270b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 6280b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, notify_sync_acquired, (void *addr)) 6290b57cec5SDimitry Andric #define __itt_notify_sync_acquired ITTNOTIFY_VOID(notify_sync_acquired) 6300b57cec5SDimitry Andric #define __itt_notify_sync_acquired_ptr ITTNOTIFY_NAME(notify_sync_acquired) 6310b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 6320b57cec5SDimitry Andric #define __itt_notify_sync_acquired(addr) 6330b57cec5SDimitry Andric #define __itt_notify_sync_acquired_ptr 0 6340b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 6350b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 6360b57cec5SDimitry Andric #define __itt_notify_sync_acquired_ptr 0 6370b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 6380b57cec5SDimitry Andric /** @endcond */ 6390b57cec5SDimitry Andric 6400b57cec5SDimitry Andric /** 6410b57cec5SDimitry Andric * @deprecated Legacy API 642fe6060f1SDimitry Andric * @brief Start sync object releasing code. Is called before the lock release 643fe6060f1SDimitry Andric * call. 6440b57cec5SDimitry Andric */ 6450b57cec5SDimitry Andric void LIBITTAPI __itt_notify_sync_releasing(void *addr); 6460b57cec5SDimitry Andric 6470b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 6480b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 6490b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 6500b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, notify_sync_releasing, (void *addr)) 6510b57cec5SDimitry Andric #define __itt_notify_sync_releasing ITTNOTIFY_VOID(notify_sync_releasing) 6520b57cec5SDimitry Andric #define __itt_notify_sync_releasing_ptr ITTNOTIFY_NAME(notify_sync_releasing) 6530b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 6540b57cec5SDimitry Andric #define __itt_notify_sync_releasing(addr) 6550b57cec5SDimitry Andric #define __itt_notify_sync_releasing_ptr 0 6560b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 6570b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 6580b57cec5SDimitry Andric #define __itt_notify_sync_releasing_ptr 0 6590b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 6600b57cec5SDimitry Andric /** @endcond */ 6610b57cec5SDimitry Andric /** @} legacy_sync group */ 6620b57cec5SDimitry Andric 6630b57cec5SDimitry Andric #ifndef _ITTNOTIFY_H_ 6640b57cec5SDimitry Andric /** 6650b57cec5SDimitry Andric * @defgroup legacy_events Events 6660b57cec5SDimitry Andric * @ingroup legacy 6670b57cec5SDimitry Andric * Events group 6680b57cec5SDimitry Andric * @{ 6690b57cec5SDimitry Andric */ 6700b57cec5SDimitry Andric 6710b57cec5SDimitry Andric /** @brief user event type */ 6720b57cec5SDimitry Andric typedef int __itt_event; 6730b57cec5SDimitry Andric 6740b57cec5SDimitry Andric /** 6750b57cec5SDimitry Andric * @brief Create an event notification 676fe6060f1SDimitry Andric * @note name or namelen being null/name and namelen not matching, user event 677fe6060f1SDimitry Andric * feature not enabled 6780b57cec5SDimitry Andric * @return non-zero event identifier upon success and __itt_err otherwise 6790b57cec5SDimitry Andric */ 6800b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 6810b57cec5SDimitry Andric __itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen); 6820b57cec5SDimitry Andric __itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen); 6830b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE) 6840b57cec5SDimitry Andric #define __itt_event_create __itt_event_createW 6850b57cec5SDimitry Andric #define __itt_event_create_ptr __itt_event_createW_ptr 6860b57cec5SDimitry Andric #else 6870b57cec5SDimitry Andric #define __itt_event_create __itt_event_createA 6880b57cec5SDimitry Andric #define __itt_event_create_ptr __itt_event_createA_ptr 6890b57cec5SDimitry Andric #endif /* UNICODE */ 6900b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 6910b57cec5SDimitry Andric __itt_event LIBITTAPI __itt_event_create(const char *name, int namelen); 6920b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 6930b57cec5SDimitry Andric 6940b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 6950b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 6960b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 6970b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 6980b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen)) 699fe6060f1SDimitry Andric ITT_STUB(LIBITTAPI, __itt_event, event_createW, 700fe6060f1SDimitry Andric (const wchar_t *name, int namelen)) 7010b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7020b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen)) 7030b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7040b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 7050b57cec5SDimitry Andric #define __itt_event_createA ITTNOTIFY_DATA(event_createA) 7060b57cec5SDimitry Andric #define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA) 7070b57cec5SDimitry Andric #define __itt_event_createW ITTNOTIFY_DATA(event_createW) 7080b57cec5SDimitry Andric #define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW) 7090b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7100b57cec5SDimitry Andric #define __itt_event_create ITTNOTIFY_DATA(event_create) 7110b57cec5SDimitry Andric #define __itt_event_create_ptr ITTNOTIFY_NAME(event_create) 7120b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7130b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 7140b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 7150b57cec5SDimitry Andric #define __itt_event_createA(name, namelen) (__itt_event)0 7160b57cec5SDimitry Andric #define __itt_event_createA_ptr 0 7170b57cec5SDimitry Andric #define __itt_event_createW(name, namelen) (__itt_event)0 7180b57cec5SDimitry Andric #define __itt_event_createW_ptr 0 7190b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7200b57cec5SDimitry Andric #define __itt_event_create(name, namelen) (__itt_event)0 7210b57cec5SDimitry Andric #define __itt_event_create_ptr 0 7220b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7230b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 7240b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 7250b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 7260b57cec5SDimitry Andric #define __itt_event_createA_ptr 0 7270b57cec5SDimitry Andric #define __itt_event_createW_ptr 0 7280b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7290b57cec5SDimitry Andric #define __itt_event_create_ptr 0 7300b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 7310b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 7320b57cec5SDimitry Andric /** @endcond */ 7330b57cec5SDimitry Andric 7340b57cec5SDimitry Andric /** 7350b57cec5SDimitry Andric * @brief Record an event occurrence. 736fe6060f1SDimitry Andric * @return __itt_err upon failure (invalid event id/user event feature not 737fe6060f1SDimitry Andric * enabled) 7380b57cec5SDimitry Andric */ 7390b57cec5SDimitry Andric int LIBITTAPI __itt_event_start(__itt_event event); 7400b57cec5SDimitry Andric 7410b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 7420b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 7430b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 7440b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event)) 7450b57cec5SDimitry Andric #define __itt_event_start ITTNOTIFY_DATA(event_start) 7460b57cec5SDimitry Andric #define __itt_event_start_ptr ITTNOTIFY_NAME(event_start) 7470b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 7480b57cec5SDimitry Andric #define __itt_event_start(event) (int)0 7490b57cec5SDimitry Andric #define __itt_event_start_ptr 0 7500b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 7510b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 7520b57cec5SDimitry Andric #define __itt_event_start_ptr 0 7530b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 7540b57cec5SDimitry Andric /** @endcond */ 7550b57cec5SDimitry Andric 7560b57cec5SDimitry Andric /** 7570b57cec5SDimitry Andric * @brief Record an event end occurrence. 7580b57cec5SDimitry Andric * @note It is optional if events do not have durations. 759fe6060f1SDimitry Andric * @return __itt_err upon failure (invalid event id/user event feature not 760fe6060f1SDimitry Andric * enabled) 7610b57cec5SDimitry Andric */ 7620b57cec5SDimitry Andric int LIBITTAPI __itt_event_end(__itt_event event); 7630b57cec5SDimitry Andric 7640b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 7650b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 7660b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 7670b57cec5SDimitry Andric ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event)) 7680b57cec5SDimitry Andric #define __itt_event_end ITTNOTIFY_DATA(event_end) 7690b57cec5SDimitry Andric #define __itt_event_end_ptr ITTNOTIFY_NAME(event_end) 7700b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 7710b57cec5SDimitry Andric #define __itt_event_end(event) (int)0 7720b57cec5SDimitry Andric #define __itt_event_end_ptr 0 7730b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 7740b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 7750b57cec5SDimitry Andric #define __itt_event_end_ptr 0 7760b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 7770b57cec5SDimitry Andric /** @endcond */ 7780b57cec5SDimitry Andric /** @} legacy_events group */ 7790b57cec5SDimitry Andric #endif /* _ITTNOTIFY_H_ */ 7800b57cec5SDimitry Andric 7810b57cec5SDimitry Andric /** 7820b57cec5SDimitry Andric * @defgroup legacy_memory Memory Accesses 7830b57cec5SDimitry Andric * @ingroup legacy 7840b57cec5SDimitry Andric */ 7850b57cec5SDimitry Andric 7860b57cec5SDimitry Andric /** 7870b57cec5SDimitry Andric * @deprecated Legacy API 7880b57cec5SDimitry Andric * @brief Inform the tool of memory accesses on reading 7890b57cec5SDimitry Andric */ 7900b57cec5SDimitry Andric void LIBITTAPI __itt_memory_read(void *addr, size_t size); 7910b57cec5SDimitry Andric 7920b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 7930b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 7940b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 7950b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, memory_read, (void *addr, size_t size)) 7960b57cec5SDimitry Andric #define __itt_memory_read ITTNOTIFY_VOID(memory_read) 7970b57cec5SDimitry Andric #define __itt_memory_read_ptr ITTNOTIFY_NAME(memory_read) 7980b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 7990b57cec5SDimitry Andric #define __itt_memory_read(addr, size) 8000b57cec5SDimitry Andric #define __itt_memory_read_ptr 0 8010b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 8020b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 8030b57cec5SDimitry Andric #define __itt_memory_read_ptr 0 8040b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 8050b57cec5SDimitry Andric /** @endcond */ 8060b57cec5SDimitry Andric 8070b57cec5SDimitry Andric /** 8080b57cec5SDimitry Andric * @deprecated Legacy API 8090b57cec5SDimitry Andric * @brief Inform the tool of memory accesses on writing 8100b57cec5SDimitry Andric */ 8110b57cec5SDimitry Andric void LIBITTAPI __itt_memory_write(void *addr, size_t size); 8120b57cec5SDimitry Andric 8130b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 8140b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 8150b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 8160b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, memory_write, (void *addr, size_t size)) 8170b57cec5SDimitry Andric #define __itt_memory_write ITTNOTIFY_VOID(memory_write) 8180b57cec5SDimitry Andric #define __itt_memory_write_ptr ITTNOTIFY_NAME(memory_write) 8190b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 8200b57cec5SDimitry Andric #define __itt_memory_write(addr, size) 8210b57cec5SDimitry Andric #define __itt_memory_write_ptr 0 8220b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 8230b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 8240b57cec5SDimitry Andric #define __itt_memory_write_ptr 0 8250b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 8260b57cec5SDimitry Andric /** @endcond */ 8270b57cec5SDimitry Andric 8280b57cec5SDimitry Andric /** 8290b57cec5SDimitry Andric * @deprecated Legacy API 8300b57cec5SDimitry Andric * @brief Inform the tool of memory accesses on updating 8310b57cec5SDimitry Andric */ 8320b57cec5SDimitry Andric void LIBITTAPI __itt_memory_update(void *address, size_t size); 8330b57cec5SDimitry Andric 8340b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 8350b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 8360b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 8370b57cec5SDimitry Andric ITT_STUBV(LIBITTAPI, void, memory_update, (void *addr, size_t size)) 8380b57cec5SDimitry Andric #define __itt_memory_update ITTNOTIFY_VOID(memory_update) 8390b57cec5SDimitry Andric #define __itt_memory_update_ptr ITTNOTIFY_NAME(memory_update) 8400b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 8410b57cec5SDimitry Andric #define __itt_memory_update(addr, size) 8420b57cec5SDimitry Andric #define __itt_memory_update_ptr 0 8430b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 8440b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 8450b57cec5SDimitry Andric #define __itt_memory_update_ptr 0 8460b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 8470b57cec5SDimitry Andric /** @endcond */ 8480b57cec5SDimitry Andric /** @} legacy_memory group */ 8490b57cec5SDimitry Andric 8500b57cec5SDimitry Andric /** 8510b57cec5SDimitry Andric * @defgroup legacy_state Thread and Object States 8520b57cec5SDimitry Andric * @ingroup legacy 8530b57cec5SDimitry Andric */ 8540b57cec5SDimitry Andric 8550b57cec5SDimitry Andric /** @brief state type */ 8560b57cec5SDimitry Andric typedef int __itt_state_t; 8570b57cec5SDimitry Andric 8580b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 8590b57cec5SDimitry Andric typedef enum __itt_obj_state { 8600b57cec5SDimitry Andric __itt_obj_state_err = 0, 8610b57cec5SDimitry Andric __itt_obj_state_clr = 1, 8620b57cec5SDimitry Andric __itt_obj_state_set = 2, 8630b57cec5SDimitry Andric __itt_obj_state_use = 3 8640b57cec5SDimitry Andric } __itt_obj_state_t; 8650b57cec5SDimitry Andric 8660b57cec5SDimitry Andric typedef enum __itt_thr_state { 8670b57cec5SDimitry Andric __itt_thr_state_err = 0, 8680b57cec5SDimitry Andric __itt_thr_state_clr = 1, 8690b57cec5SDimitry Andric __itt_thr_state_set = 2 8700b57cec5SDimitry Andric } __itt_thr_state_t; 8710b57cec5SDimitry Andric 8720b57cec5SDimitry Andric typedef enum __itt_obj_prop { 8730b57cec5SDimitry Andric __itt_obj_prop_watch = 1, 8740b57cec5SDimitry Andric __itt_obj_prop_ignore = 2, 8750b57cec5SDimitry Andric __itt_obj_prop_sharable = 3 8760b57cec5SDimitry Andric } __itt_obj_prop_t; 8770b57cec5SDimitry Andric 878fe6060f1SDimitry Andric typedef enum __itt_thr_prop { __itt_thr_prop_quiet = 1 } __itt_thr_prop_t; 8790b57cec5SDimitry Andric /** @endcond */ 8800b57cec5SDimitry Andric 8810b57cec5SDimitry Andric /** 8820b57cec5SDimitry Andric * @deprecated Legacy API 8830b57cec5SDimitry Andric * @brief managing thread and object states 8840b57cec5SDimitry Andric */ 8850b57cec5SDimitry Andric __itt_state_t LIBITTAPI __itt_state_get(void); 8860b57cec5SDimitry Andric 8870b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 8880b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 8890b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 8900b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_state_t, state_get, (void)) 8910b57cec5SDimitry Andric #define __itt_state_get ITTNOTIFY_DATA(state_get) 8920b57cec5SDimitry Andric #define __itt_state_get_ptr ITTNOTIFY_NAME(state_get) 8930b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 8940b57cec5SDimitry Andric #define __itt_state_get(void) (__itt_state_t)0 8950b57cec5SDimitry Andric #define __itt_state_get_ptr 0 8960b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 8970b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 8980b57cec5SDimitry Andric #define __itt_state_get_ptr 0 8990b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 9000b57cec5SDimitry Andric /** @endcond */ 9010b57cec5SDimitry Andric 9020b57cec5SDimitry Andric /** 9030b57cec5SDimitry Andric * @deprecated Legacy API 9040b57cec5SDimitry Andric * @brief managing thread and object states 9050b57cec5SDimitry Andric */ 9060b57cec5SDimitry Andric __itt_state_t LIBITTAPI __itt_state_set(__itt_state_t s); 9070b57cec5SDimitry Andric 9080b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 9090b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 9100b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 9110b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_state_t, state_set, (__itt_state_t s)) 9120b57cec5SDimitry Andric #define __itt_state_set ITTNOTIFY_DATA(state_set) 9130b57cec5SDimitry Andric #define __itt_state_set_ptr ITTNOTIFY_NAME(state_set) 9140b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 9150b57cec5SDimitry Andric #define __itt_state_set(s) (__itt_state_t)0 9160b57cec5SDimitry Andric #define __itt_state_set_ptr 0 9170b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 9180b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 9190b57cec5SDimitry Andric #define __itt_state_set_ptr 0 9200b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 9210b57cec5SDimitry Andric /** @endcond */ 9220b57cec5SDimitry Andric 9230b57cec5SDimitry Andric /** 9240b57cec5SDimitry Andric * @deprecated Legacy API 9250b57cec5SDimitry Andric * @brief managing thread and object modes 9260b57cec5SDimitry Andric */ 927fe6060f1SDimitry Andric __itt_thr_state_t LIBITTAPI __itt_thr_mode_set(__itt_thr_prop_t p, 928fe6060f1SDimitry Andric __itt_thr_state_t s); 9290b57cec5SDimitry Andric 9300b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 9310b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 9320b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 933fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_thr_state_t, thr_mode_set, 934fe6060f1SDimitry Andric (__itt_thr_prop_t p, __itt_thr_state_t s)) 9350b57cec5SDimitry Andric #define __itt_thr_mode_set ITTNOTIFY_DATA(thr_mode_set) 9360b57cec5SDimitry Andric #define __itt_thr_mode_set_ptr ITTNOTIFY_NAME(thr_mode_set) 9370b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 9380b57cec5SDimitry Andric #define __itt_thr_mode_set(p, s) (__itt_thr_state_t)0 9390b57cec5SDimitry Andric #define __itt_thr_mode_set_ptr 0 9400b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 9410b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 9420b57cec5SDimitry Andric #define __itt_thr_mode_set_ptr 0 9430b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 9440b57cec5SDimitry Andric /** @endcond */ 9450b57cec5SDimitry Andric 9460b57cec5SDimitry Andric /** 9470b57cec5SDimitry Andric * @deprecated Legacy API 9480b57cec5SDimitry Andric * @brief managing thread and object modes 9490b57cec5SDimitry Andric */ 950fe6060f1SDimitry Andric __itt_obj_state_t LIBITTAPI __itt_obj_mode_set(__itt_obj_prop_t p, 951fe6060f1SDimitry Andric __itt_obj_state_t s); 9520b57cec5SDimitry Andric 9530b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 9540b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 9550b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 956fe6060f1SDimitry Andric ITT_STUB(ITTAPI, __itt_obj_state_t, obj_mode_set, 957fe6060f1SDimitry Andric (__itt_obj_prop_t p, __itt_obj_state_t s)) 9580b57cec5SDimitry Andric #define __itt_obj_mode_set ITTNOTIFY_DATA(obj_mode_set) 9590b57cec5SDimitry Andric #define __itt_obj_mode_set_ptr ITTNOTIFY_NAME(obj_mode_set) 9600b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 9610b57cec5SDimitry Andric #define __itt_obj_mode_set(p, s) (__itt_obj_state_t)0 9620b57cec5SDimitry Andric #define __itt_obj_mode_set_ptr 0 9630b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 9640b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 9650b57cec5SDimitry Andric #define __itt_obj_mode_set_ptr 0 9660b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 9670b57cec5SDimitry Andric /** @endcond */ 9680b57cec5SDimitry Andric /** @} legacy_state group */ 9690b57cec5SDimitry Andric 9700b57cec5SDimitry Andric /** 9710b57cec5SDimitry Andric * @defgroup frames Frames 9720b57cec5SDimitry Andric * @ingroup legacy 9730b57cec5SDimitry Andric * Frames group 9740b57cec5SDimitry Andric * @{ 9750b57cec5SDimitry Andric */ 9760b57cec5SDimitry Andric /** 9770b57cec5SDimitry Andric * @brief opaque structure for frame identification 9780b57cec5SDimitry Andric */ 9790b57cec5SDimitry Andric typedef struct __itt_frame_t *__itt_frame; 9800b57cec5SDimitry Andric 9810b57cec5SDimitry Andric /** 9820b57cec5SDimitry Andric * @brief Create a global frame with given domain 9830b57cec5SDimitry Andric */ 9840b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 9850b57cec5SDimitry Andric __itt_frame ITTAPI __itt_frame_createA(const char *domain); 9860b57cec5SDimitry Andric __itt_frame ITTAPI __itt_frame_createW(const wchar_t *domain); 9870b57cec5SDimitry Andric #if defined(UNICODE) || defined(_UNICODE) 9880b57cec5SDimitry Andric #define __itt_frame_create __itt_frame_createW 9890b57cec5SDimitry Andric #define __itt_frame_create_ptr __itt_frame_createW_ptr 9900b57cec5SDimitry Andric #else /* UNICODE */ 9910b57cec5SDimitry Andric #define __itt_frame_create __itt_frame_createA 9920b57cec5SDimitry Andric #define __itt_frame_create_ptr __itt_frame_createA_ptr 9930b57cec5SDimitry Andric #endif /* UNICODE */ 9940b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 9950b57cec5SDimitry Andric __itt_frame ITTAPI __itt_frame_create(const char *domain); 9960b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 9970b57cec5SDimitry Andric 9980b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 9990b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 10000b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 10010b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 10020b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_frame, frame_createA, (const char *domain)) 10030b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain)) 10040b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10050b57cec5SDimitry Andric ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain)) 10060b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10070b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 10080b57cec5SDimitry Andric #define __itt_frame_createA ITTNOTIFY_DATA(frame_createA) 10090b57cec5SDimitry Andric #define __itt_frame_createA_ptr ITTNOTIFY_NAME(frame_createA) 10100b57cec5SDimitry Andric #define __itt_frame_createW ITTNOTIFY_DATA(frame_createW) 10110b57cec5SDimitry Andric #define __itt_frame_createW_ptr ITTNOTIFY_NAME(frame_createW) 10120b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10130b57cec5SDimitry Andric #define __itt_frame_create ITTNOTIFY_DATA(frame_create) 10140b57cec5SDimitry Andric #define __itt_frame_create_ptr ITTNOTIFY_NAME(frame_create) 10150b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10160b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 10170b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 10180b57cec5SDimitry Andric #define __itt_frame_createA(domain) 10190b57cec5SDimitry Andric #define __itt_frame_createA_ptr 0 10200b57cec5SDimitry Andric #define __itt_frame_createW(domain) 10210b57cec5SDimitry Andric #define __itt_frame_createW_ptr 0 10220b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10230b57cec5SDimitry Andric #define __itt_frame_create(domain) 10240b57cec5SDimitry Andric #define __itt_frame_create_ptr 0 10250b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10260b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 10270b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 10280b57cec5SDimitry Andric #if ITT_PLATFORM == ITT_PLATFORM_WIN 10290b57cec5SDimitry Andric #define __itt_frame_createA_ptr 0 10300b57cec5SDimitry Andric #define __itt_frame_createW_ptr 0 10310b57cec5SDimitry Andric #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10320b57cec5SDimitry Andric #define __itt_frame_create_ptr 0 10330b57cec5SDimitry Andric #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 10340b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 10350b57cec5SDimitry Andric /** @endcond */ 10360b57cec5SDimitry Andric 1037480093f4SDimitry Andric /** @brief Record a frame begin occurrence. */ 10380b57cec5SDimitry Andric void ITTAPI __itt_frame_begin(__itt_frame frame); 1039480093f4SDimitry Andric /** @brief Record a frame end occurrence. */ 10400b57cec5SDimitry Andric void ITTAPI __itt_frame_end(__itt_frame frame); 10410b57cec5SDimitry Andric 10420b57cec5SDimitry Andric /** @cond exclude_from_documentation */ 10430b57cec5SDimitry Andric #ifndef INTEL_NO_MACRO_BODY 10440b57cec5SDimitry Andric #ifndef INTEL_NO_ITTNOTIFY_API 10450b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame)) 10460b57cec5SDimitry Andric ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame)) 10470b57cec5SDimitry Andric #define __itt_frame_begin ITTNOTIFY_VOID(frame_begin) 10480b57cec5SDimitry Andric #define __itt_frame_begin_ptr ITTNOTIFY_NAME(frame_begin) 10490b57cec5SDimitry Andric #define __itt_frame_end ITTNOTIFY_VOID(frame_end) 10500b57cec5SDimitry Andric #define __itt_frame_end_ptr ITTNOTIFY_NAME(frame_end) 10510b57cec5SDimitry Andric #else /* INTEL_NO_ITTNOTIFY_API */ 10520b57cec5SDimitry Andric #define __itt_frame_begin(frame) 10530b57cec5SDimitry Andric #define __itt_frame_begin_ptr 0 10540b57cec5SDimitry Andric #define __itt_frame_end(frame) 10550b57cec5SDimitry Andric #define __itt_frame_end_ptr 0 10560b57cec5SDimitry Andric #endif /* INTEL_NO_ITTNOTIFY_API */ 10570b57cec5SDimitry Andric #else /* INTEL_NO_MACRO_BODY */ 10580b57cec5SDimitry Andric #define __itt_frame_begin_ptr 0 10590b57cec5SDimitry Andric #define __itt_frame_end_ptr 0 10600b57cec5SDimitry Andric #endif /* INTEL_NO_MACRO_BODY */ 10610b57cec5SDimitry Andric /** @endcond */ 10620b57cec5SDimitry Andric /** @} frames group */ 10630b57cec5SDimitry Andric 10640b57cec5SDimitry Andric #ifdef __cplusplus 10650b57cec5SDimitry Andric } 10660b57cec5SDimitry Andric #endif /* __cplusplus */ 10670b57cec5SDimitry Andric 10680b57cec5SDimitry Andric #endif /* _LEGACY_ITTNOTIFY_H_ */ 1069