ittnotify.h 39 KB

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