ittnotify.h 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  1. /*
  2. Copyright (C) 2005-2019 Intel Corporation
  3. SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
  4. */
  5. #ifndef _LEGACY_ITTNOTIFY_H_
  6. #define _LEGACY_ITTNOTIFY_H_
  7. /**
  8. * @file
  9. * @brief Legacy User API functions and types
  10. */
  11. /** @cond exclude_from_documentation */
  12. #ifndef ITT_OS_WIN
  13. # define ITT_OS_WIN 1
  14. #endif /* ITT_OS_WIN */
  15. #ifndef ITT_OS_LINUX
  16. # define ITT_OS_LINUX 2
  17. #endif /* ITT_OS_LINUX */
  18. #ifndef ITT_OS_MAC
  19. # define ITT_OS_MAC 3
  20. #endif /* ITT_OS_MAC */
  21. #ifndef ITT_OS_FREEBSD
  22. # define ITT_OS_FREEBSD 4
  23. #endif /* ITT_OS_FREEBSD */
  24. #ifndef ITT_OS_OPENBSD
  25. # define ITT_OS_OPENBSD 5
  26. #endif /* ITT_OS_OPENBSD */
  27. #ifndef ITT_OS
  28. # if defined WIN32 || defined _WIN32
  29. # define ITT_OS ITT_OS_WIN
  30. # elif defined( __APPLE__ ) && defined( __MACH__ )
  31. # define ITT_OS ITT_OS_MAC
  32. # elif defined( __FreeBSD__ )
  33. # define ITT_OS ITT_OS_FREEBSD
  34. # elif defined( __OpenBSD__ )
  35. # define ITT_OS ITT_OS_OPENBSD
  36. # else
  37. # define ITT_OS ITT_OS_LINUX
  38. # endif
  39. #endif /* ITT_OS */
  40. #ifndef ITT_PLATFORM_WIN
  41. # define ITT_PLATFORM_WIN 1
  42. #endif /* ITT_PLATFORM_WIN */
  43. #ifndef ITT_PLATFORM_POSIX
  44. # define ITT_PLATFORM_POSIX 2
  45. #endif /* ITT_PLATFORM_POSIX */
  46. #ifndef ITT_PLATFORM_MAC
  47. # define ITT_PLATFORM_MAC 3
  48. #endif /* ITT_PLATFORM_MAC */
  49. #ifndef ITT_PLATFORM_FREEBSD
  50. # define ITT_PLATFORM_FREEBSD 4
  51. #endif /* ITT_PLATFORM_FREEBSD */
  52. #ifndef ITT_PLATFORM_OPENBSD
  53. # define ITT_PLATFORM_OPENBSD 5
  54. #endif /* ITT_PLATFORM_OPENBSD */
  55. #ifndef ITT_PLATFORM
  56. # if ITT_OS==ITT_OS_WIN
  57. # define ITT_PLATFORM ITT_PLATFORM_WIN
  58. # elif ITT_OS==ITT_OS_MAC
  59. # define ITT_PLATFORM ITT_PLATFORM_MAC
  60. # elif ITT_OS==ITT_OS_FREEBSD
  61. # define ITT_PLATFORM ITT_PLATFORM_FREEBSD
  62. # elif ITT_OS==ITT_OS_OPENBSD
  63. # define ITT_PLATFORM ITT_PLATFORM_OPENBSD
  64. # else
  65. # define ITT_PLATFORM ITT_PLATFORM_POSIX
  66. # endif
  67. #endif /* ITT_PLATFORM */
  68. #if defined(_UNICODE) && !defined(UNICODE)
  69. #define UNICODE
  70. #endif
  71. #include <stddef.h>
  72. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  73. #include <tchar.h>
  74. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  75. #include <stdint.h>
  76. #if defined(UNICODE) || defined(_UNICODE)
  77. #include <wchar.h>
  78. #endif /* UNICODE || _UNICODE */
  79. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  80. #ifndef ITTAPI_CDECL
  81. # if ITT_PLATFORM==ITT_PLATFORM_WIN
  82. # define ITTAPI_CDECL __cdecl
  83. # else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  84. # if defined _M_IX86 || defined __i386__
  85. # define ITTAPI_CDECL __attribute__ ((cdecl))
  86. # else /* _M_IX86 || __i386__ */
  87. # define ITTAPI_CDECL /* actual only on x86 platform */
  88. # endif /* _M_IX86 || __i386__ */
  89. # endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  90. #endif /* ITTAPI_CDECL */
  91. #ifndef STDCALL
  92. # if ITT_PLATFORM==ITT_PLATFORM_WIN
  93. # define STDCALL __stdcall
  94. # else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  95. # if defined _M_IX86 || defined __i386__
  96. # define STDCALL __attribute__ ((stdcall))
  97. # else /* _M_IX86 || __i386__ */
  98. # define STDCALL /* supported only on x86 platform */
  99. # endif /* _M_IX86 || __i386__ */
  100. # endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  101. #endif /* STDCALL */
  102. #define ITTAPI ITTAPI_CDECL
  103. #define LIBITTAPI ITTAPI_CDECL
  104. /* TODO: Temporary for compatibility! */
  105. #define ITTAPI_CALL ITTAPI_CDECL
  106. #define LIBITTAPI_CALL ITTAPI_CDECL
  107. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  108. /* use __forceinline (VC++ specific) */
  109. #if defined(__MINGW32__) && !defined(__cplusplus)
  110. #define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
  111. #else
  112. #define ITT_INLINE static __forceinline
  113. #endif /* __MINGW32__ */
  114. #define ITT_INLINE_ATTRIBUTE /* nothing */
  115. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  116. /*
  117. * Generally, functions are not inlined unless optimization is specified.
  118. * For functions declared inline, this attribute inlines the function even
  119. * if no optimization level was specified.
  120. */
  121. #ifdef __STRICT_ANSI__
  122. #define ITT_INLINE static
  123. #define ITT_INLINE_ATTRIBUTE __attribute__((unused))
  124. #else /* __STRICT_ANSI__ */
  125. #define ITT_INLINE static inline
  126. #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
  127. #endif /* __STRICT_ANSI__ */
  128. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  129. /** @endcond */
  130. /** @cond exclude_from_documentation */
  131. /* Helper macro for joining tokens */
  132. #define ITT_JOIN_AUX(p,n) p##n
  133. #define ITT_JOIN(p,n) ITT_JOIN_AUX(p,n)
  134. #ifdef ITT_MAJOR
  135. #undef ITT_MAJOR
  136. #endif
  137. #ifdef ITT_MINOR
  138. #undef ITT_MINOR
  139. #endif
  140. #define ITT_MAJOR 3
  141. #define ITT_MINOR 0
  142. /* Standard versioning of a token with major and minor version numbers */
  143. #define ITT_VERSIONIZE(x) \
  144. ITT_JOIN(x, \
  145. ITT_JOIN(_, \
  146. ITT_JOIN(ITT_MAJOR, \
  147. ITT_JOIN(_, ITT_MINOR))))
  148. #ifndef INTEL_ITTNOTIFY_PREFIX
  149. # define INTEL_ITTNOTIFY_PREFIX __itt_
  150. #endif /* INTEL_ITTNOTIFY_PREFIX */
  151. #ifndef INTEL_ITTNOTIFY_POSTFIX
  152. # define INTEL_ITTNOTIFY_POSTFIX _ptr_
  153. #endif /* INTEL_ITTNOTIFY_POSTFIX */
  154. #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  155. #define ITTNOTIFY_NAME(n) ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  156. #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
  157. #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
  158. #define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
  159. #define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
  160. #define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
  161. #define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
  162. #define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
  163. #define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
  164. #define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
  165. #define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
  166. #define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
  167. #define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
  168. #define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
  169. #define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
  170. #define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
  171. #define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
  172. #ifdef ITT_STUB
  173. #undef ITT_STUB
  174. #endif
  175. #ifdef ITT_STUBV
  176. #undef ITT_STUBV
  177. #endif
  178. #define ITT_STUBV(api,type,name,args) \
  179. typedef type (api* ITT_JOIN(ITTNOTIFY_NAME(name),_t)) args; \
  180. extern ITT_JOIN(ITTNOTIFY_NAME(name),_t) ITTNOTIFY_NAME(name);
  181. #define ITT_STUB ITT_STUBV
  182. /** @endcond */
  183. #ifdef __cplusplus
  184. extern "C" {
  185. #endif /* __cplusplus */
  186. /**
  187. * @defgroup legacy Legacy API
  188. * @{
  189. * @}
  190. */
  191. /**
  192. * @defgroup legacy_control Collection Control
  193. * @ingroup legacy
  194. * General behavior: application continues to run, but no profiling information is being collected
  195. *
  196. * Pausing occurs not only for the current thread but for all process as well as spawned processes
  197. * - Intel(R) Parallel Inspector and Intel(R) Inspector XE:
  198. * - Does not analyze or report errors that involve memory access.
  199. * - Other errors are reported as usual. Pausing data collection in
  200. * Intel(R) Parallel Inspector and Intel(R) Inspector XE
  201. * only pauses tracing and analyzing memory access.
  202. * It does not pause tracing or analyzing threading APIs.
  203. * .
  204. * - Intel(R) VTune(TM) Profiler:
  205. * - Does continue to record when new threads are started.
  206. * .
  207. * - Other effects:
  208. * - Possible reduction of runtime overhead.
  209. * .
  210. * @{
  211. */
  212. #ifndef _ITTNOTIFY_H_
  213. /** @brief Pause collection */
  214. void ITTAPI __itt_pause(void);
  215. /** @brief Resume collection */
  216. void ITTAPI __itt_resume(void);
  217. /** @brief Detach collection */
  218. void ITTAPI __itt_detach(void);
  219. /** @cond exclude_from_documentation */
  220. #ifndef INTEL_NO_MACRO_BODY
  221. #ifndef INTEL_NO_ITTNOTIFY_API
  222. ITT_STUBV(ITTAPI, void, pause, (void))
  223. ITT_STUBV(ITTAPI, void, resume, (void))
  224. ITT_STUBV(ITTAPI, void, detach, (void))
  225. #define __itt_pause ITTNOTIFY_VOID(pause)
  226. #define __itt_pause_ptr ITTNOTIFY_NAME(pause)
  227. #define __itt_resume ITTNOTIFY_VOID(resume)
  228. #define __itt_resume_ptr ITTNOTIFY_NAME(resume)
  229. #define __itt_detach ITTNOTIFY_VOID(detach)
  230. #define __itt_detach_ptr ITTNOTIFY_NAME(detach)
  231. #else /* INTEL_NO_ITTNOTIFY_API */
  232. #define __itt_pause()
  233. #define __itt_pause_ptr 0
  234. #define __itt_resume()
  235. #define __itt_resume_ptr 0
  236. #define __itt_detach()
  237. #define __itt_detach_ptr 0
  238. #endif /* INTEL_NO_ITTNOTIFY_API */
  239. #else /* INTEL_NO_MACRO_BODY */
  240. #define __itt_pause_ptr 0
  241. #define __itt_resume_ptr 0
  242. #define __itt_detach_ptr 0
  243. #endif /* INTEL_NO_MACRO_BODY */
  244. /** @endcond */
  245. #endif /* _ITTNOTIFY_H_ */
  246. /** @} legacy_control group */
  247. /**
  248. * @defgroup legacy_threads Threads
  249. * @ingroup legacy
  250. * Threads group
  251. * @warning Legacy API
  252. * @{
  253. */
  254. /**
  255. * @deprecated Legacy API
  256. * @brief Set name to be associated with thread in analysis GUI.
  257. * @return __itt_err upon failure (name or namelen being null,name and namelen mismatched)
  258. */
  259. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  260. int LIBITTAPI __itt_thr_name_setA(const char *name, int namelen);
  261. int LIBITTAPI __itt_thr_name_setW(const wchar_t *name, int namelen);
  262. #if defined(UNICODE) || defined(_UNICODE)
  263. # define __itt_thr_name_set __itt_thr_name_setW
  264. # define __itt_thr_name_set_ptr __itt_thr_name_setW_ptr
  265. #else
  266. # define __itt_thr_name_set __itt_thr_name_setA
  267. # define __itt_thr_name_set_ptr __itt_thr_name_setA_ptr
  268. #endif /* UNICODE */
  269. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  270. int LIBITTAPI __itt_thr_name_set(const char *name, int namelen);
  271. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  272. /** @cond exclude_from_documentation */
  273. #ifndef INTEL_NO_MACRO_BODY
  274. #ifndef INTEL_NO_ITTNOTIFY_API
  275. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  276. ITT_STUB(LIBITTAPI, int, thr_name_setA, (const char *name, int namelen))
  277. ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen))
  278. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  279. ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen))
  280. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  281. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  282. #define __itt_thr_name_setA ITTNOTIFY_DATA(thr_name_setA)
  283. #define __itt_thr_name_setA_ptr ITTNOTIFY_NAME(thr_name_setA)
  284. #define __itt_thr_name_setW ITTNOTIFY_DATA(thr_name_setW)
  285. #define __itt_thr_name_setW_ptr ITTNOTIFY_NAME(thr_name_setW)
  286. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  287. #define __itt_thr_name_set ITTNOTIFY_DATA(thr_name_set)
  288. #define __itt_thr_name_set_ptr ITTNOTIFY_NAME(thr_name_set)
  289. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  290. #else /* INTEL_NO_ITTNOTIFY_API */
  291. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  292. #define __itt_thr_name_setA(name, namelen)
  293. #define __itt_thr_name_setA_ptr 0
  294. #define __itt_thr_name_setW(name, namelen)
  295. #define __itt_thr_name_setW_ptr 0
  296. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  297. #define __itt_thr_name_set(name, namelen)
  298. #define __itt_thr_name_set_ptr 0
  299. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  300. #endif /* INTEL_NO_ITTNOTIFY_API */
  301. #else /* INTEL_NO_MACRO_BODY */
  302. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  303. #define __itt_thr_name_setA_ptr 0
  304. #define __itt_thr_name_setW_ptr 0
  305. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  306. #define __itt_thr_name_set_ptr 0
  307. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  308. #endif /* INTEL_NO_MACRO_BODY */
  309. /** @endcond */
  310. /**
  311. * @deprecated Legacy API
  312. * @brief Mark current thread as ignored from this point on, for the duration of its existence.
  313. */
  314. void LIBITTAPI __itt_thr_ignore(void);
  315. /** @cond exclude_from_documentation */
  316. #ifndef INTEL_NO_MACRO_BODY
  317. #ifndef INTEL_NO_ITTNOTIFY_API
  318. ITT_STUBV(LIBITTAPI, void, thr_ignore, (void))
  319. #define __itt_thr_ignore ITTNOTIFY_VOID(thr_ignore)
  320. #define __itt_thr_ignore_ptr ITTNOTIFY_NAME(thr_ignore)
  321. #else /* INTEL_NO_ITTNOTIFY_API */
  322. #define __itt_thr_ignore()
  323. #define __itt_thr_ignore_ptr 0
  324. #endif /* INTEL_NO_ITTNOTIFY_API */
  325. #else /* INTEL_NO_MACRO_BODY */
  326. #define __itt_thr_ignore_ptr 0
  327. #endif /* INTEL_NO_MACRO_BODY */
  328. /** @endcond */
  329. /** @} legacy_threads group */
  330. /**
  331. * @defgroup legacy_sync Synchronization
  332. * @ingroup legacy
  333. * Synchronization group
  334. * @warning Legacy API
  335. * @{
  336. */
  337. /**
  338. * @hideinitializer
  339. * @brief possible value of attribute argument for sync object type
  340. */
  341. #define __itt_attr_barrier 1
  342. /**
  343. * @hideinitializer
  344. * @brief possible value of attribute argument for sync object type
  345. */
  346. #define __itt_attr_mutex 2
  347. /**
  348. * @deprecated Legacy API
  349. * @brief Assign a name to a sync object using char or Unicode string
  350. * @param[in] addr - pointer to the sync object. You should use a real pointer to your object
  351. * to make sure that the values don't clash with other object addresses
  352. * @param[in] objtype - null-terminated object type string. If NULL is passed, the object will
  353. * be assumed to be of generic "User Synchronization" type
  354. * @param[in] objname - null-terminated object name string. If NULL, no name will be assigned
  355. * to the object -- you can use the __itt_sync_rename call later to assign
  356. * the name
  357. * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values which defines the
  358. * exact semantics of how prepare/acquired/releasing calls work.
  359. */
  360. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  361. void ITTAPI __itt_sync_set_nameA(void *addr, const char *objtype, const char *objname, int attribute);
  362. void ITTAPI __itt_sync_set_nameW(void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute);
  363. #if defined(UNICODE) || defined(_UNICODE)
  364. # define __itt_sync_set_name __itt_sync_set_nameW
  365. # define __itt_sync_set_name_ptr __itt_sync_set_nameW_ptr
  366. #else /* UNICODE */
  367. # define __itt_sync_set_name __itt_sync_set_nameA
  368. # define __itt_sync_set_name_ptr __itt_sync_set_nameA_ptr
  369. #endif /* UNICODE */
  370. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  371. void ITTAPI __itt_sync_set_name(void *addr, const char* objtype, const char* objname, int attribute);
  372. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  373. /** @cond exclude_from_documentation */
  374. #ifndef INTEL_NO_MACRO_BODY
  375. #ifndef INTEL_NO_ITTNOTIFY_API
  376. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  377. ITT_STUBV(ITTAPI, void, sync_set_nameA, (void *addr, const char *objtype, const char *objname, int attribute))
  378. ITT_STUBV(ITTAPI, void, sync_set_nameW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute))
  379. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  380. ITT_STUBV(ITTAPI, void, sync_set_name, (void *addr, const char *objtype, const char *objname, int attribute))
  381. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  382. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  383. #define __itt_sync_set_nameA ITTNOTIFY_VOID(sync_set_nameA)
  384. #define __itt_sync_set_nameA_ptr ITTNOTIFY_NAME(sync_set_nameA)
  385. #define __itt_sync_set_nameW ITTNOTIFY_VOID(sync_set_nameW)
  386. #define __itt_sync_set_nameW_ptr ITTNOTIFY_NAME(sync_set_nameW)
  387. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  388. #define __itt_sync_set_name ITTNOTIFY_VOID(sync_set_name)
  389. #define __itt_sync_set_name_ptr ITTNOTIFY_NAME(sync_set_name)
  390. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  391. #else /* INTEL_NO_ITTNOTIFY_API */
  392. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  393. #define __itt_sync_set_nameA(addr, objtype, objname, attribute)
  394. #define __itt_sync_set_nameA_ptr 0
  395. #define __itt_sync_set_nameW(addr, objtype, objname, attribute)
  396. #define __itt_sync_set_nameW_ptr 0
  397. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  398. #define __itt_sync_set_name(addr, objtype, objname, attribute)
  399. #define __itt_sync_set_name_ptr 0
  400. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  401. #endif /* INTEL_NO_ITTNOTIFY_API */
  402. #else /* INTEL_NO_MACRO_BODY */
  403. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  404. #define __itt_sync_set_nameA_ptr 0
  405. #define __itt_sync_set_nameW_ptr 0
  406. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  407. #define __itt_sync_set_name_ptr 0
  408. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  409. #endif /* INTEL_NO_MACRO_BODY */
  410. /** @endcond */
  411. /**
  412. * @deprecated Legacy API
  413. * @brief Assign a name and type to a sync object using char or Unicode string
  414. * @param[in] addr - pointer to the sync object. You should use a real pointer to your object
  415. * to make sure that the values don't clash with other object addresses
  416. * @param[in] objtype - null-terminated object type string. If NULL is passed, the object will
  417. * be assumed to be of generic "User Synchronization" type
  418. * @param[in] objname - null-terminated object name string. If NULL, no name will be assigned
  419. * to the object -- you can use the __itt_sync_rename call later to assign
  420. * the name
  421. * @param[in] typelen, namelen - a length of string for appropriate objtype and objname parameter
  422. * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values which defines the
  423. * exact semantics of how prepare/acquired/releasing calls work.
  424. * @return __itt_err upon failure (name or namelen being null,name and namelen mismatched)
  425. */
  426. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  427. int LIBITTAPI __itt_notify_sync_nameA(void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute);
  428. int LIBITTAPI __itt_notify_sync_nameW(void *addr, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute);
  429. #if defined(UNICODE) || defined(_UNICODE)
  430. # define __itt_notify_sync_name __itt_notify_sync_nameW
  431. #else
  432. # define __itt_notify_sync_name __itt_notify_sync_nameA
  433. #endif
  434. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  435. int LIBITTAPI __itt_notify_sync_name(void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute);
  436. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  437. /** @cond exclude_from_documentation */
  438. #ifndef INTEL_NO_MACRO_BODY
  439. #ifndef INTEL_NO_ITTNOTIFY_API
  440. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  441. ITT_STUB(LIBITTAPI, int, notify_sync_nameA, (void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute))
  442. ITT_STUB(LIBITTAPI, int, notify_sync_nameW, (void *addr, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute))
  443. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  444. ITT_STUB(LIBITTAPI, int, notify_sync_name, (void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute))
  445. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  446. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  447. #define __itt_notify_sync_nameA ITTNOTIFY_DATA(notify_sync_nameA)
  448. #define __itt_notify_sync_nameA_ptr ITTNOTIFY_NAME(notify_sync_nameA)
  449. #define __itt_notify_sync_nameW ITTNOTIFY_DATA(notify_sync_nameW)
  450. #define __itt_notify_sync_nameW_ptr ITTNOTIFY_NAME(notify_sync_nameW)
  451. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  452. #define __itt_notify_sync_name ITTNOTIFY_DATA(notify_sync_name)
  453. #define __itt_notify_sync_name_ptr ITTNOTIFY_NAME(notify_sync_name)
  454. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  455. #else /* INTEL_NO_ITTNOTIFY_API */
  456. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  457. #define __itt_notify_sync_nameA(addr, objtype, typelen, objname, namelen, attribute)
  458. #define __itt_notify_sync_nameA_ptr 0
  459. #define __itt_notify_sync_nameW(addr, objtype, typelen, objname, namelen, attribute)
  460. #define __itt_notify_sync_nameW_ptr 0
  461. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  462. #define __itt_notify_sync_name(addr, objtype, typelen, objname, namelen, attribute)
  463. #define __itt_notify_sync_name_ptr 0
  464. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  465. #endif /* INTEL_NO_ITTNOTIFY_API */
  466. #else /* INTEL_NO_MACRO_BODY */
  467. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  468. #define __itt_notify_sync_nameA_ptr 0
  469. #define __itt_notify_sync_nameW_ptr 0
  470. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  471. #define __itt_notify_sync_name_ptr 0
  472. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  473. #endif /* INTEL_NO_MACRO_BODY */
  474. /** @endcond */
  475. /**
  476. * @deprecated Legacy API
  477. * @brief Enter spin loop on user-defined sync object
  478. */
  479. void LIBITTAPI __itt_notify_sync_prepare(void* addr);
  480. /** @cond exclude_from_documentation */
  481. #ifndef INTEL_NO_MACRO_BODY
  482. #ifndef INTEL_NO_ITTNOTIFY_API
  483. ITT_STUBV(LIBITTAPI, void, notify_sync_prepare, (void *addr))
  484. #define __itt_notify_sync_prepare ITTNOTIFY_VOID(notify_sync_prepare)
  485. #define __itt_notify_sync_prepare_ptr ITTNOTIFY_NAME(notify_sync_prepare)
  486. #else /* INTEL_NO_ITTNOTIFY_API */
  487. #define __itt_notify_sync_prepare(addr)
  488. #define __itt_notify_sync_prepare_ptr 0
  489. #endif /* INTEL_NO_ITTNOTIFY_API */
  490. #else /* INTEL_NO_MACRO_BODY */
  491. #define __itt_notify_sync_prepare_ptr 0
  492. #endif /* INTEL_NO_MACRO_BODY */
  493. /** @endcond */
  494. /**
  495. * @deprecated Legacy API
  496. * @brief Quit spin loop without acquiring spin object
  497. */
  498. void LIBITTAPI __itt_notify_sync_cancel(void *addr);
  499. /** @cond exclude_from_documentation */
  500. #ifndef INTEL_NO_MACRO_BODY
  501. #ifndef INTEL_NO_ITTNOTIFY_API
  502. ITT_STUBV(LIBITTAPI, void, notify_sync_cancel, (void *addr))
  503. #define __itt_notify_sync_cancel ITTNOTIFY_VOID(notify_sync_cancel)
  504. #define __itt_notify_sync_cancel_ptr ITTNOTIFY_NAME(notify_sync_cancel)
  505. #else /* INTEL_NO_ITTNOTIFY_API */
  506. #define __itt_notify_sync_cancel(addr)
  507. #define __itt_notify_sync_cancel_ptr 0
  508. #endif /* INTEL_NO_ITTNOTIFY_API */
  509. #else /* INTEL_NO_MACRO_BODY */
  510. #define __itt_notify_sync_cancel_ptr 0
  511. #endif /* INTEL_NO_MACRO_BODY */
  512. /** @endcond */
  513. /**
  514. * @deprecated Legacy API
  515. * @brief Successful spin loop completion (sync object acquired)
  516. */
  517. void LIBITTAPI __itt_notify_sync_acquired(void *addr);
  518. /** @cond exclude_from_documentation */
  519. #ifndef INTEL_NO_MACRO_BODY
  520. #ifndef INTEL_NO_ITTNOTIFY_API
  521. ITT_STUBV(LIBITTAPI, void, notify_sync_acquired, (void *addr))
  522. #define __itt_notify_sync_acquired ITTNOTIFY_VOID(notify_sync_acquired)
  523. #define __itt_notify_sync_acquired_ptr ITTNOTIFY_NAME(notify_sync_acquired)
  524. #else /* INTEL_NO_ITTNOTIFY_API */
  525. #define __itt_notify_sync_acquired(addr)
  526. #define __itt_notify_sync_acquired_ptr 0
  527. #endif /* INTEL_NO_ITTNOTIFY_API */
  528. #else /* INTEL_NO_MACRO_BODY */
  529. #define __itt_notify_sync_acquired_ptr 0
  530. #endif /* INTEL_NO_MACRO_BODY */
  531. /** @endcond */
  532. /**
  533. * @deprecated Legacy API
  534. * @brief Start sync object releasing code. Is called before the lock release call.
  535. */
  536. void LIBITTAPI __itt_notify_sync_releasing(void* addr);
  537. /** @cond exclude_from_documentation */
  538. #ifndef INTEL_NO_MACRO_BODY
  539. #ifndef INTEL_NO_ITTNOTIFY_API
  540. ITT_STUBV(LIBITTAPI, void, notify_sync_releasing, (void *addr))
  541. #define __itt_notify_sync_releasing ITTNOTIFY_VOID(notify_sync_releasing)
  542. #define __itt_notify_sync_releasing_ptr ITTNOTIFY_NAME(notify_sync_releasing)
  543. #else /* INTEL_NO_ITTNOTIFY_API */
  544. #define __itt_notify_sync_releasing(addr)
  545. #define __itt_notify_sync_releasing_ptr 0
  546. #endif /* INTEL_NO_ITTNOTIFY_API */
  547. #else /* INTEL_NO_MACRO_BODY */
  548. #define __itt_notify_sync_releasing_ptr 0
  549. #endif /* INTEL_NO_MACRO_BODY */
  550. /** @endcond */
  551. /** @} legacy_sync group */
  552. #ifndef _ITTNOTIFY_H_
  553. /**
  554. * @defgroup legacy_events Events
  555. * @ingroup legacy
  556. * Events group
  557. * @{
  558. */
  559. /** @brief user event type */
  560. typedef int __itt_event;
  561. /**
  562. * @brief Create an event notification
  563. * @note name or namelen being null/name and namelen not matching, user event feature not enabled
  564. * @return non-zero event identifier upon success and __itt_err otherwise
  565. */
  566. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  567. __itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen);
  568. __itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen);
  569. #if defined(UNICODE) || defined(_UNICODE)
  570. # define __itt_event_create __itt_event_createW
  571. # define __itt_event_create_ptr __itt_event_createW_ptr
  572. #else
  573. # define __itt_event_create __itt_event_createA
  574. # define __itt_event_create_ptr __itt_event_createA_ptr
  575. #endif /* UNICODE */
  576. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  577. __itt_event LIBITTAPI __itt_event_create(const char *name, int namelen);
  578. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  579. /** @cond exclude_from_documentation */
  580. #ifndef INTEL_NO_MACRO_BODY
  581. #ifndef INTEL_NO_ITTNOTIFY_API
  582. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  583. ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen))
  584. ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen))
  585. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  586. ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen))
  587. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  588. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  589. #define __itt_event_createA ITTNOTIFY_DATA(event_createA)
  590. #define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA)
  591. #define __itt_event_createW ITTNOTIFY_DATA(event_createW)
  592. #define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW)
  593. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  594. #define __itt_event_create ITTNOTIFY_DATA(event_create)
  595. #define __itt_event_create_ptr ITTNOTIFY_NAME(event_create)
  596. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  597. #else /* INTEL_NO_ITTNOTIFY_API */
  598. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  599. #define __itt_event_createA(name, namelen) (__itt_event)0
  600. #define __itt_event_createA_ptr 0
  601. #define __itt_event_createW(name, namelen) (__itt_event)0
  602. #define __itt_event_createW_ptr 0
  603. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  604. #define __itt_event_create(name, namelen) (__itt_event)0
  605. #define __itt_event_create_ptr 0
  606. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  607. #endif /* INTEL_NO_ITTNOTIFY_API */
  608. #else /* INTEL_NO_MACRO_BODY */
  609. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  610. #define __itt_event_createA_ptr 0
  611. #define __itt_event_createW_ptr 0
  612. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  613. #define __itt_event_create_ptr 0
  614. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  615. #endif /* INTEL_NO_MACRO_BODY */
  616. /** @endcond */
  617. /**
  618. * @brief Record an event occurrence.
  619. * @return __itt_err upon failure (invalid event id/user event feature not enabled)
  620. */
  621. int LIBITTAPI __itt_event_start(__itt_event event);
  622. /** @cond exclude_from_documentation */
  623. #ifndef INTEL_NO_MACRO_BODY
  624. #ifndef INTEL_NO_ITTNOTIFY_API
  625. ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event))
  626. #define __itt_event_start ITTNOTIFY_DATA(event_start)
  627. #define __itt_event_start_ptr ITTNOTIFY_NAME(event_start)
  628. #else /* INTEL_NO_ITTNOTIFY_API */
  629. #define __itt_event_start(event) (int)0
  630. #define __itt_event_start_ptr 0
  631. #endif /* INTEL_NO_ITTNOTIFY_API */
  632. #else /* INTEL_NO_MACRO_BODY */
  633. #define __itt_event_start_ptr 0
  634. #endif /* INTEL_NO_MACRO_BODY */
  635. /** @endcond */
  636. /**
  637. * @brief Record an event end occurrence.
  638. * @note It is optional if events do not have durations.
  639. * @return __itt_err upon failure (invalid event id/user event feature not enabled)
  640. */
  641. int LIBITTAPI __itt_event_end(__itt_event event);
  642. /** @cond exclude_from_documentation */
  643. #ifndef INTEL_NO_MACRO_BODY
  644. #ifndef INTEL_NO_ITTNOTIFY_API
  645. ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event))
  646. #define __itt_event_end ITTNOTIFY_DATA(event_end)
  647. #define __itt_event_end_ptr ITTNOTIFY_NAME(event_end)
  648. #else /* INTEL_NO_ITTNOTIFY_API */
  649. #define __itt_event_end(event) (int)0
  650. #define __itt_event_end_ptr 0
  651. #endif /* INTEL_NO_ITTNOTIFY_API */
  652. #else /* INTEL_NO_MACRO_BODY */
  653. #define __itt_event_end_ptr 0
  654. #endif /* INTEL_NO_MACRO_BODY */
  655. /** @endcond */
  656. /** @} legacy_events group */
  657. #endif /* _ITTNOTIFY_H_ */
  658. /**
  659. * @defgroup legacy_memory Memory Accesses
  660. * @ingroup legacy
  661. */
  662. /**
  663. * @deprecated Legacy API
  664. * @brief Inform the tool of memory accesses on reading
  665. */
  666. void LIBITTAPI __itt_memory_read(void *addr, size_t size);
  667. /** @cond exclude_from_documentation */
  668. #ifndef INTEL_NO_MACRO_BODY
  669. #ifndef INTEL_NO_ITTNOTIFY_API
  670. ITT_STUBV(LIBITTAPI, void, memory_read, (void *addr, size_t size))
  671. #define __itt_memory_read ITTNOTIFY_VOID(memory_read)
  672. #define __itt_memory_read_ptr ITTNOTIFY_NAME(memory_read)
  673. #else /* INTEL_NO_ITTNOTIFY_API */
  674. #define __itt_memory_read(addr, size)
  675. #define __itt_memory_read_ptr 0
  676. #endif /* INTEL_NO_ITTNOTIFY_API */
  677. #else /* INTEL_NO_MACRO_BODY */
  678. #define __itt_memory_read_ptr 0
  679. #endif /* INTEL_NO_MACRO_BODY */
  680. /** @endcond */
  681. /**
  682. * @deprecated Legacy API
  683. * @brief Inform the tool of memory accesses on writing
  684. */
  685. void LIBITTAPI __itt_memory_write(void *addr, size_t size);
  686. /** @cond exclude_from_documentation */
  687. #ifndef INTEL_NO_MACRO_BODY
  688. #ifndef INTEL_NO_ITTNOTIFY_API
  689. ITT_STUBV(LIBITTAPI, void, memory_write, (void *addr, size_t size))
  690. #define __itt_memory_write ITTNOTIFY_VOID(memory_write)
  691. #define __itt_memory_write_ptr ITTNOTIFY_NAME(memory_write)
  692. #else /* INTEL_NO_ITTNOTIFY_API */
  693. #define __itt_memory_write(addr, size)
  694. #define __itt_memory_write_ptr 0
  695. #endif /* INTEL_NO_ITTNOTIFY_API */
  696. #else /* INTEL_NO_MACRO_BODY */
  697. #define __itt_memory_write_ptr 0
  698. #endif /* INTEL_NO_MACRO_BODY */
  699. /** @endcond */
  700. /**
  701. * @deprecated Legacy API
  702. * @brief Inform the tool of memory accesses on updating
  703. */
  704. void LIBITTAPI __itt_memory_update(void *address, size_t size);
  705. /** @cond exclude_from_documentation */
  706. #ifndef INTEL_NO_MACRO_BODY
  707. #ifndef INTEL_NO_ITTNOTIFY_API
  708. ITT_STUBV(LIBITTAPI, void, memory_update, (void *addr, size_t size))
  709. #define __itt_memory_update ITTNOTIFY_VOID(memory_update)
  710. #define __itt_memory_update_ptr ITTNOTIFY_NAME(memory_update)
  711. #else /* INTEL_NO_ITTNOTIFY_API */
  712. #define __itt_memory_update(addr, size)
  713. #define __itt_memory_update_ptr 0
  714. #endif /* INTEL_NO_ITTNOTIFY_API */
  715. #else /* INTEL_NO_MACRO_BODY */
  716. #define __itt_memory_update_ptr 0
  717. #endif /* INTEL_NO_MACRO_BODY */
  718. /** @endcond */
  719. /** @} legacy_memory group */
  720. /**
  721. * @defgroup legacy_state Thread and Object States
  722. * @ingroup legacy
  723. */
  724. /** @brief state type */
  725. typedef int __itt_state_t;
  726. /** @cond exclude_from_documentation */
  727. typedef enum __itt_obj_state {
  728. __itt_obj_state_err = 0,
  729. __itt_obj_state_clr = 1,
  730. __itt_obj_state_set = 2,
  731. __itt_obj_state_use = 3
  732. } __itt_obj_state_t;
  733. typedef enum __itt_thr_state {
  734. __itt_thr_state_err = 0,
  735. __itt_thr_state_clr = 1,
  736. __itt_thr_state_set = 2
  737. } __itt_thr_state_t;
  738. typedef enum __itt_obj_prop {
  739. __itt_obj_prop_watch = 1,
  740. __itt_obj_prop_ignore = 2,
  741. __itt_obj_prop_sharable = 3
  742. } __itt_obj_prop_t;
  743. typedef enum __itt_thr_prop {
  744. __itt_thr_prop_quiet = 1
  745. } __itt_thr_prop_t;
  746. /** @endcond */
  747. /**
  748. * @deprecated Legacy API
  749. * @brief managing thread and object states
  750. */
  751. __itt_state_t LIBITTAPI __itt_state_get(void);
  752. /** @cond exclude_from_documentation */
  753. #ifndef INTEL_NO_MACRO_BODY
  754. #ifndef INTEL_NO_ITTNOTIFY_API
  755. ITT_STUB(ITTAPI, __itt_state_t, state_get, (void))
  756. #define __itt_state_get ITTNOTIFY_DATA(state_get)
  757. #define __itt_state_get_ptr ITTNOTIFY_NAME(state_get)
  758. #else /* INTEL_NO_ITTNOTIFY_API */
  759. #define __itt_state_get(void) (__itt_state_t)0
  760. #define __itt_state_get_ptr 0
  761. #endif /* INTEL_NO_ITTNOTIFY_API */
  762. #else /* INTEL_NO_MACRO_BODY */
  763. #define __itt_state_get_ptr 0
  764. #endif /* INTEL_NO_MACRO_BODY */
  765. /** @endcond */
  766. /**
  767. * @deprecated Legacy API
  768. * @brief managing thread and object states
  769. */
  770. __itt_state_t LIBITTAPI __itt_state_set(__itt_state_t s);
  771. /** @cond exclude_from_documentation */
  772. #ifndef INTEL_NO_MACRO_BODY
  773. #ifndef INTEL_NO_ITTNOTIFY_API
  774. ITT_STUB(ITTAPI, __itt_state_t, state_set, (__itt_state_t s))
  775. #define __itt_state_set ITTNOTIFY_DATA(state_set)
  776. #define __itt_state_set_ptr ITTNOTIFY_NAME(state_set)
  777. #else /* INTEL_NO_ITTNOTIFY_API */
  778. #define __itt_state_set(s) (__itt_state_t)0
  779. #define __itt_state_set_ptr 0
  780. #endif /* INTEL_NO_ITTNOTIFY_API */
  781. #else /* INTEL_NO_MACRO_BODY */
  782. #define __itt_state_set_ptr 0
  783. #endif /* INTEL_NO_MACRO_BODY */
  784. /** @endcond */
  785. /**
  786. * @deprecated Legacy API
  787. * @brief managing thread and object modes
  788. */
  789. __itt_thr_state_t LIBITTAPI __itt_thr_mode_set(__itt_thr_prop_t p, __itt_thr_state_t s);
  790. /** @cond exclude_from_documentation */
  791. #ifndef INTEL_NO_MACRO_BODY
  792. #ifndef INTEL_NO_ITTNOTIFY_API
  793. ITT_STUB(ITTAPI, __itt_thr_state_t, thr_mode_set, (__itt_thr_prop_t p, __itt_thr_state_t s))
  794. #define __itt_thr_mode_set ITTNOTIFY_DATA(thr_mode_set)
  795. #define __itt_thr_mode_set_ptr ITTNOTIFY_NAME(thr_mode_set)
  796. #else /* INTEL_NO_ITTNOTIFY_API */
  797. #define __itt_thr_mode_set(p, s) (__itt_thr_state_t)0
  798. #define __itt_thr_mode_set_ptr 0
  799. #endif /* INTEL_NO_ITTNOTIFY_API */
  800. #else /* INTEL_NO_MACRO_BODY */
  801. #define __itt_thr_mode_set_ptr 0
  802. #endif /* INTEL_NO_MACRO_BODY */
  803. /** @endcond */
  804. /**
  805. * @deprecated Legacy API
  806. * @brief managing thread and object modes
  807. */
  808. __itt_obj_state_t LIBITTAPI __itt_obj_mode_set(__itt_obj_prop_t p, __itt_obj_state_t s);
  809. /** @cond exclude_from_documentation */
  810. #ifndef INTEL_NO_MACRO_BODY
  811. #ifndef INTEL_NO_ITTNOTIFY_API
  812. ITT_STUB(ITTAPI, __itt_obj_state_t, obj_mode_set, (__itt_obj_prop_t p, __itt_obj_state_t s))
  813. #define __itt_obj_mode_set ITTNOTIFY_DATA(obj_mode_set)
  814. #define __itt_obj_mode_set_ptr ITTNOTIFY_NAME(obj_mode_set)
  815. #else /* INTEL_NO_ITTNOTIFY_API */
  816. #define __itt_obj_mode_set(p, s) (__itt_obj_state_t)0
  817. #define __itt_obj_mode_set_ptr 0
  818. #endif /* INTEL_NO_ITTNOTIFY_API */
  819. #else /* INTEL_NO_MACRO_BODY */
  820. #define __itt_obj_mode_set_ptr 0
  821. #endif /* INTEL_NO_MACRO_BODY */
  822. /** @endcond */
  823. /** @} legacy_state group */
  824. /**
  825. * @defgroup frames Frames
  826. * @ingroup legacy
  827. * Frames group
  828. * @{
  829. */
  830. /**
  831. * @brief opaque structure for frame identification
  832. */
  833. typedef struct __itt_frame_t *__itt_frame;
  834. /**
  835. * @brief Create a global frame with given domain
  836. */
  837. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  838. __itt_frame ITTAPI __itt_frame_createA(const char *domain);
  839. __itt_frame ITTAPI __itt_frame_createW(const wchar_t *domain);
  840. #if defined(UNICODE) || defined(_UNICODE)
  841. # define __itt_frame_create __itt_frame_createW
  842. # define __itt_frame_create_ptr __itt_frame_createW_ptr
  843. #else /* UNICODE */
  844. # define __itt_frame_create __itt_frame_createA
  845. # define __itt_frame_create_ptr __itt_frame_createA_ptr
  846. #endif /* UNICODE */
  847. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  848. __itt_frame ITTAPI __itt_frame_create(const char *domain);
  849. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  850. /** @cond exclude_from_documentation */
  851. #ifndef INTEL_NO_MACRO_BODY
  852. #ifndef INTEL_NO_ITTNOTIFY_API
  853. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  854. ITT_STUB(ITTAPI, __itt_frame, frame_createA, (const char *domain))
  855. ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain))
  856. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  857. ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain))
  858. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  859. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  860. #define __itt_frame_createA ITTNOTIFY_DATA(frame_createA)
  861. #define __itt_frame_createA_ptr ITTNOTIFY_NAME(frame_createA)
  862. #define __itt_frame_createW ITTNOTIFY_DATA(frame_createW)
  863. #define __itt_frame_createW_ptr ITTNOTIFY_NAME(frame_createW)
  864. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  865. #define __itt_frame_create ITTNOTIFY_DATA(frame_create)
  866. #define __itt_frame_create_ptr ITTNOTIFY_NAME(frame_create)
  867. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  868. #else /* INTEL_NO_ITTNOTIFY_API */
  869. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  870. #define __itt_frame_createA(domain)
  871. #define __itt_frame_createA_ptr 0
  872. #define __itt_frame_createW(domain)
  873. #define __itt_frame_createW_ptr 0
  874. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  875. #define __itt_frame_create(domain)
  876. #define __itt_frame_create_ptr 0
  877. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  878. #endif /* INTEL_NO_ITTNOTIFY_API */
  879. #else /* INTEL_NO_MACRO_BODY */
  880. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  881. #define __itt_frame_createA_ptr 0
  882. #define __itt_frame_createW_ptr 0
  883. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  884. #define __itt_frame_create_ptr 0
  885. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  886. #endif /* INTEL_NO_MACRO_BODY */
  887. /** @endcond */
  888. /** @brief Record a frame begin occurrence. */
  889. void ITTAPI __itt_frame_begin(__itt_frame frame);
  890. /** @brief Record a frame end occurrence. */
  891. void ITTAPI __itt_frame_end (__itt_frame frame);
  892. /** @cond exclude_from_documentation */
  893. #ifndef INTEL_NO_MACRO_BODY
  894. #ifndef INTEL_NO_ITTNOTIFY_API
  895. ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame))
  896. ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame))
  897. #define __itt_frame_begin ITTNOTIFY_VOID(frame_begin)
  898. #define __itt_frame_begin_ptr ITTNOTIFY_NAME(frame_begin)
  899. #define __itt_frame_end ITTNOTIFY_VOID(frame_end)
  900. #define __itt_frame_end_ptr ITTNOTIFY_NAME(frame_end)
  901. #else /* INTEL_NO_ITTNOTIFY_API */
  902. #define __itt_frame_begin(frame)
  903. #define __itt_frame_begin_ptr 0
  904. #define __itt_frame_end(frame)
  905. #define __itt_frame_end_ptr 0
  906. #endif /* INTEL_NO_ITTNOTIFY_API */
  907. #else /* INTEL_NO_MACRO_BODY */
  908. #define __itt_frame_begin_ptr 0
  909. #define __itt_frame_end_ptr 0
  910. #endif /* INTEL_NO_MACRO_BODY */
  911. /** @endcond */
  912. /** @} frames group */
  913. #ifdef __cplusplus
  914. }
  915. #endif /* __cplusplus */
  916. #endif /* _LEGACY_ITTNOTIFY_H_ */