ittnotify.h 172 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123
  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 _ITTNOTIFY_H_
  48. #define _ITTNOTIFY_H_
  49. /**
  50. @file
  51. @brief Public User API functions and types
  52. @mainpage
  53. The ITT API is used to annotate a user's program with additional information
  54. that can be used by correctness and performance tools. The user inserts
  55. calls in their program. Those calls generate information that is collected
  56. at runtime, and used by Intel(R) Threading Tools.
  57. @section API Concepts
  58. The following general concepts are used throughout the API.
  59. @subsection Unicode Support
  60. Many API functions take character string arguments. On Windows, there
  61. are two versions of each such function. The function name is suffixed
  62. by W if Unicode support is enabled, and by A otherwise. Any API function
  63. that takes a character string argument adheres to this convention.
  64. @subsection Conditional Compilation
  65. Many users prefer having an option to modify ITT API code when linking it
  66. inside their runtimes. ITT API header file provides a mechanism to replace
  67. ITT API function names inside your code with empty strings. To do this,
  68. define the macros INTEL_NO_ITTNOTIFY_API during compilation and remove the
  69. static library from the linker script.
  70. @subsection Domains
  71. [see domains]
  72. Domains provide a way to separate notification for different modules or
  73. libraries in a program. Domains are specified by dotted character strings,
  74. e.g. TBB.Internal.Control.
  75. A mechanism (to be specified) is provided to enable and disable
  76. domains. By default, all domains are enabled.
  77. @subsection Named Entities and Instances
  78. Named entities (frames, regions, tasks, and markers) communicate
  79. information about the program to the analysis tools. A named entity often
  80. refers to a section of program code, or to some set of logical concepts
  81. that the programmer wants to group together.
  82. Named entities relate to the programmer's static view of the program. When
  83. the program actually executes, many instances of a given named entity
  84. may be created.
  85. The API annotations denote instances of named entities. The actual
  86. named entities are displayed using the analysis tools. In other words,
  87. the named entities come into existence when instances are created.
  88. Instances of named entities may have instance identifiers (IDs). Some
  89. API calls use instance identifiers to create relationships between
  90. different instances of named entities. Other API calls associate data
  91. with instances of named entities.
  92. Some named entities must always have instance IDs. In particular, regions
  93. and frames always have IDs. Task and markers need IDs only if the ID is
  94. needed in another API call (such as adding a relation or metadata).
  95. The lifetime of instance IDs is distinct from the lifetime of
  96. instances. This allows various relationships to be specified separate
  97. from the actual execution of instances. This flexibility comes at the
  98. expense of extra API calls.
  99. The same ID may not be reused for different instances, unless a previous
  100. [ref] __itt_id_destroy call for that ID has been issued.
  101. */
  102. /** @cond exclude_from_documentation */
  103. #ifndef ITT_OS_WIN
  104. # define ITT_OS_WIN 1
  105. #endif /* ITT_OS_WIN */
  106. #ifndef ITT_OS_LINUX
  107. # define ITT_OS_LINUX 2
  108. #endif /* ITT_OS_LINUX */
  109. #ifndef ITT_OS_MAC
  110. # define ITT_OS_MAC 3
  111. #endif /* ITT_OS_MAC */
  112. #ifndef ITT_OS_FREEBSD
  113. # define ITT_OS_FREEBSD 4
  114. #endif /* ITT_OS_FREEBSD */
  115. #ifndef ITT_OS
  116. # if defined WIN32 || defined _WIN32
  117. # define ITT_OS ITT_OS_WIN
  118. # elif defined( __APPLE__ ) && defined( __MACH__ )
  119. # define ITT_OS ITT_OS_MAC
  120. # elif defined( __FreeBSD__ )
  121. # define ITT_OS ITT_OS_FREEBSD
  122. # else
  123. # define ITT_OS ITT_OS_LINUX
  124. # endif
  125. #endif /* ITT_OS */
  126. #ifndef ITT_PLATFORM_WIN
  127. # define ITT_PLATFORM_WIN 1
  128. #endif /* ITT_PLATFORM_WIN */
  129. #ifndef ITT_PLATFORM_POSIX
  130. # define ITT_PLATFORM_POSIX 2
  131. #endif /* ITT_PLATFORM_POSIX */
  132. #ifndef ITT_PLATFORM_MAC
  133. # define ITT_PLATFORM_MAC 3
  134. #endif /* ITT_PLATFORM_MAC */
  135. #ifndef ITT_PLATFORM_FREEBSD
  136. # define ITT_PLATFORM_FREEBSD 4
  137. #endif /* ITT_PLATFORM_FREEBSD */
  138. #ifndef ITT_PLATFORM
  139. # if ITT_OS==ITT_OS_WIN
  140. # define ITT_PLATFORM ITT_PLATFORM_WIN
  141. # elif ITT_OS==ITT_OS_MAC
  142. # define ITT_PLATFORM ITT_PLATFORM_MAC
  143. # elif ITT_OS==ITT_OS_FREEBSD
  144. # define ITT_PLATFORM ITT_PLATFORM_FREEBSD
  145. # else
  146. # define ITT_PLATFORM ITT_PLATFORM_POSIX
  147. # endif
  148. #endif /* ITT_PLATFORM */
  149. #if defined(_UNICODE) && !defined(UNICODE)
  150. #define UNICODE
  151. #endif
  152. #include <stddef.h>
  153. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  154. #include <tchar.h>
  155. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  156. #include <stdint.h>
  157. #if defined(UNICODE) || defined(_UNICODE)
  158. #include <wchar.h>
  159. #endif /* UNICODE || _UNICODE */
  160. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  161. #ifndef CDECL
  162. # if ITT_PLATFORM==ITT_PLATFORM_WIN
  163. # define CDECL __cdecl
  164. # else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  165. # if defined _M_IX86 || defined __i386__
  166. # define CDECL __attribute__ ((cdecl))
  167. # else /* _M_IX86 || __i386__ */
  168. # define CDECL /* actual only on x86 platform */
  169. # endif /* _M_IX86 || __i386__ */
  170. # endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  171. #endif /* CDECL */
  172. #ifndef STDCALL
  173. # if ITT_PLATFORM==ITT_PLATFORM_WIN
  174. # define STDCALL __stdcall
  175. # else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  176. # if defined _M_IX86 || defined __i386__
  177. # define STDCALL __attribute__ ((stdcall))
  178. # else /* _M_IX86 || __i386__ */
  179. # define STDCALL /* supported only on x86 platform */
  180. # endif /* _M_IX86 || __i386__ */
  181. # endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  182. #endif /* STDCALL */
  183. #define ITTAPI CDECL
  184. #define LIBITTAPI CDECL
  185. /* TODO: Temporary for compatibility! */
  186. #define ITTAPI_CALL CDECL
  187. #define LIBITTAPI_CALL CDECL
  188. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  189. /* use __forceinline (VC++ specific) */
  190. #define ITT_INLINE __forceinline
  191. #define ITT_INLINE_ATTRIBUTE /* nothing */
  192. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  193. /*
  194. * Generally, functions are not inlined unless optimization is specified.
  195. * For functions declared inline, this attribute inlines the function even
  196. * if no optimization level was specified.
  197. */
  198. #ifdef __STRICT_ANSI__
  199. #define ITT_INLINE static
  200. #define ITT_INLINE_ATTRIBUTE __attribute__((unused))
  201. #else /* __STRICT_ANSI__ */
  202. #define ITT_INLINE static inline
  203. #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
  204. #endif /* __STRICT_ANSI__ */
  205. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  206. /** @endcond */
  207. #ifdef INTEL_ITTNOTIFY_ENABLE_LEGACY
  208. # if ITT_PLATFORM==ITT_PLATFORM_WIN
  209. # pragma message("WARNING!!! Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro")
  210. # else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  211. # warning "Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro"
  212. # endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  213. # include "legacy/ittnotify.h"
  214. #endif /* INTEL_ITTNOTIFY_ENABLE_LEGACY */
  215. /** @cond exclude_from_documentation */
  216. /* Helper macro for joining tokens */
  217. #define ITT_JOIN_AUX(p,n) p##n
  218. #define ITT_JOIN(p,n) ITT_JOIN_AUX(p,n)
  219. #ifdef ITT_MAJOR
  220. #undef ITT_MAJOR
  221. #endif
  222. #ifdef ITT_MINOR
  223. #undef ITT_MINOR
  224. #endif
  225. #define ITT_MAJOR 3
  226. #define ITT_MINOR 0
  227. /* Standard versioning of a token with major and minor version numbers */
  228. #define ITT_VERSIONIZE(x) \
  229. ITT_JOIN(x, \
  230. ITT_JOIN(_, \
  231. ITT_JOIN(ITT_MAJOR, \
  232. ITT_JOIN(_, ITT_MINOR))))
  233. #ifndef INTEL_ITTNOTIFY_PREFIX
  234. # define INTEL_ITTNOTIFY_PREFIX __itt_
  235. #endif /* INTEL_ITTNOTIFY_PREFIX */
  236. #ifndef INTEL_ITTNOTIFY_POSTFIX
  237. # define INTEL_ITTNOTIFY_POSTFIX _ptr_
  238. #endif /* INTEL_ITTNOTIFY_POSTFIX */
  239. #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
  240. #define ITTNOTIFY_NAME(n) ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
  241. #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
  242. #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
  243. #define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
  244. #define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
  245. #define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
  246. #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)
  247. #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)
  248. #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)
  249. #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)
  250. #define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
  251. #define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
  252. #define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
  253. #define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
  254. #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)
  255. #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)
  256. #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)
  257. #ifdef ITT_STUB
  258. #undef ITT_STUB
  259. #endif
  260. #ifdef ITT_STUBV
  261. #undef ITT_STUBV
  262. #endif
  263. #define ITT_STUBV(api,type,name,args) \
  264. typedef type (api* ITT_JOIN(ITTNOTIFY_NAME(name),_t)) args; \
  265. extern ITT_JOIN(ITTNOTIFY_NAME(name),_t) ITTNOTIFY_NAME(name);
  266. #define ITT_STUB ITT_STUBV
  267. /** @endcond */
  268. #ifdef __cplusplus
  269. extern "C" {
  270. #endif /* __cplusplus */
  271. /** @cond exclude_from_gpa_documentation */
  272. /**
  273. * @defgroup public Public API
  274. * @{
  275. * @}
  276. */
  277. /**
  278. * @defgroup control Collection Control
  279. * @ingroup public
  280. * General behavior: application continues to run, but no profiling information is being collected
  281. *
  282. * Pausing occurs not only for the current thread but for all process as well as spawned processes
  283. * - Intel(R) Parallel Inspector and Intel(R) Inspector XE:
  284. * - Does not analyze or report errors that involve memory access.
  285. * - Other errors are reported as usual. Pausing data collection in
  286. * Intel(R) Parallel Inspector and Intel(R) Inspector XE
  287. * only pauses tracing and analyzing memory access.
  288. * It does not pause tracing or analyzing threading APIs.
  289. * .
  290. * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
  291. * - Does continue to record when new threads are started.
  292. * .
  293. * - Other effects:
  294. * - Possible reduction of runtime overhead.
  295. * .
  296. * @{
  297. */
  298. /** @brief Pause collection */
  299. void ITTAPI __itt_pause(void);
  300. /** @brief Resume collection */
  301. void ITTAPI __itt_resume(void);
  302. /** @brief Detach collection */
  303. void ITTAPI __itt_detach(void);
  304. /** @cond exclude_from_documentation */
  305. #ifndef INTEL_NO_MACRO_BODY
  306. #ifndef INTEL_NO_ITTNOTIFY_API
  307. ITT_STUBV(ITTAPI, void, pause, (void))
  308. ITT_STUBV(ITTAPI, void, resume, (void))
  309. ITT_STUBV(ITTAPI, void, detach, (void))
  310. #define __itt_pause ITTNOTIFY_VOID(pause)
  311. #define __itt_pause_ptr ITTNOTIFY_NAME(pause)
  312. #define __itt_resume ITTNOTIFY_VOID(resume)
  313. #define __itt_resume_ptr ITTNOTIFY_NAME(resume)
  314. #define __itt_detach ITTNOTIFY_VOID(detach)
  315. #define __itt_detach_ptr ITTNOTIFY_NAME(detach)
  316. #else /* INTEL_NO_ITTNOTIFY_API */
  317. #define __itt_pause()
  318. #define __itt_pause_ptr 0
  319. #define __itt_resume()
  320. #define __itt_resume_ptr 0
  321. #define __itt_detach()
  322. #define __itt_detach_ptr 0
  323. #endif /* INTEL_NO_ITTNOTIFY_API */
  324. #else /* INTEL_NO_MACRO_BODY */
  325. #define __itt_pause_ptr 0
  326. #define __itt_resume_ptr 0
  327. #define __itt_detach_ptr 0
  328. #endif /* INTEL_NO_MACRO_BODY */
  329. /** @endcond */
  330. /** @} control group */
  331. /** @endcond */
  332. /**
  333. * @defgroup threads Threads
  334. * @ingroup public
  335. * Give names to threads
  336. * @{
  337. */
  338. /**
  339. * @brief Sets thread name of calling thread
  340. * @param[in] name - name of thread
  341. */
  342. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  343. void ITTAPI __itt_thread_set_nameA(const char *name);
  344. void ITTAPI __itt_thread_set_nameW(const wchar_t *name);
  345. #if defined(UNICODE) || defined(_UNICODE)
  346. # define __itt_thread_set_name __itt_thread_set_nameW
  347. # define __itt_thread_set_name_ptr __itt_thread_set_nameW_ptr
  348. #else /* UNICODE */
  349. # define __itt_thread_set_name __itt_thread_set_nameA
  350. # define __itt_thread_set_name_ptr __itt_thread_set_nameA_ptr
  351. #endif /* UNICODE */
  352. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  353. void ITTAPI __itt_thread_set_name(const char *name);
  354. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  355. /** @cond exclude_from_documentation */
  356. #ifndef INTEL_NO_MACRO_BODY
  357. #ifndef INTEL_NO_ITTNOTIFY_API
  358. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  359. ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name))
  360. ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name))
  361. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  362. ITT_STUBV(ITTAPI, void, thread_set_name, (const char *name))
  363. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  364. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  365. #define __itt_thread_set_nameA ITTNOTIFY_VOID(thread_set_nameA)
  366. #define __itt_thread_set_nameA_ptr ITTNOTIFY_NAME(thread_set_nameA)
  367. #define __itt_thread_set_nameW ITTNOTIFY_VOID(thread_set_nameW)
  368. #define __itt_thread_set_nameW_ptr ITTNOTIFY_NAME(thread_set_nameW)
  369. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  370. #define __itt_thread_set_name ITTNOTIFY_VOID(thread_set_name)
  371. #define __itt_thread_set_name_ptr ITTNOTIFY_NAME(thread_set_name)
  372. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  373. #else /* INTEL_NO_ITTNOTIFY_API */
  374. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  375. #define __itt_thread_set_nameA(name)
  376. #define __itt_thread_set_nameA_ptr 0
  377. #define __itt_thread_set_nameW(name)
  378. #define __itt_thread_set_nameW_ptr 0
  379. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  380. #define __itt_thread_set_name(name)
  381. #define __itt_thread_set_name_ptr 0
  382. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  383. #endif /* INTEL_NO_ITTNOTIFY_API */
  384. #else /* INTEL_NO_MACRO_BODY */
  385. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  386. #define __itt_thread_set_nameA_ptr 0
  387. #define __itt_thread_set_nameW_ptr 0
  388. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  389. #define __itt_thread_set_name_ptr 0
  390. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  391. #endif /* INTEL_NO_MACRO_BODY */
  392. /** @endcond */
  393. /** @cond exclude_from_gpa_documentation */
  394. /**
  395. * @brief Mark current thread as ignored from this point on, for the duration of its existence.
  396. */
  397. void ITTAPI __itt_thread_ignore(void);
  398. /** @cond exclude_from_documentation */
  399. #ifndef INTEL_NO_MACRO_BODY
  400. #ifndef INTEL_NO_ITTNOTIFY_API
  401. ITT_STUBV(ITTAPI, void, thread_ignore, (void))
  402. #define __itt_thread_ignore ITTNOTIFY_VOID(thread_ignore)
  403. #define __itt_thread_ignore_ptr ITTNOTIFY_NAME(thread_ignore)
  404. #else /* INTEL_NO_ITTNOTIFY_API */
  405. #define __itt_thread_ignore()
  406. #define __itt_thread_ignore_ptr 0
  407. #endif /* INTEL_NO_ITTNOTIFY_API */
  408. #else /* INTEL_NO_MACRO_BODY */
  409. #define __itt_thread_ignore_ptr 0
  410. #endif /* INTEL_NO_MACRO_BODY */
  411. /** @endcond */
  412. /** @} threads group */
  413. /**
  414. * @defgroup suppress Error suppression
  415. * @ingroup public
  416. * General behavior: application continues to run, but errors are suppressed
  417. *
  418. * @{
  419. */
  420. /*****************************************************************//**
  421. * @name group of functions used for error suppression in correctness tools
  422. *********************************************************************/
  423. /** @{ */
  424. /**
  425. * @hideinitializer
  426. * @brief possible value for suppression mask
  427. */
  428. #define __itt_suppress_all_errors 0x7fffffff
  429. /**
  430. * @hideinitializer
  431. * @brief possible value for suppression mask (suppresses errors from threading analysis)
  432. */
  433. #define __itt_suppress_threading_errors 0x000000ff
  434. /**
  435. * @hideinitializer
  436. * @brief possible value for suppression mask (suppresses errors from memory analysis)
  437. */
  438. #define __itt_suppress_memory_errors 0x0000ff00
  439. /**
  440. * @brief Start suppressing errors identified in mask on this thread
  441. */
  442. void ITTAPI __itt_suppress_push(unsigned int mask);
  443. /** @cond exclude_from_documentation */
  444. #ifndef INTEL_NO_MACRO_BODY
  445. #ifndef INTEL_NO_ITTNOTIFY_API
  446. ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask))
  447. #define __itt_suppress_push ITTNOTIFY_VOID(suppress_push)
  448. #define __itt_suppress_push_ptr ITTNOTIFY_NAME(suppress_push)
  449. #else /* INTEL_NO_ITTNOTIFY_API */
  450. #define __itt_suppress_push(mask)
  451. #define __itt_suppress_push_ptr 0
  452. #endif /* INTEL_NO_ITTNOTIFY_API */
  453. #else /* INTEL_NO_MACRO_BODY */
  454. #define __itt_suppress_push_ptr 0
  455. #endif /* INTEL_NO_MACRO_BODY */
  456. /** @endcond */
  457. /**
  458. * @brief Undo the effects of the matching call to __itt_suppress_push
  459. */
  460. void ITTAPI __itt_suppress_pop(void);
  461. /** @cond exclude_from_documentation */
  462. #ifndef INTEL_NO_MACRO_BODY
  463. #ifndef INTEL_NO_ITTNOTIFY_API
  464. ITT_STUBV(ITTAPI, void, suppress_pop, (void))
  465. #define __itt_suppress_pop ITTNOTIFY_VOID(suppress_pop)
  466. #define __itt_suppress_pop_ptr ITTNOTIFY_NAME(suppress_pop)
  467. #else /* INTEL_NO_ITTNOTIFY_API */
  468. #define __itt_suppress_pop()
  469. #define __itt_suppress_pop_ptr 0
  470. #endif /* INTEL_NO_ITTNOTIFY_API */
  471. #else /* INTEL_NO_MACRO_BODY */
  472. #define __itt_suppress_pop_ptr 0
  473. #endif /* INTEL_NO_MACRO_BODY */
  474. /** @endcond */
  475. /**
  476. * @enum __itt_model_disable
  477. * @brief Enumerator for the disable methods
  478. */
  479. typedef enum __itt_suppress_mode {
  480. __itt_unsuppress_range,
  481. __itt_suppress_range
  482. } __itt_suppress_mode_t;
  483. /**
  484. * @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
  485. */
  486. void ITTAPI __itt_suppress_mark_range(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size);
  487. /** @cond exclude_from_documentation */
  488. #ifndef INTEL_NO_MACRO_BODY
  489. #ifndef INTEL_NO_ITTNOTIFY_API
  490. ITT_STUBV(ITTAPI, void, suppress_mark_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size))
  491. #define __itt_suppress_mark_range ITTNOTIFY_VOID(suppress_mark_range)
  492. #define __itt_suppress_mark_range_ptr ITTNOTIFY_NAME(suppress_mark_range)
  493. #else /* INTEL_NO_ITTNOTIFY_API */
  494. #define __itt_suppress_mark_range(mask)
  495. #define __itt_suppress_mark_range_ptr 0
  496. #endif /* INTEL_NO_ITTNOTIFY_API */
  497. #else /* INTEL_NO_MACRO_BODY */
  498. #define __itt_suppress_mark_range_ptr 0
  499. #endif /* INTEL_NO_MACRO_BODY */
  500. /** @endcond */
  501. /**
  502. * @brief Undo the effect of a matching call to __itt_suppress_mark_range. If not matching
  503. * call is found, nothing is changed.
  504. */
  505. void ITTAPI __itt_suppress_clear_range(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size);
  506. /** @cond exclude_from_documentation */
  507. #ifndef INTEL_NO_MACRO_BODY
  508. #ifndef INTEL_NO_ITTNOTIFY_API
  509. ITT_STUBV(ITTAPI, void, suppress_clear_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size))
  510. #define __itt_suppress_clear_range ITTNOTIFY_VOID(suppress_clear_range)
  511. #define __itt_suppress_clear_range_ptr ITTNOTIFY_NAME(suppress_clear_range)
  512. #else /* INTEL_NO_ITTNOTIFY_API */
  513. #define __itt_suppress_clear_range(mask)
  514. #define __itt_suppress_clear_range_ptr 0
  515. #endif /* INTEL_NO_ITTNOTIFY_API */
  516. #else /* INTEL_NO_MACRO_BODY */
  517. #define __itt_suppress_clear_range_ptr 0
  518. #endif /* INTEL_NO_MACRO_BODY */
  519. /** @endcond */
  520. /** @} */
  521. /** @} suppress group */
  522. /**
  523. * @defgroup sync Synchronization
  524. * @ingroup public
  525. * Indicate user-written synchronization code
  526. * @{
  527. */
  528. /**
  529. * @hideinitializer
  530. * @brief possible value of attribute argument for sync object type
  531. */
  532. #define __itt_attr_barrier 1
  533. /**
  534. * @hideinitializer
  535. * @brief possible value of attribute argument for sync object type
  536. */
  537. #define __itt_attr_mutex 2
  538. /**
  539. @brief Name a synchronization object
  540. @param[in] addr Handle for the synchronization object. You should
  541. use a real address to uniquely identify the synchronization object.
  542. @param[in] objtype null-terminated object type string. If NULL is
  543. passed, the name will be "User Synchronization".
  544. @param[in] objname null-terminated object name string. If NULL,
  545. no name will be assigned to the object.
  546. @param[in] attribute one of [#__itt_attr_barrier, #__itt_attr_mutex]
  547. */
  548. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  549. void ITTAPI __itt_sync_createA(void *addr, const char *objtype, const char *objname, int attribute);
  550. void ITTAPI __itt_sync_createW(void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute);
  551. #if defined(UNICODE) || defined(_UNICODE)
  552. # define __itt_sync_create __itt_sync_createW
  553. # define __itt_sync_create_ptr __itt_sync_createW_ptr
  554. #else /* UNICODE */
  555. # define __itt_sync_create __itt_sync_createA
  556. # define __itt_sync_create_ptr __itt_sync_createA_ptr
  557. #endif /* UNICODE */
  558. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  559. void ITTAPI __itt_sync_create (void *addr, const char *objtype, const char *objname, int attribute);
  560. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  561. /** @cond exclude_from_documentation */
  562. #ifndef INTEL_NO_MACRO_BODY
  563. #ifndef INTEL_NO_ITTNOTIFY_API
  564. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  565. ITT_STUBV(ITTAPI, void, sync_createA, (void *addr, const char *objtype, const char *objname, int attribute))
  566. ITT_STUBV(ITTAPI, void, sync_createW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute))
  567. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  568. ITT_STUBV(ITTAPI, void, sync_create, (void *addr, const char* objtype, const char* objname, int attribute))
  569. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  570. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  571. #define __itt_sync_createA ITTNOTIFY_VOID(sync_createA)
  572. #define __itt_sync_createA_ptr ITTNOTIFY_NAME(sync_createA)
  573. #define __itt_sync_createW ITTNOTIFY_VOID(sync_createW)
  574. #define __itt_sync_createW_ptr ITTNOTIFY_NAME(sync_createW)
  575. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  576. #define __itt_sync_create ITTNOTIFY_VOID(sync_create)
  577. #define __itt_sync_create_ptr ITTNOTIFY_NAME(sync_create)
  578. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  579. #else /* INTEL_NO_ITTNOTIFY_API */
  580. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  581. #define __itt_sync_createA(addr, objtype, objname, attribute)
  582. #define __itt_sync_createA_ptr 0
  583. #define __itt_sync_createW(addr, objtype, objname, attribute)
  584. #define __itt_sync_createW_ptr 0
  585. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  586. #define __itt_sync_create(addr, objtype, objname, attribute)
  587. #define __itt_sync_create_ptr 0
  588. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  589. #endif /* INTEL_NO_ITTNOTIFY_API */
  590. #else /* INTEL_NO_MACRO_BODY */
  591. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  592. #define __itt_sync_createA_ptr 0
  593. #define __itt_sync_createW_ptr 0
  594. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  595. #define __itt_sync_create_ptr 0
  596. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  597. #endif /* INTEL_NO_MACRO_BODY */
  598. /** @endcond */
  599. /**
  600. @brief Rename a synchronization object
  601. You can use the rename call to assign or reassign a name to a given
  602. synchronization object.
  603. @param[in] addr handle for the synchronization object.
  604. @param[in] name null-terminated object name string.
  605. */
  606. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  607. void ITTAPI __itt_sync_renameA(void *addr, const char *name);
  608. void ITTAPI __itt_sync_renameW(void *addr, const wchar_t *name);
  609. #if defined(UNICODE) || defined(_UNICODE)
  610. # define __itt_sync_rename __itt_sync_renameW
  611. # define __itt_sync_rename_ptr __itt_sync_renameW_ptr
  612. #else /* UNICODE */
  613. # define __itt_sync_rename __itt_sync_renameA
  614. # define __itt_sync_rename_ptr __itt_sync_renameA_ptr
  615. #endif /* UNICODE */
  616. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  617. void ITTAPI __itt_sync_rename(void *addr, const char *name);
  618. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  619. /** @cond exclude_from_documentation */
  620. #ifndef INTEL_NO_MACRO_BODY
  621. #ifndef INTEL_NO_ITTNOTIFY_API
  622. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  623. ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char *name))
  624. ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name))
  625. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  626. ITT_STUBV(ITTAPI, void, sync_rename, (void *addr, const char *name))
  627. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  628. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  629. #define __itt_sync_renameA ITTNOTIFY_VOID(sync_renameA)
  630. #define __itt_sync_renameA_ptr ITTNOTIFY_NAME(sync_renameA)
  631. #define __itt_sync_renameW ITTNOTIFY_VOID(sync_renameW)
  632. #define __itt_sync_renameW_ptr ITTNOTIFY_NAME(sync_renameW)
  633. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  634. #define __itt_sync_rename ITTNOTIFY_VOID(sync_rename)
  635. #define __itt_sync_rename_ptr ITTNOTIFY_NAME(sync_rename)
  636. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  637. #else /* INTEL_NO_ITTNOTIFY_API */
  638. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  639. #define __itt_sync_renameA(addr, name)
  640. #define __itt_sync_renameA_ptr 0
  641. #define __itt_sync_renameW(addr, name)
  642. #define __itt_sync_renameW_ptr 0
  643. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  644. #define __itt_sync_rename(addr, name)
  645. #define __itt_sync_rename_ptr 0
  646. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  647. #endif /* INTEL_NO_ITTNOTIFY_API */
  648. #else /* INTEL_NO_MACRO_BODY */
  649. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  650. #define __itt_sync_renameA_ptr 0
  651. #define __itt_sync_renameW_ptr 0
  652. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  653. #define __itt_sync_rename_ptr 0
  654. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  655. #endif /* INTEL_NO_MACRO_BODY */
  656. /** @endcond */
  657. /**
  658. @brief Destroy a synchronization object.
  659. @param addr Handle for the synchronization object.
  660. */
  661. void ITTAPI __itt_sync_destroy(void *addr);
  662. /** @cond exclude_from_documentation */
  663. #ifndef INTEL_NO_MACRO_BODY
  664. #ifndef INTEL_NO_ITTNOTIFY_API
  665. ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr))
  666. #define __itt_sync_destroy ITTNOTIFY_VOID(sync_destroy)
  667. #define __itt_sync_destroy_ptr ITTNOTIFY_NAME(sync_destroy)
  668. #else /* INTEL_NO_ITTNOTIFY_API */
  669. #define __itt_sync_destroy(addr)
  670. #define __itt_sync_destroy_ptr 0
  671. #endif /* INTEL_NO_ITTNOTIFY_API */
  672. #else /* INTEL_NO_MACRO_BODY */
  673. #define __itt_sync_destroy_ptr 0
  674. #endif /* INTEL_NO_MACRO_BODY */
  675. /** @endcond */
  676. /*****************************************************************//**
  677. * @name group of functions is used for performance measurement tools
  678. *********************************************************************/
  679. /** @{ */
  680. /**
  681. * @brief Enter spin loop on user-defined sync object
  682. */
  683. void ITTAPI __itt_sync_prepare(void* addr);
  684. /** @cond exclude_from_documentation */
  685. #ifndef INTEL_NO_MACRO_BODY
  686. #ifndef INTEL_NO_ITTNOTIFY_API
  687. ITT_STUBV(ITTAPI, void, sync_prepare, (void *addr))
  688. #define __itt_sync_prepare ITTNOTIFY_VOID(sync_prepare)
  689. #define __itt_sync_prepare_ptr ITTNOTIFY_NAME(sync_prepare)
  690. #else /* INTEL_NO_ITTNOTIFY_API */
  691. #define __itt_sync_prepare(addr)
  692. #define __itt_sync_prepare_ptr 0
  693. #endif /* INTEL_NO_ITTNOTIFY_API */
  694. #else /* INTEL_NO_MACRO_BODY */
  695. #define __itt_sync_prepare_ptr 0
  696. #endif /* INTEL_NO_MACRO_BODY */
  697. /** @endcond */
  698. /**
  699. * @brief Quit spin loop without acquiring spin object
  700. */
  701. void ITTAPI __itt_sync_cancel(void *addr);
  702. /** @cond exclude_from_documentation */
  703. #ifndef INTEL_NO_MACRO_BODY
  704. #ifndef INTEL_NO_ITTNOTIFY_API
  705. ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr))
  706. #define __itt_sync_cancel ITTNOTIFY_VOID(sync_cancel)
  707. #define __itt_sync_cancel_ptr ITTNOTIFY_NAME(sync_cancel)
  708. #else /* INTEL_NO_ITTNOTIFY_API */
  709. #define __itt_sync_cancel(addr)
  710. #define __itt_sync_cancel_ptr 0
  711. #endif /* INTEL_NO_ITTNOTIFY_API */
  712. #else /* INTEL_NO_MACRO_BODY */
  713. #define __itt_sync_cancel_ptr 0
  714. #endif /* INTEL_NO_MACRO_BODY */
  715. /** @endcond */
  716. /**
  717. * @brief Successful spin loop completion (sync object acquired)
  718. */
  719. void ITTAPI __itt_sync_acquired(void *addr);
  720. /** @cond exclude_from_documentation */
  721. #ifndef INTEL_NO_MACRO_BODY
  722. #ifndef INTEL_NO_ITTNOTIFY_API
  723. ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr))
  724. #define __itt_sync_acquired ITTNOTIFY_VOID(sync_acquired)
  725. #define __itt_sync_acquired_ptr ITTNOTIFY_NAME(sync_acquired)
  726. #else /* INTEL_NO_ITTNOTIFY_API */
  727. #define __itt_sync_acquired(addr)
  728. #define __itt_sync_acquired_ptr 0
  729. #endif /* INTEL_NO_ITTNOTIFY_API */
  730. #else /* INTEL_NO_MACRO_BODY */
  731. #define __itt_sync_acquired_ptr 0
  732. #endif /* INTEL_NO_MACRO_BODY */
  733. /** @endcond */
  734. /**
  735. * @brief Start sync object releasing code. Is called before the lock release call.
  736. */
  737. void ITTAPI __itt_sync_releasing(void* addr);
  738. /** @cond exclude_from_documentation */
  739. #ifndef INTEL_NO_MACRO_BODY
  740. #ifndef INTEL_NO_ITTNOTIFY_API
  741. ITT_STUBV(ITTAPI, void, sync_releasing, (void *addr))
  742. #define __itt_sync_releasing ITTNOTIFY_VOID(sync_releasing)
  743. #define __itt_sync_releasing_ptr ITTNOTIFY_NAME(sync_releasing)
  744. #else /* INTEL_NO_ITTNOTIFY_API */
  745. #define __itt_sync_releasing(addr)
  746. #define __itt_sync_releasing_ptr 0
  747. #endif /* INTEL_NO_ITTNOTIFY_API */
  748. #else /* INTEL_NO_MACRO_BODY */
  749. #define __itt_sync_releasing_ptr 0
  750. #endif /* INTEL_NO_MACRO_BODY */
  751. /** @endcond */
  752. /** @} */
  753. /** @} sync group */
  754. /**************************************************************//**
  755. * @name group of functions is used for correctness checking tools
  756. ******************************************************************/
  757. /** @{ */
  758. /**
  759. * @ingroup legacy
  760. * @deprecated Legacy API
  761. * @brief Fast synchronization which does no require spinning.
  762. * - This special function is to be used by TBB and OpenMP libraries only when they know
  763. * there is no spin but they need to suppress TC warnings about shared variable modifications.
  764. * - It only has corresponding pointers in static library and does not have corresponding function
  765. * in dynamic library.
  766. * @see void __itt_sync_prepare(void* addr);
  767. */
  768. void ITTAPI __itt_fsync_prepare(void* addr);
  769. /** @cond exclude_from_documentation */
  770. #ifndef INTEL_NO_MACRO_BODY
  771. #ifndef INTEL_NO_ITTNOTIFY_API
  772. ITT_STUBV(ITTAPI, void, fsync_prepare, (void *addr))
  773. #define __itt_fsync_prepare ITTNOTIFY_VOID(fsync_prepare)
  774. #define __itt_fsync_prepare_ptr ITTNOTIFY_NAME(fsync_prepare)
  775. #else /* INTEL_NO_ITTNOTIFY_API */
  776. #define __itt_fsync_prepare(addr)
  777. #define __itt_fsync_prepare_ptr 0
  778. #endif /* INTEL_NO_ITTNOTIFY_API */
  779. #else /* INTEL_NO_MACRO_BODY */
  780. #define __itt_fsync_prepare_ptr 0
  781. #endif /* INTEL_NO_MACRO_BODY */
  782. /** @endcond */
  783. /**
  784. * @ingroup legacy
  785. * @deprecated Legacy API
  786. * @brief Fast synchronization which does no require spinning.
  787. * - This special function is to be used by TBB and OpenMP libraries only when they know
  788. * there is no spin but they need to suppress TC warnings about shared variable modifications.
  789. * - It only has corresponding pointers in static library and does not have corresponding function
  790. * in dynamic library.
  791. * @see void __itt_sync_cancel(void *addr);
  792. */
  793. void ITTAPI __itt_fsync_cancel(void *addr);
  794. /** @cond exclude_from_documentation */
  795. #ifndef INTEL_NO_MACRO_BODY
  796. #ifndef INTEL_NO_ITTNOTIFY_API
  797. ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr))
  798. #define __itt_fsync_cancel ITTNOTIFY_VOID(fsync_cancel)
  799. #define __itt_fsync_cancel_ptr ITTNOTIFY_NAME(fsync_cancel)
  800. #else /* INTEL_NO_ITTNOTIFY_API */
  801. #define __itt_fsync_cancel(addr)
  802. #define __itt_fsync_cancel_ptr 0
  803. #endif /* INTEL_NO_ITTNOTIFY_API */
  804. #else /* INTEL_NO_MACRO_BODY */
  805. #define __itt_fsync_cancel_ptr 0
  806. #endif /* INTEL_NO_MACRO_BODY */
  807. /** @endcond */
  808. /**
  809. * @ingroup legacy
  810. * @deprecated Legacy API
  811. * @brief Fast synchronization which does no require spinning.
  812. * - This special function is to be used by TBB and OpenMP libraries only when they know
  813. * there is no spin but they need to suppress TC warnings about shared variable modifications.
  814. * - It only has corresponding pointers in static library and does not have corresponding function
  815. * in dynamic library.
  816. * @see void __itt_sync_acquired(void *addr);
  817. */
  818. void ITTAPI __itt_fsync_acquired(void *addr);
  819. /** @cond exclude_from_documentation */
  820. #ifndef INTEL_NO_MACRO_BODY
  821. #ifndef INTEL_NO_ITTNOTIFY_API
  822. ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr))
  823. #define __itt_fsync_acquired ITTNOTIFY_VOID(fsync_acquired)
  824. #define __itt_fsync_acquired_ptr ITTNOTIFY_NAME(fsync_acquired)
  825. #else /* INTEL_NO_ITTNOTIFY_API */
  826. #define __itt_fsync_acquired(addr)
  827. #define __itt_fsync_acquired_ptr 0
  828. #endif /* INTEL_NO_ITTNOTIFY_API */
  829. #else /* INTEL_NO_MACRO_BODY */
  830. #define __itt_fsync_acquired_ptr 0
  831. #endif /* INTEL_NO_MACRO_BODY */
  832. /** @endcond */
  833. /**
  834. * @ingroup legacy
  835. * @deprecated Legacy API
  836. * @brief Fast synchronization which does no require spinning.
  837. * - This special function is to be used by TBB and OpenMP libraries only when they know
  838. * there is no spin but they need to suppress TC warnings about shared variable modifications.
  839. * - It only has corresponding pointers in static library and does not have corresponding function
  840. * in dynamic library.
  841. * @see void __itt_sync_releasing(void* addr);
  842. */
  843. void ITTAPI __itt_fsync_releasing(void* addr);
  844. /** @cond exclude_from_documentation */
  845. #ifndef INTEL_NO_MACRO_BODY
  846. #ifndef INTEL_NO_ITTNOTIFY_API
  847. ITT_STUBV(ITTAPI, void, fsync_releasing, (void *addr))
  848. #define __itt_fsync_releasing ITTNOTIFY_VOID(fsync_releasing)
  849. #define __itt_fsync_releasing_ptr ITTNOTIFY_NAME(fsync_releasing)
  850. #else /* INTEL_NO_ITTNOTIFY_API */
  851. #define __itt_fsync_releasing(addr)
  852. #define __itt_fsync_releasing_ptr 0
  853. #endif /* INTEL_NO_ITTNOTIFY_API */
  854. #else /* INTEL_NO_MACRO_BODY */
  855. #define __itt_fsync_releasing_ptr 0
  856. #endif /* INTEL_NO_MACRO_BODY */
  857. /** @endcond */
  858. /** @} */
  859. /**
  860. * @defgroup model Modeling by Intel(R) Parallel Advisor
  861. * @ingroup public
  862. * This is the subset of itt used for modeling by Intel(R) Parallel Advisor.
  863. * This API is called ONLY using annotate.h, by "Annotation" macros
  864. * the user places in their sources during the parallelism modeling steps.
  865. *
  866. * site_begin/end and task_begin/end take the address of handle variables,
  867. * which are writeable by the API. Handles must be 0 initialized prior
  868. * to the first call to begin, or may cause a run-time failure.
  869. * The handles are initialized in a multi-thread safe way by the API if
  870. * the handle is 0. The commonly expected idiom is one static handle to
  871. * identify a site or task. If a site or task of the same name has already
  872. * been started during this collection, the same handle MAY be returned,
  873. * but is not required to be - it is unspecified if data merging is done
  874. * based on name. These routines also take an instance variable. Like
  875. * the lexical instance, these must be 0 initialized. Unlike the lexical
  876. * instance, this is used to track a single dynamic instance.
  877. *
  878. * API used by the Intel(R) Parallel Advisor to describe potential concurrency
  879. * and related activities. User-added source annotations expand to calls
  880. * to these procedures to enable modeling of a hypothetical concurrent
  881. * execution serially.
  882. * @{
  883. */
  884. #if !defined(_ADVISOR_ANNOTATE_H_) || defined(ANNOTATE_EXPAND_NULL)
  885. typedef void* __itt_model_site; /*!< @brief handle for lexical site */
  886. typedef void* __itt_model_site_instance; /*!< @brief handle for dynamic instance */
  887. typedef void* __itt_model_task; /*!< @brief handle for lexical site */
  888. typedef void* __itt_model_task_instance; /*!< @brief handle for dynamic instance */
  889. /**
  890. * @enum __itt_model_disable
  891. * @brief Enumerator for the disable methods
  892. */
  893. typedef enum {
  894. __itt_model_disable_observation,
  895. __itt_model_disable_collection
  896. } __itt_model_disable;
  897. #endif /* !_ADVISOR_ANNOTATE_H_ || ANNOTATE_EXPAND_NULL */
  898. /**
  899. * @brief ANNOTATE_SITE_BEGIN/ANNOTATE_SITE_END support.
  900. *
  901. * site_begin/end model a potential concurrency site.
  902. * site instances may be recursively nested with themselves.
  903. * site_end exits the most recently started but unended site for the current
  904. * thread. The handle passed to end may be used to validate structure.
  905. * Instances of a site encountered on different threads concurrently
  906. * are considered completely distinct. If the site name for two different
  907. * lexical sites match, it is unspecified whether they are treated as the
  908. * same or different for data presentation.
  909. */
  910. void ITTAPI __itt_model_site_begin(__itt_model_site *site, __itt_model_site_instance *instance, const char *name);
  911. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  912. void ITTAPI __itt_model_site_beginW(const wchar_t *name);
  913. #endif
  914. void ITTAPI __itt_model_site_beginA(const char *name);
  915. void ITTAPI __itt_model_site_beginAL(const char *name, size_t siteNameLen);
  916. void ITTAPI __itt_model_site_end (__itt_model_site *site, __itt_model_site_instance *instance);
  917. void ITTAPI __itt_model_site_end_2(void);
  918. /** @cond exclude_from_documentation */
  919. #ifndef INTEL_NO_MACRO_BODY
  920. #ifndef INTEL_NO_ITTNOTIFY_API
  921. ITT_STUBV(ITTAPI, void, model_site_begin, (__itt_model_site *site, __itt_model_site_instance *instance, const char *name))
  922. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  923. ITT_STUBV(ITTAPI, void, model_site_beginW, (const wchar_t *name))
  924. #endif
  925. ITT_STUBV(ITTAPI, void, model_site_beginA, (const char *name))
  926. ITT_STUBV(ITTAPI, void, model_site_beginAL, (const char *name, size_t siteNameLen))
  927. ITT_STUBV(ITTAPI, void, model_site_end, (__itt_model_site *site, __itt_model_site_instance *instance))
  928. ITT_STUBV(ITTAPI, void, model_site_end_2, (void))
  929. #define __itt_model_site_begin ITTNOTIFY_VOID(model_site_begin)
  930. #define __itt_model_site_begin_ptr ITTNOTIFY_NAME(model_site_begin)
  931. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  932. #define __itt_model_site_beginW ITTNOTIFY_VOID(model_site_beginW)
  933. #define __itt_model_site_beginW_ptr ITTNOTIFY_NAME(model_site_beginW)
  934. #endif
  935. #define __itt_model_site_beginA ITTNOTIFY_VOID(model_site_beginA)
  936. #define __itt_model_site_beginA_ptr ITTNOTIFY_NAME(model_site_beginA)
  937. #define __itt_model_site_beginAL ITTNOTIFY_VOID(model_site_beginAL)
  938. #define __itt_model_site_beginAL_ptr ITTNOTIFY_NAME(model_site_beginAL)
  939. #define __itt_model_site_end ITTNOTIFY_VOID(model_site_end)
  940. #define __itt_model_site_end_ptr ITTNOTIFY_NAME(model_site_end)
  941. #define __itt_model_site_end_2 ITTNOTIFY_VOID(model_site_end_2)
  942. #define __itt_model_site_end_2_ptr ITTNOTIFY_NAME(model_site_end_2)
  943. #else /* INTEL_NO_ITTNOTIFY_API */
  944. #define __itt_model_site_begin(site, instance, name)
  945. #define __itt_model_site_begin_ptr 0
  946. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  947. #define __itt_model_site_beginW(name)
  948. #define __itt_model_site_beginW_ptr 0
  949. #endif
  950. #define __itt_model_site_beginA(name)
  951. #define __itt_model_site_beginA_ptr 0
  952. #define __itt_model_site_beginAL(name, siteNameLen)
  953. #define __itt_model_site_beginAL_ptr 0
  954. #define __itt_model_site_end(site, instance)
  955. #define __itt_model_site_end_ptr 0
  956. #define __itt_model_site_end_2()
  957. #define __itt_model_site_end_2_ptr 0
  958. #endif /* INTEL_NO_ITTNOTIFY_API */
  959. #else /* INTEL_NO_MACRO_BODY */
  960. #define __itt_model_site_begin_ptr 0
  961. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  962. #define __itt_model_site_beginW_ptr 0
  963. #endif
  964. #define __itt_model_site_beginA_ptr 0
  965. #define __itt_model_site_beginAL_ptr 0
  966. #define __itt_model_site_end_ptr 0
  967. #define __itt_model_site_end_2_ptr 0
  968. #endif /* INTEL_NO_MACRO_BODY */
  969. /** @endcond */
  970. /**
  971. * @brief ANNOTATE_TASK_BEGIN/ANNOTATE_TASK_END support
  972. *
  973. * task_begin/end model a potential task, which is contained within the most
  974. * closely enclosing dynamic site. task_end exits the most recently started
  975. * but unended task. The handle passed to end may be used to validate
  976. * structure. It is unspecified if bad dynamic nesting is detected. If it
  977. * is, it should be encoded in the resulting data collection. The collector
  978. * should not fail due to construct nesting issues, nor attempt to directly
  979. * indicate the problem.
  980. */
  981. void ITTAPI __itt_model_task_begin(__itt_model_task *task, __itt_model_task_instance *instance, const char *name);
  982. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  983. void ITTAPI __itt_model_task_beginW(const wchar_t *name);
  984. void ITTAPI __itt_model_iteration_taskW(const wchar_t *name);
  985. #endif
  986. void ITTAPI __itt_model_task_beginA(const char *name);
  987. void ITTAPI __itt_model_task_beginAL(const char *name, size_t taskNameLen);
  988. void ITTAPI __itt_model_iteration_taskA(const char *name);
  989. void ITTAPI __itt_model_iteration_taskAL(const char *name, size_t taskNameLen);
  990. void ITTAPI __itt_model_task_end (__itt_model_task *task, __itt_model_task_instance *instance);
  991. void ITTAPI __itt_model_task_end_2(void);
  992. /** @cond exclude_from_documentation */
  993. #ifndef INTEL_NO_MACRO_BODY
  994. #ifndef INTEL_NO_ITTNOTIFY_API
  995. ITT_STUBV(ITTAPI, void, model_task_begin, (__itt_model_task *task, __itt_model_task_instance *instance, const char *name))
  996. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  997. ITT_STUBV(ITTAPI, void, model_task_beginW, (const wchar_t *name))
  998. ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name))
  999. #endif
  1000. ITT_STUBV(ITTAPI, void, model_task_beginA, (const char *name))
  1001. ITT_STUBV(ITTAPI, void, model_task_beginAL, (const char *name, size_t taskNameLen))
  1002. ITT_STUBV(ITTAPI, void, model_iteration_taskA, (const char *name))
  1003. ITT_STUBV(ITTAPI, void, model_iteration_taskAL, (const char *name, size_t taskNameLen))
  1004. ITT_STUBV(ITTAPI, void, model_task_end, (__itt_model_task *task, __itt_model_task_instance *instance))
  1005. ITT_STUBV(ITTAPI, void, model_task_end_2, (void))
  1006. #define __itt_model_task_begin ITTNOTIFY_VOID(model_task_begin)
  1007. #define __itt_model_task_begin_ptr ITTNOTIFY_NAME(model_task_begin)
  1008. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1009. #define __itt_model_task_beginW ITTNOTIFY_VOID(model_task_beginW)
  1010. #define __itt_model_task_beginW_ptr ITTNOTIFY_NAME(model_task_beginW)
  1011. #define __itt_model_iteration_taskW ITTNOTIFY_VOID(model_iteration_taskW)
  1012. #define __itt_model_iteration_taskW_ptr ITTNOTIFY_NAME(model_iteration_taskW)
  1013. #endif
  1014. #define __itt_model_task_beginA ITTNOTIFY_VOID(model_task_beginA)
  1015. #define __itt_model_task_beginA_ptr ITTNOTIFY_NAME(model_task_beginA)
  1016. #define __itt_model_task_beginAL ITTNOTIFY_VOID(model_task_beginAL)
  1017. #define __itt_model_task_beginAL_ptr ITTNOTIFY_NAME(model_task_beginAL)
  1018. #define __itt_model_iteration_taskA ITTNOTIFY_VOID(model_iteration_taskA)
  1019. #define __itt_model_iteration_taskA_ptr ITTNOTIFY_NAME(model_iteration_taskA)
  1020. #define __itt_model_iteration_taskAL ITTNOTIFY_VOID(model_iteration_taskAL)
  1021. #define __itt_model_iteration_taskAL_ptr ITTNOTIFY_NAME(model_iteration_taskAL)
  1022. #define __itt_model_task_end ITTNOTIFY_VOID(model_task_end)
  1023. #define __itt_model_task_end_ptr ITTNOTIFY_NAME(model_task_end)
  1024. #define __itt_model_task_end_2 ITTNOTIFY_VOID(model_task_end_2)
  1025. #define __itt_model_task_end_2_ptr ITTNOTIFY_NAME(model_task_end_2)
  1026. #else /* INTEL_NO_ITTNOTIFY_API */
  1027. #define __itt_model_task_begin(task, instance, name)
  1028. #define __itt_model_task_begin_ptr 0
  1029. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1030. #define __itt_model_task_beginW(name)
  1031. #define __itt_model_task_beginW_ptr 0
  1032. #endif
  1033. #define __itt_model_task_beginA(name)
  1034. #define __itt_model_task_beginA_ptr 0
  1035. #define __itt_model_task_beginAL(name, siteNameLen)
  1036. #define __itt_model_task_beginAL_ptr 0
  1037. #define __itt_model_iteration_taskA(name)
  1038. #define __itt_model_iteration_taskA_ptr 0
  1039. #define __itt_model_iteration_taskAL(name, siteNameLen)
  1040. #define __itt_model_iteration_taskAL_ptr 0
  1041. #define __itt_model_task_end(task, instance)
  1042. #define __itt_model_task_end_ptr 0
  1043. #define __itt_model_task_end_2()
  1044. #define __itt_model_task_end_2_ptr 0
  1045. #endif /* INTEL_NO_ITTNOTIFY_API */
  1046. #else /* INTEL_NO_MACRO_BODY */
  1047. #define __itt_model_task_begin_ptr 0
  1048. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1049. #define __itt_model_task_beginW_ptr 0
  1050. #endif
  1051. #define __itt_model_task_beginA_ptr 0
  1052. #define __itt_model_task_beginAL_ptr 0
  1053. #define __itt_model_iteration_taskA_ptr 0
  1054. #define __itt_model_iteration_taskAL_ptr 0
  1055. #define __itt_model_task_end_ptr 0
  1056. #define __itt_model_task_end_2_ptr 0
  1057. #endif /* INTEL_NO_MACRO_BODY */
  1058. /** @endcond */
  1059. /**
  1060. * @brief ANNOTATE_LOCK_ACQUIRE/ANNOTATE_LOCK_RELEASE support
  1061. *
  1062. * lock_acquire/release model a potential lock for both lockset and
  1063. * performance modeling. Each unique address is modeled as a separate
  1064. * lock, with invalid addresses being valid lock IDs. Specifically:
  1065. * no storage is accessed by the API at the specified address - it is only
  1066. * used for lock identification. Lock acquires may be self-nested and are
  1067. * unlocked by a corresponding number of releases.
  1068. * (These closely correspond to __itt_sync_acquired/__itt_sync_releasing,
  1069. * but may not have identical semantics.)
  1070. */
  1071. void ITTAPI __itt_model_lock_acquire(void *lock);
  1072. void ITTAPI __itt_model_lock_acquire_2(void *lock);
  1073. void ITTAPI __itt_model_lock_release(void *lock);
  1074. void ITTAPI __itt_model_lock_release_2(void *lock);
  1075. /** @cond exclude_from_documentation */
  1076. #ifndef INTEL_NO_MACRO_BODY
  1077. #ifndef INTEL_NO_ITTNOTIFY_API
  1078. ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock))
  1079. ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock))
  1080. ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock))
  1081. ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock))
  1082. #define __itt_model_lock_acquire ITTNOTIFY_VOID(model_lock_acquire)
  1083. #define __itt_model_lock_acquire_ptr ITTNOTIFY_NAME(model_lock_acquire)
  1084. #define __itt_model_lock_acquire_2 ITTNOTIFY_VOID(model_lock_acquire_2)
  1085. #define __itt_model_lock_acquire_2_ptr ITTNOTIFY_NAME(model_lock_acquire_2)
  1086. #define __itt_model_lock_release ITTNOTIFY_VOID(model_lock_release)
  1087. #define __itt_model_lock_release_ptr ITTNOTIFY_NAME(model_lock_release)
  1088. #define __itt_model_lock_release_2 ITTNOTIFY_VOID(model_lock_release_2)
  1089. #define __itt_model_lock_release_2_ptr ITTNOTIFY_NAME(model_lock_release_2)
  1090. #else /* INTEL_NO_ITTNOTIFY_API */
  1091. #define __itt_model_lock_acquire(lock)
  1092. #define __itt_model_lock_acquire_ptr 0
  1093. #define __itt_model_lock_acquire_2(lock)
  1094. #define __itt_model_lock_acquire_2_ptr 0
  1095. #define __itt_model_lock_release(lock)
  1096. #define __itt_model_lock_release_ptr 0
  1097. #define __itt_model_lock_release_2(lock)
  1098. #define __itt_model_lock_release_2_ptr 0
  1099. #endif /* INTEL_NO_ITTNOTIFY_API */
  1100. #else /* INTEL_NO_MACRO_BODY */
  1101. #define __itt_model_lock_acquire_ptr 0
  1102. #define __itt_model_lock_acquire_2_ptr 0
  1103. #define __itt_model_lock_release_ptr 0
  1104. #define __itt_model_lock_release_2_ptr 0
  1105. #endif /* INTEL_NO_MACRO_BODY */
  1106. /** @endcond */
  1107. /**
  1108. * @brief ANNOTATE_RECORD_ALLOCATION/ANNOTATE_RECORD_DEALLOCATION support
  1109. *
  1110. * record_allocation/deallocation describe user-defined memory allocator
  1111. * behavior, which may be required for correctness modeling to understand
  1112. * when storage is not expected to be actually reused across threads.
  1113. */
  1114. void ITTAPI __itt_model_record_allocation (void *addr, size_t size);
  1115. void ITTAPI __itt_model_record_deallocation(void *addr);
  1116. /** @cond exclude_from_documentation */
  1117. #ifndef INTEL_NO_MACRO_BODY
  1118. #ifndef INTEL_NO_ITTNOTIFY_API
  1119. ITT_STUBV(ITTAPI, void, model_record_allocation, (void *addr, size_t size))
  1120. ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr))
  1121. #define __itt_model_record_allocation ITTNOTIFY_VOID(model_record_allocation)
  1122. #define __itt_model_record_allocation_ptr ITTNOTIFY_NAME(model_record_allocation)
  1123. #define __itt_model_record_deallocation ITTNOTIFY_VOID(model_record_deallocation)
  1124. #define __itt_model_record_deallocation_ptr ITTNOTIFY_NAME(model_record_deallocation)
  1125. #else /* INTEL_NO_ITTNOTIFY_API */
  1126. #define __itt_model_record_allocation(addr, size)
  1127. #define __itt_model_record_allocation_ptr 0
  1128. #define __itt_model_record_deallocation(addr)
  1129. #define __itt_model_record_deallocation_ptr 0
  1130. #endif /* INTEL_NO_ITTNOTIFY_API */
  1131. #else /* INTEL_NO_MACRO_BODY */
  1132. #define __itt_model_record_allocation_ptr 0
  1133. #define __itt_model_record_deallocation_ptr 0
  1134. #endif /* INTEL_NO_MACRO_BODY */
  1135. /** @endcond */
  1136. /**
  1137. * @brief ANNOTATE_INDUCTION_USES support
  1138. *
  1139. * Note particular storage is inductive through the end of the current site
  1140. */
  1141. void ITTAPI __itt_model_induction_uses(void* addr, size_t size);
  1142. /** @cond exclude_from_documentation */
  1143. #ifndef INTEL_NO_MACRO_BODY
  1144. #ifndef INTEL_NO_ITTNOTIFY_API
  1145. ITT_STUBV(ITTAPI, void, model_induction_uses, (void *addr, size_t size))
  1146. #define __itt_model_induction_uses ITTNOTIFY_VOID(model_induction_uses)
  1147. #define __itt_model_induction_uses_ptr ITTNOTIFY_NAME(model_induction_uses)
  1148. #else /* INTEL_NO_ITTNOTIFY_API */
  1149. #define __itt_model_induction_uses(addr, size)
  1150. #define __itt_model_induction_uses_ptr 0
  1151. #endif /* INTEL_NO_ITTNOTIFY_API */
  1152. #else /* INTEL_NO_MACRO_BODY */
  1153. #define __itt_model_induction_uses_ptr 0
  1154. #endif /* INTEL_NO_MACRO_BODY */
  1155. /** @endcond */
  1156. /**
  1157. * @brief ANNOTATE_REDUCTION_USES support
  1158. *
  1159. * Note particular storage is used for reduction through the end
  1160. * of the current site
  1161. */
  1162. void ITTAPI __itt_model_reduction_uses(void* addr, size_t size);
  1163. /** @cond exclude_from_documentation */
  1164. #ifndef INTEL_NO_MACRO_BODY
  1165. #ifndef INTEL_NO_ITTNOTIFY_API
  1166. ITT_STUBV(ITTAPI, void, model_reduction_uses, (void *addr, size_t size))
  1167. #define __itt_model_reduction_uses ITTNOTIFY_VOID(model_reduction_uses)
  1168. #define __itt_model_reduction_uses_ptr ITTNOTIFY_NAME(model_reduction_uses)
  1169. #else /* INTEL_NO_ITTNOTIFY_API */
  1170. #define __itt_model_reduction_uses(addr, size)
  1171. #define __itt_model_reduction_uses_ptr 0
  1172. #endif /* INTEL_NO_ITTNOTIFY_API */
  1173. #else /* INTEL_NO_MACRO_BODY */
  1174. #define __itt_model_reduction_uses_ptr 0
  1175. #endif /* INTEL_NO_MACRO_BODY */
  1176. /** @endcond */
  1177. /**
  1178. * @brief ANNOTATE_OBSERVE_USES support
  1179. *
  1180. * Have correctness modeling record observations about uses of storage
  1181. * through the end of the current site
  1182. */
  1183. void ITTAPI __itt_model_observe_uses(void* addr, size_t size);
  1184. /** @cond exclude_from_documentation */
  1185. #ifndef INTEL_NO_MACRO_BODY
  1186. #ifndef INTEL_NO_ITTNOTIFY_API
  1187. ITT_STUBV(ITTAPI, void, model_observe_uses, (void *addr, size_t size))
  1188. #define __itt_model_observe_uses ITTNOTIFY_VOID(model_observe_uses)
  1189. #define __itt_model_observe_uses_ptr ITTNOTIFY_NAME(model_observe_uses)
  1190. #else /* INTEL_NO_ITTNOTIFY_API */
  1191. #define __itt_model_observe_uses(addr, size)
  1192. #define __itt_model_observe_uses_ptr 0
  1193. #endif /* INTEL_NO_ITTNOTIFY_API */
  1194. #else /* INTEL_NO_MACRO_BODY */
  1195. #define __itt_model_observe_uses_ptr 0
  1196. #endif /* INTEL_NO_MACRO_BODY */
  1197. /** @endcond */
  1198. /**
  1199. * @brief ANNOTATE_CLEAR_USES support
  1200. *
  1201. * Clear the special handling of a piece of storage related to induction,
  1202. * reduction or observe_uses
  1203. */
  1204. void ITTAPI __itt_model_clear_uses(void* addr);
  1205. /** @cond exclude_from_documentation */
  1206. #ifndef INTEL_NO_MACRO_BODY
  1207. #ifndef INTEL_NO_ITTNOTIFY_API
  1208. ITT_STUBV(ITTAPI, void, model_clear_uses, (void *addr))
  1209. #define __itt_model_clear_uses ITTNOTIFY_VOID(model_clear_uses)
  1210. #define __itt_model_clear_uses_ptr ITTNOTIFY_NAME(model_clear_uses)
  1211. #else /* INTEL_NO_ITTNOTIFY_API */
  1212. #define __itt_model_clear_uses(addr)
  1213. #define __itt_model_clear_uses_ptr 0
  1214. #endif /* INTEL_NO_ITTNOTIFY_API */
  1215. #else /* INTEL_NO_MACRO_BODY */
  1216. #define __itt_model_clear_uses_ptr 0
  1217. #endif /* INTEL_NO_MACRO_BODY */
  1218. /** @endcond */
  1219. /**
  1220. * @brief ANNOTATE_DISABLE_*_PUSH/ANNOTATE_DISABLE_*_POP support
  1221. *
  1222. * disable_push/disable_pop push and pop disabling based on a parameter.
  1223. * Disabling observations stops processing of memory references during
  1224. * correctness modeling, and all annotations that occur in the disabled
  1225. * region. This allows description of code that is expected to be handled
  1226. * specially during conversion to parallelism or that is not recognized
  1227. * by tools (e.g. some kinds of synchronization operations.)
  1228. * This mechanism causes all annotations in the disabled region, other
  1229. * than disable_push and disable_pop, to be ignored. (For example, this
  1230. * might validly be used to disable an entire parallel site and the contained
  1231. * tasks and locking in it for data collection purposes.)
  1232. * The disable for collection is a more expensive operation, but reduces
  1233. * collector overhead significantly. This applies to BOTH correctness data
  1234. * collection and performance data collection. For example, a site
  1235. * containing a task might only enable data collection for the first 10
  1236. * iterations. Both performance and correctness data should reflect this,
  1237. * and the program should run as close to full speed as possible when
  1238. * collection is disabled.
  1239. */
  1240. void ITTAPI __itt_model_disable_push(__itt_model_disable x);
  1241. void ITTAPI __itt_model_disable_pop(void);
  1242. void ITTAPI __itt_model_aggregate_task(size_t x);
  1243. /** @cond exclude_from_documentation */
  1244. #ifndef INTEL_NO_MACRO_BODY
  1245. #ifndef INTEL_NO_ITTNOTIFY_API
  1246. ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x))
  1247. ITT_STUBV(ITTAPI, void, model_disable_pop, (void))
  1248. ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t x))
  1249. #define __itt_model_disable_push ITTNOTIFY_VOID(model_disable_push)
  1250. #define __itt_model_disable_push_ptr ITTNOTIFY_NAME(model_disable_push)
  1251. #define __itt_model_disable_pop ITTNOTIFY_VOID(model_disable_pop)
  1252. #define __itt_model_disable_pop_ptr ITTNOTIFY_NAME(model_disable_pop)
  1253. #define __itt_model_aggregate_task ITTNOTIFY_VOID(model_aggregate_task)
  1254. #define __itt_model_aggregate_task_ptr ITTNOTIFY_NAME(model_aggregate_task)
  1255. #else /* INTEL_NO_ITTNOTIFY_API */
  1256. #define __itt_model_disable_push(x)
  1257. #define __itt_model_disable_push_ptr 0
  1258. #define __itt_model_disable_pop()
  1259. #define __itt_model_disable_pop_ptr 0
  1260. #define __itt_model_aggregate_task(x)
  1261. #define __itt_model_aggregate_task_ptr 0
  1262. #endif /* INTEL_NO_ITTNOTIFY_API */
  1263. #else /* INTEL_NO_MACRO_BODY */
  1264. #define __itt_model_disable_push_ptr 0
  1265. #define __itt_model_disable_pop_ptr 0
  1266. #define __itt_model_aggregate_task_ptr 0
  1267. #endif /* INTEL_NO_MACRO_BODY */
  1268. /** @endcond */
  1269. /** @} model group */
  1270. /**
  1271. * @defgroup heap Heap
  1272. * @ingroup public
  1273. * Heap group
  1274. * @{
  1275. */
  1276. typedef void* __itt_heap_function;
  1277. /**
  1278. * @brief Create an identification for heap function
  1279. * @return non-zero identifier or NULL
  1280. */
  1281. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1282. __itt_heap_function ITTAPI __itt_heap_function_createA(const char* name, const char* domain);
  1283. __itt_heap_function ITTAPI __itt_heap_function_createW(const wchar_t* name, const wchar_t* domain);
  1284. #if defined(UNICODE) || defined(_UNICODE)
  1285. # define __itt_heap_function_create __itt_heap_function_createW
  1286. # define __itt_heap_function_create_ptr __itt_heap_function_createW_ptr
  1287. #else
  1288. # define __itt_heap_function_create __itt_heap_function_createA
  1289. # define __itt_heap_function_create_ptr __itt_heap_function_createA_ptr
  1290. #endif /* UNICODE */
  1291. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1292. __itt_heap_function ITTAPI __itt_heap_function_create(const char* name, const char* domain);
  1293. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1294. /** @cond exclude_from_documentation */
  1295. #ifndef INTEL_NO_MACRO_BODY
  1296. #ifndef INTEL_NO_ITTNOTIFY_API
  1297. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1298. ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA, (const char* name, const char* domain))
  1299. ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW, (const wchar_t* name, const wchar_t* domain))
  1300. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1301. ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create, (const char* name, const char* domain))
  1302. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1303. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1304. #define __itt_heap_function_createA ITTNOTIFY_DATA(heap_function_createA)
  1305. #define __itt_heap_function_createA_ptr ITTNOTIFY_NAME(heap_function_createA)
  1306. #define __itt_heap_function_createW ITTNOTIFY_DATA(heap_function_createW)
  1307. #define __itt_heap_function_createW_ptr ITTNOTIFY_NAME(heap_function_createW)
  1308. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1309. #define __itt_heap_function_create ITTNOTIFY_DATA(heap_function_create)
  1310. #define __itt_heap_function_create_ptr ITTNOTIFY_NAME(heap_function_create)
  1311. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1312. #else /* INTEL_NO_ITTNOTIFY_API */
  1313. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1314. #define __itt_heap_function_createA(name, domain) (__itt_heap_function)0
  1315. #define __itt_heap_function_createA_ptr 0
  1316. #define __itt_heap_function_createW(name, domain) (__itt_heap_function)0
  1317. #define __itt_heap_function_createW_ptr 0
  1318. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1319. #define __itt_heap_function_create(name, domain) (__itt_heap_function)0
  1320. #define __itt_heap_function_create_ptr 0
  1321. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1322. #endif /* INTEL_NO_ITTNOTIFY_API */
  1323. #else /* INTEL_NO_MACRO_BODY */
  1324. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1325. #define __itt_heap_function_createA_ptr 0
  1326. #define __itt_heap_function_createW_ptr 0
  1327. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1328. #define __itt_heap_function_create_ptr 0
  1329. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1330. #endif /* INTEL_NO_MACRO_BODY */
  1331. /** @endcond */
  1332. /**
  1333. * @brief Record an allocation begin occurrence.
  1334. */
  1335. void ITTAPI __itt_heap_allocate_begin(__itt_heap_function h, size_t size, int initialized);
  1336. /** @cond exclude_from_documentation */
  1337. #ifndef INTEL_NO_MACRO_BODY
  1338. #ifndef INTEL_NO_ITTNOTIFY_API
  1339. ITT_STUBV(ITTAPI, void, heap_allocate_begin, (__itt_heap_function h, size_t size, int initialized))
  1340. #define __itt_heap_allocate_begin ITTNOTIFY_VOID(heap_allocate_begin)
  1341. #define __itt_heap_allocate_begin_ptr ITTNOTIFY_NAME(heap_allocate_begin)
  1342. #else /* INTEL_NO_ITTNOTIFY_API */
  1343. #define __itt_heap_allocate_begin(h, size, initialized)
  1344. #define __itt_heap_allocate_begin_ptr 0
  1345. #endif /* INTEL_NO_ITTNOTIFY_API */
  1346. #else /* INTEL_NO_MACRO_BODY */
  1347. #define __itt_heap_allocate_begin_ptr 0
  1348. #endif /* INTEL_NO_MACRO_BODY */
  1349. /** @endcond */
  1350. /**
  1351. * @brief Record an allocation end occurrence.
  1352. */
  1353. void ITTAPI __itt_heap_allocate_end(__itt_heap_function h, void** addr, size_t size, int initialized);
  1354. /** @cond exclude_from_documentation */
  1355. #ifndef INTEL_NO_MACRO_BODY
  1356. #ifndef INTEL_NO_ITTNOTIFY_API
  1357. ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr, size_t size, int initialized))
  1358. #define __itt_heap_allocate_end ITTNOTIFY_VOID(heap_allocate_end)
  1359. #define __itt_heap_allocate_end_ptr ITTNOTIFY_NAME(heap_allocate_end)
  1360. #else /* INTEL_NO_ITTNOTIFY_API */
  1361. #define __itt_heap_allocate_end(h, addr, size, initialized)
  1362. #define __itt_heap_allocate_end_ptr 0
  1363. #endif /* INTEL_NO_ITTNOTIFY_API */
  1364. #else /* INTEL_NO_MACRO_BODY */
  1365. #define __itt_heap_allocate_end_ptr 0
  1366. #endif /* INTEL_NO_MACRO_BODY */
  1367. /** @endcond */
  1368. /**
  1369. * @brief Record an free begin occurrence.
  1370. */
  1371. void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void* addr);
  1372. /** @cond exclude_from_documentation */
  1373. #ifndef INTEL_NO_MACRO_BODY
  1374. #ifndef INTEL_NO_ITTNOTIFY_API
  1375. ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr))
  1376. #define __itt_heap_free_begin ITTNOTIFY_VOID(heap_free_begin)
  1377. #define __itt_heap_free_begin_ptr ITTNOTIFY_NAME(heap_free_begin)
  1378. #else /* INTEL_NO_ITTNOTIFY_API */
  1379. #define __itt_heap_free_begin(h, addr)
  1380. #define __itt_heap_free_begin_ptr 0
  1381. #endif /* INTEL_NO_ITTNOTIFY_API */
  1382. #else /* INTEL_NO_MACRO_BODY */
  1383. #define __itt_heap_free_begin_ptr 0
  1384. #endif /* INTEL_NO_MACRO_BODY */
  1385. /** @endcond */
  1386. /**
  1387. * @brief Record an free end occurrence.
  1388. */
  1389. void ITTAPI __itt_heap_free_end(__itt_heap_function h, void* addr);
  1390. /** @cond exclude_from_documentation */
  1391. #ifndef INTEL_NO_MACRO_BODY
  1392. #ifndef INTEL_NO_ITTNOTIFY_API
  1393. ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr))
  1394. #define __itt_heap_free_end ITTNOTIFY_VOID(heap_free_end)
  1395. #define __itt_heap_free_end_ptr ITTNOTIFY_NAME(heap_free_end)
  1396. #else /* INTEL_NO_ITTNOTIFY_API */
  1397. #define __itt_heap_free_end(h, addr)
  1398. #define __itt_heap_free_end_ptr 0
  1399. #endif /* INTEL_NO_ITTNOTIFY_API */
  1400. #else /* INTEL_NO_MACRO_BODY */
  1401. #define __itt_heap_free_end_ptr 0
  1402. #endif /* INTEL_NO_MACRO_BODY */
  1403. /** @endcond */
  1404. /**
  1405. * @brief Record an reallocation begin occurrence.
  1406. */
  1407. void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void* addr, size_t new_size, int initialized);
  1408. /** @cond exclude_from_documentation */
  1409. #ifndef INTEL_NO_MACRO_BODY
  1410. #ifndef INTEL_NO_ITTNOTIFY_API
  1411. ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* addr, size_t new_size, int initialized))
  1412. #define __itt_heap_reallocate_begin ITTNOTIFY_VOID(heap_reallocate_begin)
  1413. #define __itt_heap_reallocate_begin_ptr ITTNOTIFY_NAME(heap_reallocate_begin)
  1414. #else /* INTEL_NO_ITTNOTIFY_API */
  1415. #define __itt_heap_reallocate_begin(h, addr, new_size, initialized)
  1416. #define __itt_heap_reallocate_begin_ptr 0
  1417. #endif /* INTEL_NO_ITTNOTIFY_API */
  1418. #else /* INTEL_NO_MACRO_BODY */
  1419. #define __itt_heap_reallocate_begin_ptr 0
  1420. #endif /* INTEL_NO_MACRO_BODY */
  1421. /** @endcond */
  1422. /**
  1423. * @brief Record an reallocation end occurrence.
  1424. */
  1425. void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized);
  1426. /** @cond exclude_from_documentation */
  1427. #ifndef INTEL_NO_MACRO_BODY
  1428. #ifndef INTEL_NO_ITTNOTIFY_API
  1429. ITT_STUBV(ITTAPI, void, heap_reallocate_end, (__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized))
  1430. #define __itt_heap_reallocate_end ITTNOTIFY_VOID(heap_reallocate_end)
  1431. #define __itt_heap_reallocate_end_ptr ITTNOTIFY_NAME(heap_reallocate_end)
  1432. #else /* INTEL_NO_ITTNOTIFY_API */
  1433. #define __itt_heap_reallocate_end(h, addr, new_addr, new_size, initialized)
  1434. #define __itt_heap_reallocate_end_ptr 0
  1435. #endif /* INTEL_NO_ITTNOTIFY_API */
  1436. #else /* INTEL_NO_MACRO_BODY */
  1437. #define __itt_heap_reallocate_end_ptr 0
  1438. #endif /* INTEL_NO_MACRO_BODY */
  1439. /** @endcond */
  1440. /** @brief internal access begin */
  1441. void ITTAPI __itt_heap_internal_access_begin(void);
  1442. /** @cond exclude_from_documentation */
  1443. #ifndef INTEL_NO_MACRO_BODY
  1444. #ifndef INTEL_NO_ITTNOTIFY_API
  1445. ITT_STUBV(ITTAPI, void, heap_internal_access_begin, (void))
  1446. #define __itt_heap_internal_access_begin ITTNOTIFY_VOID(heap_internal_access_begin)
  1447. #define __itt_heap_internal_access_begin_ptr ITTNOTIFY_NAME(heap_internal_access_begin)
  1448. #else /* INTEL_NO_ITTNOTIFY_API */
  1449. #define __itt_heap_internal_access_begin()
  1450. #define __itt_heap_internal_access_begin_ptr 0
  1451. #endif /* INTEL_NO_ITTNOTIFY_API */
  1452. #else /* INTEL_NO_MACRO_BODY */
  1453. #define __itt_heap_internal_access_begin_ptr 0
  1454. #endif /* INTEL_NO_MACRO_BODY */
  1455. /** @endcond */
  1456. /** @brief internal access end */
  1457. void ITTAPI __itt_heap_internal_access_end(void);
  1458. /** @cond exclude_from_documentation */
  1459. #ifndef INTEL_NO_MACRO_BODY
  1460. #ifndef INTEL_NO_ITTNOTIFY_API
  1461. ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void))
  1462. #define __itt_heap_internal_access_end ITTNOTIFY_VOID(heap_internal_access_end)
  1463. #define __itt_heap_internal_access_end_ptr ITTNOTIFY_NAME(heap_internal_access_end)
  1464. #else /* INTEL_NO_ITTNOTIFY_API */
  1465. #define __itt_heap_internal_access_end()
  1466. #define __itt_heap_internal_access_end_ptr 0
  1467. #endif /* INTEL_NO_ITTNOTIFY_API */
  1468. #else /* INTEL_NO_MACRO_BODY */
  1469. #define __itt_heap_internal_access_end_ptr 0
  1470. #endif /* INTEL_NO_MACRO_BODY */
  1471. /** @endcond */
  1472. /** @brief record memory growth begin */
  1473. void ITTAPI __itt_heap_record_memory_growth_begin(void);
  1474. /** @cond exclude_from_documentation */
  1475. #ifndef INTEL_NO_MACRO_BODY
  1476. #ifndef INTEL_NO_ITTNOTIFY_API
  1477. ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin, (void))
  1478. #define __itt_heap_record_memory_growth_begin ITTNOTIFY_VOID(heap_record_memory_growth_begin)
  1479. #define __itt_heap_record_memory_growth_begin_ptr ITTNOTIFY_NAME(heap_record_memory_growth_begin)
  1480. #else /* INTEL_NO_ITTNOTIFY_API */
  1481. #define __itt_heap_record_memory_growth_begin()
  1482. #define __itt_heap_record_memory_growth_begin_ptr 0
  1483. #endif /* INTEL_NO_ITTNOTIFY_API */
  1484. #else /* INTEL_NO_MACRO_BODY */
  1485. #define __itt_heap_record_memory_growth_begin_ptr 0
  1486. #endif /* INTEL_NO_MACRO_BODY */
  1487. /** @endcond */
  1488. /** @brief record memory growth end */
  1489. void ITTAPI __itt_heap_record_memory_growth_end(void);
  1490. /** @cond exclude_from_documentation */
  1491. #ifndef INTEL_NO_MACRO_BODY
  1492. #ifndef INTEL_NO_ITTNOTIFY_API
  1493. ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void))
  1494. #define __itt_heap_record_memory_growth_end ITTNOTIFY_VOID(heap_record_memory_growth_end)
  1495. #define __itt_heap_record_memory_growth_end_ptr ITTNOTIFY_NAME(heap_record_memory_growth_end)
  1496. #else /* INTEL_NO_ITTNOTIFY_API */
  1497. #define __itt_heap_record_memory_growth_end()
  1498. #define __itt_heap_record_memory_growth_end_ptr 0
  1499. #endif /* INTEL_NO_ITTNOTIFY_API */
  1500. #else /* INTEL_NO_MACRO_BODY */
  1501. #define __itt_heap_record_memory_growth_end_ptr 0
  1502. #endif /* INTEL_NO_MACRO_BODY */
  1503. /** @endcond */
  1504. /**
  1505. * @brief Specify the type of heap detection/reporting to modify.
  1506. */
  1507. /**
  1508. * @hideinitializer
  1509. * @brief Report on memory leaks.
  1510. */
  1511. #define __itt_heap_leaks 0x00000001
  1512. /**
  1513. * @hideinitializer
  1514. * @brief Report on memory growth.
  1515. */
  1516. #define __itt_heap_growth 0x00000002
  1517. /** @brief heap reset detection */
  1518. void ITTAPI __itt_heap_reset_detection(unsigned int reset_mask);
  1519. /** @cond exclude_from_documentation */
  1520. #ifndef INTEL_NO_MACRO_BODY
  1521. #ifndef INTEL_NO_ITTNOTIFY_API
  1522. ITT_STUBV(ITTAPI, void, heap_reset_detection, (unsigned int reset_mask))
  1523. #define __itt_heap_reset_detection ITTNOTIFY_VOID(heap_reset_detection)
  1524. #define __itt_heap_reset_detection_ptr ITTNOTIFY_NAME(heap_reset_detection)
  1525. #else /* INTEL_NO_ITTNOTIFY_API */
  1526. #define __itt_heap_reset_detection()
  1527. #define __itt_heap_reset_detection_ptr 0
  1528. #endif /* INTEL_NO_ITTNOTIFY_API */
  1529. #else /* INTEL_NO_MACRO_BODY */
  1530. #define __itt_heap_reset_detection_ptr 0
  1531. #endif /* INTEL_NO_MACRO_BODY */
  1532. /** @endcond */
  1533. /** @brief report */
  1534. void ITTAPI __itt_heap_record(unsigned int record_mask);
  1535. /** @cond exclude_from_documentation */
  1536. #ifndef INTEL_NO_MACRO_BODY
  1537. #ifndef INTEL_NO_ITTNOTIFY_API
  1538. ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask))
  1539. #define __itt_heap_record ITTNOTIFY_VOID(heap_record)
  1540. #define __itt_heap_record_ptr ITTNOTIFY_NAME(heap_record)
  1541. #else /* INTEL_NO_ITTNOTIFY_API */
  1542. #define __itt_heap_record()
  1543. #define __itt_heap_record_ptr 0
  1544. #endif /* INTEL_NO_ITTNOTIFY_API */
  1545. #else /* INTEL_NO_MACRO_BODY */
  1546. #define __itt_heap_record_ptr 0
  1547. #endif /* INTEL_NO_MACRO_BODY */
  1548. /** @endcond */
  1549. /** @} heap group */
  1550. /** @endcond */
  1551. /* ========================================================================== */
  1552. /**
  1553. * @defgroup domains Domains
  1554. * @ingroup public
  1555. * Domains group
  1556. * @{
  1557. */
  1558. /** @cond exclude_from_documentation */
  1559. #pragma pack(push, 8)
  1560. typedef struct ___itt_domain
  1561. {
  1562. volatile int flags; /*!< Zero if disabled, non-zero if enabled. The meaning of different non-zero values is reserved to the runtime */
  1563. const char* nameA; /*!< Copy of original name in ASCII. */
  1564. #if defined(UNICODE) || defined(_UNICODE)
  1565. const wchar_t* nameW; /*!< Copy of original name in UNICODE. */
  1566. #else /* UNICODE || _UNICODE */
  1567. void* nameW;
  1568. #endif /* UNICODE || _UNICODE */
  1569. int extra1; /*!< Reserved to the runtime */
  1570. void* extra2; /*!< Reserved to the runtime */
  1571. struct ___itt_domain* next;
  1572. } __itt_domain;
  1573. #pragma pack(pop)
  1574. /** @endcond */
  1575. /**
  1576. * @ingroup domains
  1577. * @brief Create a domain.
  1578. * Create domain using some domain name: the URI naming style is recommended.
  1579. * Because the set of domains is expected to be static over the application's
  1580. * execution time, there is no mechanism to destroy a domain.
  1581. * Any domain can be accessed by any thread in the process, regardless of
  1582. * which thread created the domain. This call is thread-safe.
  1583. * @param[in] name name of domain
  1584. */
  1585. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1586. __itt_domain* ITTAPI __itt_domain_createA(const char *name);
  1587. __itt_domain* ITTAPI __itt_domain_createW(const wchar_t *name);
  1588. #if defined(UNICODE) || defined(_UNICODE)
  1589. # define __itt_domain_create __itt_domain_createW
  1590. # define __itt_domain_create_ptr __itt_domain_createW_ptr
  1591. #else /* UNICODE */
  1592. # define __itt_domain_create __itt_domain_createA
  1593. # define __itt_domain_create_ptr __itt_domain_createA_ptr
  1594. #endif /* UNICODE */
  1595. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1596. __itt_domain* ITTAPI __itt_domain_create(const char *name);
  1597. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1598. /** @cond exclude_from_documentation */
  1599. #ifndef INTEL_NO_MACRO_BODY
  1600. #ifndef INTEL_NO_ITTNOTIFY_API
  1601. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1602. ITT_STUB(ITTAPI, __itt_domain*, domain_createA, (const char *name))
  1603. ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name))
  1604. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1605. ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name))
  1606. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1607. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1608. #define __itt_domain_createA ITTNOTIFY_DATA(domain_createA)
  1609. #define __itt_domain_createA_ptr ITTNOTIFY_NAME(domain_createA)
  1610. #define __itt_domain_createW ITTNOTIFY_DATA(domain_createW)
  1611. #define __itt_domain_createW_ptr ITTNOTIFY_NAME(domain_createW)
  1612. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1613. #define __itt_domain_create ITTNOTIFY_DATA(domain_create)
  1614. #define __itt_domain_create_ptr ITTNOTIFY_NAME(domain_create)
  1615. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1616. #else /* INTEL_NO_ITTNOTIFY_API */
  1617. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1618. #define __itt_domain_createA(name) (__itt_domain*)0
  1619. #define __itt_domain_createA_ptr 0
  1620. #define __itt_domain_createW(name) (__itt_domain*)0
  1621. #define __itt_domain_createW_ptr 0
  1622. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1623. #define __itt_domain_create(name) (__itt_domain*)0
  1624. #define __itt_domain_create_ptr 0
  1625. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1626. #endif /* INTEL_NO_ITTNOTIFY_API */
  1627. #else /* INTEL_NO_MACRO_BODY */
  1628. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1629. #define __itt_domain_createA_ptr 0
  1630. #define __itt_domain_createW_ptr 0
  1631. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1632. #define __itt_domain_create_ptr 0
  1633. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1634. #endif /* INTEL_NO_MACRO_BODY */
  1635. /** @endcond */
  1636. /** @} domains group */
  1637. /**
  1638. * @defgroup ids IDs
  1639. * @ingroup public
  1640. * IDs group
  1641. * @{
  1642. */
  1643. /** @cond exclude_from_documentation */
  1644. #pragma pack(push, 8)
  1645. typedef struct ___itt_id
  1646. {
  1647. unsigned long long d1, d2, d3;
  1648. } __itt_id;
  1649. #pragma pack(pop)
  1650. /** @endcond */
  1651. static const __itt_id __itt_null = { 0, 0, 0 };
  1652. /**
  1653. * @ingroup ids
  1654. * @brief A convenience function is provided to create an ID without domain control.
  1655. * @brief This is a convenience function to initialize an __itt_id structure. This function
  1656. * does not affect the collector runtime in any way. After you make the ID with this
  1657. * function, you still must create it with the __itt_id_create function before using the ID
  1658. * to identify a named entity.
  1659. * @param[in] addr The address of object; high QWORD of the ID value.
  1660. * @param[in] extra The extra data to unique identify object; low QWORD of the ID value.
  1661. */
  1662. ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra) ITT_INLINE_ATTRIBUTE;
  1663. ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra)
  1664. {
  1665. __itt_id id = __itt_null;
  1666. id.d1 = (unsigned long long)((uintptr_t)addr);
  1667. id.d2 = (unsigned long long)extra;
  1668. id.d3 = (unsigned long long)0; /* Reserved. Must be zero */
  1669. return id;
  1670. }
  1671. /**
  1672. * @ingroup ids
  1673. * @brief Create an instance of identifier.
  1674. * This establishes the beginning of the lifetime of an instance of
  1675. * the given ID in the trace. Once this lifetime starts, the ID
  1676. * can be used to tag named entity instances in calls such as
  1677. * __itt_task_begin, and to specify relationships among
  1678. * identified named entity instances, using the \ref relations APIs.
  1679. * Instance IDs are not domain specific!
  1680. * @param[in] domain The domain controlling the execution of this call.
  1681. * @param[in] id The ID to create.
  1682. */
  1683. void ITTAPI __itt_id_create(const __itt_domain *domain, __itt_id id);
  1684. /** @cond exclude_from_documentation */
  1685. #ifndef INTEL_NO_MACRO_BODY
  1686. #ifndef INTEL_NO_ITTNOTIFY_API
  1687. ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id))
  1688. #define __itt_id_create(d,x) ITTNOTIFY_VOID_D1(id_create,d,x)
  1689. #define __itt_id_create_ptr ITTNOTIFY_NAME(id_create)
  1690. #else /* INTEL_NO_ITTNOTIFY_API */
  1691. #define __itt_id_create(domain,id)
  1692. #define __itt_id_create_ptr 0
  1693. #endif /* INTEL_NO_ITTNOTIFY_API */
  1694. #else /* INTEL_NO_MACRO_BODY */
  1695. #define __itt_id_create_ptr 0
  1696. #endif /* INTEL_NO_MACRO_BODY */
  1697. /** @endcond */
  1698. /**
  1699. * @ingroup ids
  1700. * @brief Destroy an instance of identifier.
  1701. * This ends the lifetime of the current instance of the given ID value in the trace.
  1702. * Any relationships that are established after this lifetime ends are invalid.
  1703. * This call must be performed before the given ID value can be reused for a different
  1704. * named entity instance.
  1705. * @param[in] domain The domain controlling the execution of this call.
  1706. * @param[in] id The ID to destroy.
  1707. */
  1708. void ITTAPI __itt_id_destroy(const __itt_domain *domain, __itt_id id);
  1709. /** @cond exclude_from_documentation */
  1710. #ifndef INTEL_NO_MACRO_BODY
  1711. #ifndef INTEL_NO_ITTNOTIFY_API
  1712. ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id))
  1713. #define __itt_id_destroy(d,x) ITTNOTIFY_VOID_D1(id_destroy,d,x)
  1714. #define __itt_id_destroy_ptr ITTNOTIFY_NAME(id_destroy)
  1715. #else /* INTEL_NO_ITTNOTIFY_API */
  1716. #define __itt_id_destroy(domain,id)
  1717. #define __itt_id_destroy_ptr 0
  1718. #endif /* INTEL_NO_ITTNOTIFY_API */
  1719. #else /* INTEL_NO_MACRO_BODY */
  1720. #define __itt_id_destroy_ptr 0
  1721. #endif /* INTEL_NO_MACRO_BODY */
  1722. /** @endcond */
  1723. /** @} ids group */
  1724. /**
  1725. * @defgroup handless String Handles
  1726. * @ingroup public
  1727. * String Handles group
  1728. * @{
  1729. */
  1730. /** @cond exclude_from_documentation */
  1731. #pragma pack(push, 8)
  1732. typedef struct ___itt_string_handle
  1733. {
  1734. const char* strA; /*!< Copy of original string in ASCII. */
  1735. #if defined(UNICODE) || defined(_UNICODE)
  1736. const wchar_t* strW; /*!< Copy of original string in UNICODE. */
  1737. #else /* UNICODE || _UNICODE */
  1738. void* strW;
  1739. #endif /* UNICODE || _UNICODE */
  1740. int extra1; /*!< Reserved. Must be zero */
  1741. void* extra2; /*!< Reserved. Must be zero */
  1742. struct ___itt_string_handle* next;
  1743. } __itt_string_handle;
  1744. #pragma pack(pop)
  1745. /** @endcond */
  1746. /**
  1747. * @ingroup handles
  1748. * @brief Create a string handle.
  1749. * Create and return handle value that can be associated with a string.
  1750. * Consecutive calls to __itt_string_handle_create with the same name
  1751. * return the same value. Because the set of string handles is expected to remain
  1752. * static during the application's execution time, there is no mechanism to destroy a string handle.
  1753. * Any string handle can be accessed by any thread in the process, regardless of which thread created
  1754. * the string handle. This call is thread-safe.
  1755. * @param[in] name The input string
  1756. */
  1757. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1758. __itt_string_handle* ITTAPI __itt_string_handle_createA(const char *name);
  1759. __itt_string_handle* ITTAPI __itt_string_handle_createW(const wchar_t *name);
  1760. #if defined(UNICODE) || defined(_UNICODE)
  1761. # define __itt_string_handle_create __itt_string_handle_createW
  1762. # define __itt_string_handle_create_ptr __itt_string_handle_createW_ptr
  1763. #else /* UNICODE */
  1764. # define __itt_string_handle_create __itt_string_handle_createA
  1765. # define __itt_string_handle_create_ptr __itt_string_handle_createA_ptr
  1766. #endif /* UNICODE */
  1767. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1768. __itt_string_handle* ITTAPI __itt_string_handle_create(const char *name);
  1769. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1770. /** @cond exclude_from_documentation */
  1771. #ifndef INTEL_NO_MACRO_BODY
  1772. #ifndef INTEL_NO_ITTNOTIFY_API
  1773. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1774. ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name))
  1775. ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name))
  1776. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1777. ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_create, (const char *name))
  1778. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1779. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1780. #define __itt_string_handle_createA ITTNOTIFY_DATA(string_handle_createA)
  1781. #define __itt_string_handle_createA_ptr ITTNOTIFY_NAME(string_handle_createA)
  1782. #define __itt_string_handle_createW ITTNOTIFY_DATA(string_handle_createW)
  1783. #define __itt_string_handle_createW_ptr ITTNOTIFY_NAME(string_handle_createW)
  1784. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1785. #define __itt_string_handle_create ITTNOTIFY_DATA(string_handle_create)
  1786. #define __itt_string_handle_create_ptr ITTNOTIFY_NAME(string_handle_create)
  1787. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1788. #else /* INTEL_NO_ITTNOTIFY_API */
  1789. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1790. #define __itt_string_handle_createA(name) (__itt_string_handle*)0
  1791. #define __itt_string_handle_createA_ptr 0
  1792. #define __itt_string_handle_createW(name) (__itt_string_handle*)0
  1793. #define __itt_string_handle_createW_ptr 0
  1794. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1795. #define __itt_string_handle_create(name) (__itt_string_handle*)0
  1796. #define __itt_string_handle_create_ptr 0
  1797. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1798. #endif /* INTEL_NO_ITTNOTIFY_API */
  1799. #else /* INTEL_NO_MACRO_BODY */
  1800. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  1801. #define __itt_string_handle_createA_ptr 0
  1802. #define __itt_string_handle_createW_ptr 0
  1803. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1804. #define __itt_string_handle_create_ptr 0
  1805. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  1806. #endif /* INTEL_NO_MACRO_BODY */
  1807. /** @endcond */
  1808. /** @} handles group */
  1809. /** @cond exclude_from_documentation */
  1810. typedef unsigned long long __itt_timestamp;
  1811. /** @endcond */
  1812. #define __itt_timestamp_none ((__itt_timestamp)-1LL)
  1813. /** @cond exclude_from_gpa_documentation */
  1814. /**
  1815. * @ingroup timestamps
  1816. * @brief Return timestamp corresponding to the current moment.
  1817. * This returns the timestamp in the format that is the most relevant for the current
  1818. * host or platform (RDTSC, QPC, and others). You can use the "<" operator to
  1819. * compare __itt_timestamp values.
  1820. */
  1821. __itt_timestamp ITTAPI __itt_get_timestamp(void);
  1822. /** @cond exclude_from_documentation */
  1823. #ifndef INTEL_NO_MACRO_BODY
  1824. #ifndef INTEL_NO_ITTNOTIFY_API
  1825. ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void))
  1826. #define __itt_get_timestamp ITTNOTIFY_DATA(get_timestamp)
  1827. #define __itt_get_timestamp_ptr ITTNOTIFY_NAME(get_timestamp)
  1828. #else /* INTEL_NO_ITTNOTIFY_API */
  1829. #define __itt_get_timestamp()
  1830. #define __itt_get_timestamp_ptr 0
  1831. #endif /* INTEL_NO_ITTNOTIFY_API */
  1832. #else /* INTEL_NO_MACRO_BODY */
  1833. #define __itt_get_timestamp_ptr 0
  1834. #endif /* INTEL_NO_MACRO_BODY */
  1835. /** @endcond */
  1836. /** @} timestamps */
  1837. /** @endcond */
  1838. /** @cond exclude_from_gpa_documentation */
  1839. /**
  1840. * @defgroup regions Regions
  1841. * @ingroup public
  1842. * Regions group
  1843. * @{
  1844. */
  1845. /**
  1846. * @ingroup regions
  1847. * @brief Begin of region instance.
  1848. * Successive calls to __itt_region_begin with the same ID are ignored
  1849. * until a call to __itt_region_end with the same ID
  1850. * @param[in] domain The domain for this region instance
  1851. * @param[in] id The instance ID for this region instance. Must not be __itt_null
  1852. * @param[in] parentid The instance ID for the parent of this region instance, or __itt_null
  1853. * @param[in] name The name of this region
  1854. */
  1855. void ITTAPI __itt_region_begin(const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name);
  1856. /**
  1857. * @ingroup regions
  1858. * @brief End of region instance.
  1859. * The first call to __itt_region_end with a given ID ends the
  1860. * region. Successive calls with the same ID are ignored, as are
  1861. * calls that do not have a matching __itt_region_begin call.
  1862. * @param[in] domain The domain for this region instance
  1863. * @param[in] id The instance ID for this region instance
  1864. */
  1865. void ITTAPI __itt_region_end(const __itt_domain *domain, __itt_id id);
  1866. /** @cond exclude_from_documentation */
  1867. #ifndef INTEL_NO_MACRO_BODY
  1868. #ifndef INTEL_NO_ITTNOTIFY_API
  1869. ITT_STUBV(ITTAPI, void, region_begin, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name))
  1870. ITT_STUBV(ITTAPI, void, region_end, (const __itt_domain *domain, __itt_id id))
  1871. #define __itt_region_begin(d,x,y,z) ITTNOTIFY_VOID_D3(region_begin,d,x,y,z)
  1872. #define __itt_region_begin_ptr ITTNOTIFY_NAME(region_begin)
  1873. #define __itt_region_end(d,x) ITTNOTIFY_VOID_D1(region_end,d,x)
  1874. #define __itt_region_end_ptr ITTNOTIFY_NAME(region_end)
  1875. #else /* INTEL_NO_ITTNOTIFY_API */
  1876. #define __itt_region_begin(d,x,y,z)
  1877. #define __itt_region_begin_ptr 0
  1878. #define __itt_region_end(d,x)
  1879. #define __itt_region_end_ptr 0
  1880. #endif /* INTEL_NO_ITTNOTIFY_API */
  1881. #else /* INTEL_NO_MACRO_BODY */
  1882. #define __itt_region_begin_ptr 0
  1883. #define __itt_region_end_ptr 0
  1884. #endif /* INTEL_NO_MACRO_BODY */
  1885. /** @endcond */
  1886. /** @} regions group */
  1887. /**
  1888. * @defgroup frames Frames
  1889. * @ingroup public
  1890. * Frames are similar to regions, but are intended to be easier to use and to implement.
  1891. * In particular:
  1892. * - Frames always represent periods of elapsed time
  1893. * - By default, frames have no nesting relationships
  1894. * @{
  1895. */
  1896. /**
  1897. * @ingroup frames
  1898. * @brief Begin a frame instance.
  1899. * Successive calls to __itt_frame_begin with the
  1900. * same ID are ignored until a call to __itt_frame_end with the same ID.
  1901. * @param[in] domain The domain for this frame instance
  1902. * @param[in] id The instance ID for this frame instance or NULL
  1903. */
  1904. void ITTAPI __itt_frame_begin_v3(const __itt_domain *domain, __itt_id *id);
  1905. /**
  1906. * @ingroup frames
  1907. * @brief End a frame instance.
  1908. * The first call to __itt_frame_end with a given ID
  1909. * ends the frame. Successive calls with the same ID are ignored, as are
  1910. * calls that do not have a matching __itt_frame_begin call.
  1911. * @param[in] domain The domain for this frame instance
  1912. * @param[in] id The instance ID for this frame instance or NULL for current
  1913. */
  1914. void ITTAPI __itt_frame_end_v3(const __itt_domain *domain, __itt_id *id);
  1915. /**
  1916. * @ingroup frames
  1917. * @brief Submits a frame instance.
  1918. * Successive calls to __itt_frame_begin or __itt_frame_submit with the
  1919. * same ID are ignored until a call to __itt_frame_end or __itt_frame_submit
  1920. * with the same ID.
  1921. * Passing special __itt_timestamp_none value as "end" argument means
  1922. * take the current timestamp as the end timestamp.
  1923. * @param[in] domain The domain for this frame instance
  1924. * @param[in] id The instance ID for this frame instance or NULL
  1925. * @param[in] begin Timestamp of the beginning of the frame
  1926. * @param[in] end Timestamp of the end of the frame
  1927. */
  1928. void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id,
  1929. __itt_timestamp begin, __itt_timestamp end);
  1930. /** @cond exclude_from_documentation */
  1931. #ifndef INTEL_NO_MACRO_BODY
  1932. #ifndef INTEL_NO_ITTNOTIFY_API
  1933. ITT_STUBV(ITTAPI, void, frame_begin_v3, (const __itt_domain *domain, __itt_id *id))
  1934. ITT_STUBV(ITTAPI, void, frame_end_v3, (const __itt_domain *domain, __itt_id *id))
  1935. ITT_STUBV(ITTAPI, void, frame_submit_v3, (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin, __itt_timestamp end))
  1936. #define __itt_frame_begin_v3(d,x) ITTNOTIFY_VOID_D1(frame_begin_v3,d,x)
  1937. #define __itt_frame_begin_v3_ptr ITTNOTIFY_NAME(frame_begin_v3)
  1938. #define __itt_frame_end_v3(d,x) ITTNOTIFY_VOID_D1(frame_end_v3,d,x)
  1939. #define __itt_frame_end_v3_ptr ITTNOTIFY_NAME(frame_end_v3)
  1940. #define __itt_frame_submit_v3(d,x,b,e) ITTNOTIFY_VOID_D3(frame_submit_v3,d,x,b,e)
  1941. #define __itt_frame_submit_v3_ptr ITTNOTIFY_NAME(frame_submit_v3)
  1942. #else /* INTEL_NO_ITTNOTIFY_API */
  1943. #define __itt_frame_begin_v3(domain,id)
  1944. #define __itt_frame_begin_v3_ptr 0
  1945. #define __itt_frame_end_v3(domain,id)
  1946. #define __itt_frame_end_v3_ptr 0
  1947. #define __itt_frame_submit_v3(domain,id,begin,end)
  1948. #define __itt_frame_submit_v3_ptr 0
  1949. #endif /* INTEL_NO_ITTNOTIFY_API */
  1950. #else /* INTEL_NO_MACRO_BODY */
  1951. #define __itt_frame_begin_v3_ptr 0
  1952. #define __itt_frame_end_v3_ptr 0
  1953. #define __itt_frame_submit_v3_ptr 0
  1954. #endif /* INTEL_NO_MACRO_BODY */
  1955. /** @endcond */
  1956. /** @} frames group */
  1957. /** @endcond */
  1958. /**
  1959. * @defgroup taskgroup Task Group
  1960. * @ingroup public
  1961. * Task Group
  1962. * @{
  1963. */
  1964. /**
  1965. * @ingroup task_groups
  1966. * @brief Denotes a task_group instance.
  1967. * Successive calls to __itt_task_group with the same ID are ignored.
  1968. * @param[in] domain The domain for this task_group instance
  1969. * @param[in] id The instance ID for this task_group instance. Must not be __itt_null.
  1970. * @param[in] parentid The instance ID for the parent of this task_group instance, or __itt_null.
  1971. * @param[in] name The name of this task_group
  1972. */
  1973. void ITTAPI __itt_task_group(const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name);
  1974. /** @cond exclude_from_documentation */
  1975. #ifndef INTEL_NO_MACRO_BODY
  1976. #ifndef INTEL_NO_ITTNOTIFY_API
  1977. ITT_STUBV(ITTAPI, void, task_group, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name))
  1978. #define __itt_task_group(d,x,y,z) ITTNOTIFY_VOID_D3(task_group,d,x,y,z)
  1979. #define __itt_task_group_ptr ITTNOTIFY_NAME(task_group)
  1980. #else /* INTEL_NO_ITTNOTIFY_API */
  1981. #define __itt_task_group(d,x,y,z)
  1982. #define __itt_task_group_ptr 0
  1983. #endif /* INTEL_NO_ITTNOTIFY_API */
  1984. #else /* INTEL_NO_MACRO_BODY */
  1985. #define __itt_task_group_ptr 0
  1986. #endif /* INTEL_NO_MACRO_BODY */
  1987. /** @endcond */
  1988. /** @} taskgroup group */
  1989. /**
  1990. * @defgroup tasks Tasks
  1991. * @ingroup public
  1992. * A task instance represents a piece of work performed by a particular
  1993. * thread for a period of time. A call to __itt_task_begin creates a
  1994. * task instance. This becomes the current instance for that task on that
  1995. * thread. A following call to __itt_task_end on the same thread ends the
  1996. * instance. There may be multiple simultaneous instances of tasks with the
  1997. * same name on different threads. If an ID is specified, the task instance
  1998. * receives that ID. Nested tasks are allowed.
  1999. *
  2000. * Note: The task is defined by the bracketing of __itt_task_begin and
  2001. * __itt_task_end on the same thread. If some scheduling mechanism causes
  2002. * task switching (the thread executes a different user task) or task
  2003. * switching (the user task switches to a different thread) then this breaks
  2004. * the notion of current instance. Additional API calls are required to
  2005. * deal with that possibility.
  2006. * @{
  2007. */
  2008. /**
  2009. * @ingroup tasks
  2010. * @brief Begin a task instance.
  2011. * @param[in] domain The domain for this task
  2012. * @param[in] taskid The instance ID for this task instance, or __itt_null
  2013. * @param[in] parentid The parent instance to which this task instance belongs, or __itt_null
  2014. * @param[in] name The name of this task
  2015. */
  2016. void ITTAPI __itt_task_begin(const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name);
  2017. /**
  2018. * @ingroup tasks
  2019. * @brief Begin a task instance.
  2020. * @param[in] domain The domain for this task
  2021. * @param[in] taskid The identifier for this task instance (may be 0)
  2022. * @param[in] parentid The parent of this task (may be 0)
  2023. * @param[in] fn The pointer to the function you are tracing
  2024. */
  2025. void ITTAPI __itt_task_begin_fn(const __itt_domain *domain, __itt_id taskid, __itt_id parentid, void* fn);
  2026. /**
  2027. * @ingroup tasks
  2028. * @brief End the current task instance.
  2029. * @param[in] domain The domain for this task
  2030. */
  2031. void ITTAPI __itt_task_end(const __itt_domain *domain);
  2032. /**
  2033. * @ingroup tasks
  2034. * @brief Begin an overlapped task instance.
  2035. * @param[in] domain The domain for this task.
  2036. * @param[in] taskid The identifier for this task instance, *cannot* be __itt_null.
  2037. * @param[in] parentid The parent of this task, or __itt_null.
  2038. * @param[in] name The name of this task.
  2039. */
  2040. void ITTAPI __itt_task_begin_overlapped(const __itt_domain* domain, __itt_id taskid, __itt_id parentid, __itt_string_handle* name);
  2041. /**
  2042. * @ingroup tasks
  2043. * @brief End an overlapped task instance.
  2044. * @param[in] domain The domain for this task
  2045. * @param[in] taskid Explicit ID of finished task
  2046. */
  2047. void ITTAPI __itt_task_end_overlapped(const __itt_domain *domain, __itt_id taskid);
  2048. /** @cond exclude_from_documentation */
  2049. #ifndef INTEL_NO_MACRO_BODY
  2050. #ifndef INTEL_NO_ITTNOTIFY_API
  2051. ITT_STUBV(ITTAPI, void, task_begin, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name))
  2052. ITT_STUBV(ITTAPI, void, task_begin_fn, (const __itt_domain *domain, __itt_id id, __itt_id parentid, void* fn))
  2053. ITT_STUBV(ITTAPI, void, task_end, (const __itt_domain *domain))
  2054. ITT_STUBV(ITTAPI, void, task_begin_overlapped, (const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name))
  2055. ITT_STUBV(ITTAPI, void, task_end_overlapped, (const __itt_domain *domain, __itt_id taskid))
  2056. #define __itt_task_begin(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin,d,x,y,z)
  2057. #define __itt_task_begin_ptr ITTNOTIFY_NAME(task_begin)
  2058. #define __itt_task_begin_fn(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin_fn,d,x,y,z)
  2059. #define __itt_task_begin_fn_ptr ITTNOTIFY_NAME(task_begin_fn)
  2060. #define __itt_task_end(d) ITTNOTIFY_VOID_D0(task_end,d)
  2061. #define __itt_task_end_ptr ITTNOTIFY_NAME(task_end)
  2062. #define __itt_task_begin_overlapped(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin_overlapped,d,x,y,z)
  2063. #define __itt_task_begin_overlapped_ptr ITTNOTIFY_NAME(task_begin_overlapped)
  2064. #define __itt_task_end_overlapped(d,x) ITTNOTIFY_VOID_D1(task_end_overlapped,d,x)
  2065. #define __itt_task_end_overlapped_ptr ITTNOTIFY_NAME(task_end_overlapped)
  2066. #else /* INTEL_NO_ITTNOTIFY_API */
  2067. #define __itt_task_begin(domain,id,parentid,name)
  2068. #define __itt_task_begin_ptr 0
  2069. #define __itt_task_begin_fn(domain,id,parentid,fn)
  2070. #define __itt_task_begin_fn_ptr 0
  2071. #define __itt_task_end(domain)
  2072. #define __itt_task_end_ptr 0
  2073. #define __itt_task_begin_overlapped(domain,taskid,parentid,name)
  2074. #define __itt_task_begin_overlapped_ptr 0
  2075. #define __itt_task_end_overlapped(domain,taskid)
  2076. #define __itt_task_end_overlapped_ptr 0
  2077. #endif /* INTEL_NO_ITTNOTIFY_API */
  2078. #else /* INTEL_NO_MACRO_BODY */
  2079. #define __itt_task_begin_ptr 0
  2080. #define __itt_task_begin_fn_ptr 0
  2081. #define __itt_task_end_ptr 0
  2082. #define __itt_task_begin_overlapped_ptr 0
  2083. #define __itt_task_end_overlapped_ptr 0
  2084. #endif /* INTEL_NO_MACRO_BODY */
  2085. /** @endcond */
  2086. /** @} tasks group */
  2087. /**
  2088. * @defgroup markers Markers
  2089. * Markers represent a single discreet event in time. Markers have a scope,
  2090. * described by an enumerated type __itt_scope. Markers are created by
  2091. * the API call __itt_marker. A marker instance can be given an ID for use in
  2092. * adding metadata.
  2093. * @{
  2094. */
  2095. /**
  2096. * @brief Describes the scope of an event object in the trace.
  2097. */
  2098. typedef enum
  2099. {
  2100. __itt_scope_unknown = 0,
  2101. __itt_scope_global,
  2102. __itt_scope_track_group,
  2103. __itt_scope_track,
  2104. __itt_scope_task,
  2105. __itt_scope_marker
  2106. } __itt_scope;
  2107. /** @cond exclude_from_documentation */
  2108. #define __itt_marker_scope_unknown __itt_scope_unknown
  2109. #define __itt_marker_scope_global __itt_scope_global
  2110. #define __itt_marker_scope_process __itt_scope_track_group
  2111. #define __itt_marker_scope_thread __itt_scope_track
  2112. #define __itt_marker_scope_task __itt_scope_task
  2113. /** @endcond */
  2114. /**
  2115. * @ingroup markers
  2116. * @brief Create a marker instance
  2117. * @param[in] domain The domain for this marker
  2118. * @param[in] id The instance ID for this marker or __itt_null
  2119. * @param[in] name The name for this marker
  2120. * @param[in] scope The scope for this marker
  2121. */
  2122. void ITTAPI __itt_marker(const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope);
  2123. /** @cond exclude_from_documentation */
  2124. #ifndef INTEL_NO_MACRO_BODY
  2125. #ifndef INTEL_NO_ITTNOTIFY_API
  2126. ITT_STUBV(ITTAPI, void, marker, (const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope))
  2127. #define __itt_marker(d,x,y,z) ITTNOTIFY_VOID_D3(marker,d,x,y,z)
  2128. #define __itt_marker_ptr ITTNOTIFY_NAME(marker)
  2129. #else /* INTEL_NO_ITTNOTIFY_API */
  2130. #define __itt_marker(domain,id,name,scope)
  2131. #define __itt_marker_ptr 0
  2132. #endif /* INTEL_NO_ITTNOTIFY_API */
  2133. #else /* INTEL_NO_MACRO_BODY */
  2134. #define __itt_marker_ptr 0
  2135. #endif /* INTEL_NO_MACRO_BODY */
  2136. /** @endcond */
  2137. /** @} markers group */
  2138. /**
  2139. * @defgroup metadata Metadata
  2140. * The metadata API is used to attach extra information to named
  2141. * entities. Metadata can be attached to an identified named entity by ID,
  2142. * or to the current entity (which is always a task).
  2143. *
  2144. * Conceptually metadata has a type (what kind of metadata), a key (the
  2145. * name of the metadata), and a value (the actual data). The encoding of
  2146. * the value depends on the type of the metadata.
  2147. *
  2148. * The type of metadata is specified by an enumerated type __itt_metdata_type.
  2149. * @{
  2150. */
  2151. /**
  2152. * @ingroup parameters
  2153. * @brief describes the type of metadata
  2154. */
  2155. typedef enum {
  2156. __itt_metadata_unknown = 0,
  2157. __itt_metadata_u64, /**< Unsigned 64-bit integer */
  2158. __itt_metadata_s64, /**< Signed 64-bit integer */
  2159. __itt_metadata_u32, /**< Unsigned 32-bit integer */
  2160. __itt_metadata_s32, /**< Signed 32-bit integer */
  2161. __itt_metadata_u16, /**< Unsigned 16-bit integer */
  2162. __itt_metadata_s16, /**< Signed 16-bit integer */
  2163. __itt_metadata_float, /**< Signed 32-bit floating-point */
  2164. __itt_metadata_double /**< SIgned 64-bit floating-point */
  2165. } __itt_metadata_type;
  2166. /**
  2167. * @ingroup parameters
  2168. * @brief Add metadata to an instance of a named entity.
  2169. * @param[in] domain The domain controlling the call
  2170. * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
  2171. * @param[in] key The name of the metadata
  2172. * @param[in] type The type of the metadata
  2173. * @param[in] count The number of elements of the given type. If count == 0, no metadata will be added.
  2174. * @param[in] data The metadata itself
  2175. */
  2176. void ITTAPI __itt_metadata_add(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data);
  2177. /** @cond exclude_from_documentation */
  2178. #ifndef INTEL_NO_MACRO_BODY
  2179. #ifndef INTEL_NO_ITTNOTIFY_API
  2180. ITT_STUBV(ITTAPI, void, metadata_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data))
  2181. #define __itt_metadata_add(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(metadata_add,d,x,y,z,a,b)
  2182. #define __itt_metadata_add_ptr ITTNOTIFY_NAME(metadata_add)
  2183. #else /* INTEL_NO_ITTNOTIFY_API */
  2184. #define __itt_metadata_add(d,x,y,z,a,b)
  2185. #define __itt_metadata_add_ptr 0
  2186. #endif /* INTEL_NO_ITTNOTIFY_API */
  2187. #else /* INTEL_NO_MACRO_BODY */
  2188. #define __itt_metadata_add_ptr 0
  2189. #endif /* INTEL_NO_MACRO_BODY */
  2190. /** @endcond */
  2191. /**
  2192. * @ingroup parameters
  2193. * @brief Add string metadata to an instance of a named entity.
  2194. * @param[in] domain The domain controlling the call
  2195. * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
  2196. * @param[in] key The name of the metadata
  2197. * @param[in] data The metadata itself
  2198. * @param[in] length The number of characters in the string, or -1 if the length is unknown but the string is null-terminated
  2199. */
  2200. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2201. void ITTAPI __itt_metadata_str_addA(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length);
  2202. void ITTAPI __itt_metadata_str_addW(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t *data, size_t length);
  2203. #if defined(UNICODE) || defined(_UNICODE)
  2204. # define __itt_metadata_str_add __itt_metadata_str_addW
  2205. # define __itt_metadata_str_add_ptr __itt_metadata_str_addW_ptr
  2206. #else /* UNICODE */
  2207. # define __itt_metadata_str_add __itt_metadata_str_addA
  2208. # define __itt_metadata_str_add_ptr __itt_metadata_str_addA_ptr
  2209. #endif /* UNICODE */
  2210. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2211. void ITTAPI __itt_metadata_str_add(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length);
  2212. #endif
  2213. /** @cond exclude_from_documentation */
  2214. #ifndef INTEL_NO_MACRO_BODY
  2215. #ifndef INTEL_NO_ITTNOTIFY_API
  2216. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2217. ITT_STUBV(ITTAPI, void, metadata_str_addA, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length))
  2218. ITT_STUBV(ITTAPI, void, metadata_str_addW, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t *data, size_t length))
  2219. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2220. ITT_STUBV(ITTAPI, void, metadata_str_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length))
  2221. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2222. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2223. #define __itt_metadata_str_addA(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_addA,d,x,y,z,a)
  2224. #define __itt_metadata_str_addA_ptr ITTNOTIFY_NAME(metadata_str_addA)
  2225. #define __itt_metadata_str_addW(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_addW,d,x,y,z,a)
  2226. #define __itt_metadata_str_addW_ptr ITTNOTIFY_NAME(metadata_str_addW)
  2227. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2228. #define __itt_metadata_str_add(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add,d,x,y,z,a)
  2229. #define __itt_metadata_str_add_ptr ITTNOTIFY_NAME(metadata_str_add)
  2230. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2231. #else /* INTEL_NO_ITTNOTIFY_API */
  2232. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2233. #define __itt_metadata_str_addA(d,x,y,z,a)
  2234. #define __itt_metadata_str_addA_ptr 0
  2235. #define __itt_metadata_str_addW(d,x,y,z,a)
  2236. #define __itt_metadata_str_addW_ptr 0
  2237. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2238. #define __itt_metadata_str_add(d,x,y,z,a)
  2239. #define __itt_metadata_str_add_ptr 0
  2240. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2241. #endif /* INTEL_NO_ITTNOTIFY_API */
  2242. #else /* INTEL_NO_MACRO_BODY */
  2243. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2244. #define __itt_metadata_str_addA_ptr 0
  2245. #define __itt_metadata_str_addW_ptr 0
  2246. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2247. #define __itt_metadata_str_add_ptr 0
  2248. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2249. #endif /* INTEL_NO_MACRO_BODY */
  2250. /** @endcond */
  2251. /**
  2252. * @ingroup parameters
  2253. * @brief Add metadata to an instance of a named entity.
  2254. * @param[in] domain The domain controlling the call
  2255. * @param[in] scope The scope of the instance to which the metadata is to be added
  2256. * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
  2257. * @param[in] key The name of the metadata
  2258. * @param[in] type The type of the metadata
  2259. * @param[in] count The number of elements of the given type. If count == 0, no metadata will be added.
  2260. * @param[in] data The metadata itself
  2261. */
  2262. void ITTAPI __itt_metadata_add_with_scope(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data);
  2263. /** @cond exclude_from_documentation */
  2264. #ifndef INTEL_NO_MACRO_BODY
  2265. #ifndef INTEL_NO_ITTNOTIFY_API
  2266. ITT_STUBV(ITTAPI, void, metadata_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data))
  2267. #define __itt_metadata_add_with_scope(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(metadata_add_with_scope,d,x,y,z,a,b)
  2268. #define __itt_metadata_add_with_scope_ptr ITTNOTIFY_NAME(metadata_add_with_scope)
  2269. #else /* INTEL_NO_ITTNOTIFY_API */
  2270. #define __itt_metadata_add_with_scope(d,x,y,z,a,b)
  2271. #define __itt_metadata_add_with_scope_ptr 0
  2272. #endif /* INTEL_NO_ITTNOTIFY_API */
  2273. #else /* INTEL_NO_MACRO_BODY */
  2274. #define __itt_metadata_add_with_scope_ptr 0
  2275. #endif /* INTEL_NO_MACRO_BODY */
  2276. /** @endcond */
  2277. /**
  2278. * @ingroup parameters
  2279. * @brief Add string metadata to an instance of a named entity.
  2280. * @param[in] domain The domain controlling the call
  2281. * @param[in] scope The scope of the instance to which the metadata is to be added
  2282. * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
  2283. * @param[in] key The name of the metadata
  2284. * @param[in] data The metadata itself
  2285. * @param[in] length The number of characters in the string, or -1 if the length is unknown but the string is null-terminated
  2286. */
  2287. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2288. void ITTAPI __itt_metadata_str_add_with_scopeA(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length);
  2289. void ITTAPI __itt_metadata_str_add_with_scopeW(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length);
  2290. #if defined(UNICODE) || defined(_UNICODE)
  2291. # define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeW
  2292. # define __itt_metadata_str_add_with_scope_ptr __itt_metadata_str_add_with_scopeW_ptr
  2293. #else /* UNICODE */
  2294. # define __itt_metadata_str_add_with_scope __itt_metadata_str_add_with_scopeA
  2295. # define __itt_metadata_str_add_with_scope_ptr __itt_metadata_str_add_with_scopeA_ptr
  2296. #endif /* UNICODE */
  2297. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2298. void ITTAPI __itt_metadata_str_add_with_scope(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length);
  2299. #endif
  2300. /** @cond exclude_from_documentation */
  2301. #ifndef INTEL_NO_MACRO_BODY
  2302. #ifndef INTEL_NO_ITTNOTIFY_API
  2303. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2304. ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length))
  2305. ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length))
  2306. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2307. ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length))
  2308. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2309. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2310. #define __itt_metadata_str_add_with_scopeA(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeA,d,x,y,z,a)
  2311. #define __itt_metadata_str_add_with_scopeA_ptr ITTNOTIFY_NAME(metadata_str_add_with_scopeA)
  2312. #define __itt_metadata_str_add_with_scopeW(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeW,d,x,y,z,a)
  2313. #define __itt_metadata_str_add_with_scopeW_ptr ITTNOTIFY_NAME(metadata_str_add_with_scopeW)
  2314. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2315. #define __itt_metadata_str_add_with_scope(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scope,d,x,y,z,a)
  2316. #define __itt_metadata_str_add_with_scope_ptr ITTNOTIFY_NAME(metadata_str_add_with_scope)
  2317. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2318. #else /* INTEL_NO_ITTNOTIFY_API */
  2319. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2320. #define __itt_metadata_str_add_with_scopeA(d,x,y,z,a)
  2321. #define __itt_metadata_str_add_with_scopeA_ptr 0
  2322. #define __itt_metadata_str_add_with_scopeW(d,x,y,z,a)
  2323. #define __itt_metadata_str_add_with_scopeW_ptr 0
  2324. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2325. #define __itt_metadata_str_add_with_scope(d,x,y,z,a)
  2326. #define __itt_metadata_str_add_with_scope_ptr 0
  2327. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2328. #endif /* INTEL_NO_ITTNOTIFY_API */
  2329. #else /* INTEL_NO_MACRO_BODY */
  2330. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2331. #define __itt_metadata_str_add_with_scopeA_ptr 0
  2332. #define __itt_metadata_str_add_with_scopeW_ptr 0
  2333. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2334. #define __itt_metadata_str_add_with_scope_ptr 0
  2335. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2336. #endif /* INTEL_NO_MACRO_BODY */
  2337. /** @endcond */
  2338. /** @} metadata group */
  2339. /**
  2340. * @defgroup relations Relations
  2341. * Instances of named entities can be explicitly associated with other
  2342. * instances using instance IDs and the relationship API calls.
  2343. *
  2344. * @{
  2345. */
  2346. /**
  2347. * @ingroup relations
  2348. * @brief The kind of relation between two instances is specified by the enumerated type __itt_relation.
  2349. * Relations between instances can be added with an API call. The relation
  2350. * API uses instance IDs. Relations can be added before or after the actual
  2351. * instances are created and persist independently of the instances. This
  2352. * is the motivation for having different lifetimes for instance IDs and
  2353. * the actual instances.
  2354. */
  2355. typedef enum
  2356. {
  2357. __itt_relation_is_unknown = 0,
  2358. __itt_relation_is_dependent_on, /**< "A is dependent on B" means that A cannot start until B completes */
  2359. __itt_relation_is_sibling_of, /**< "A is sibling of B" means that A and B were created as a group */
  2360. __itt_relation_is_parent_of, /**< "A is parent of B" means that A created B */
  2361. __itt_relation_is_continuation_of, /**< "A is continuation of B" means that A assumes the dependencies of B */
  2362. __itt_relation_is_child_of, /**< "A is child of B" means that A was created by B (inverse of is_parent_of) */
  2363. __itt_relation_is_continued_by, /**< "A is continued by B" means that B assumes the dependencies of A (inverse of is_continuation_of) */
  2364. __itt_relation_is_predecessor_to /**< "A is predecessor to B" means that B cannot start until A completes (inverse of is_dependent_on) */
  2365. } __itt_relation;
  2366. /**
  2367. * @ingroup relations
  2368. * @brief Add a relation to the current task instance.
  2369. * The current task instance is the head of the relation.
  2370. * @param[in] domain The domain controlling this call
  2371. * @param[in] relation The kind of relation
  2372. * @param[in] tail The ID for the tail of the relation
  2373. */
  2374. void ITTAPI __itt_relation_add_to_current(const __itt_domain *domain, __itt_relation relation, __itt_id tail);
  2375. /**
  2376. * @ingroup relations
  2377. * @brief Add a relation between two instance identifiers.
  2378. * @param[in] domain The domain controlling this call
  2379. * @param[in] head The ID for the head of the relation
  2380. * @param[in] relation The kind of relation
  2381. * @param[in] tail The ID for the tail of the relation
  2382. */
  2383. void ITTAPI __itt_relation_add(const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail);
  2384. /** @cond exclude_from_documentation */
  2385. #ifndef INTEL_NO_MACRO_BODY
  2386. #ifndef INTEL_NO_ITTNOTIFY_API
  2387. ITT_STUBV(ITTAPI, void, relation_add_to_current, (const __itt_domain *domain, __itt_relation relation, __itt_id tail))
  2388. ITT_STUBV(ITTAPI, void, relation_add, (const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail))
  2389. #define __itt_relation_add_to_current(d,x,y) ITTNOTIFY_VOID_D2(relation_add_to_current,d,x,y)
  2390. #define __itt_relation_add_to_current_ptr ITTNOTIFY_NAME(relation_add_to_current)
  2391. #define __itt_relation_add(d,x,y,z) ITTNOTIFY_VOID_D3(relation_add,d,x,y,z)
  2392. #define __itt_relation_add_ptr ITTNOTIFY_NAME(relation_add)
  2393. #else /* INTEL_NO_ITTNOTIFY_API */
  2394. #define __itt_relation_add_to_current(d,x,y)
  2395. #define __itt_relation_add_to_current_ptr 0
  2396. #define __itt_relation_add(d,x,y,z)
  2397. #define __itt_relation_add_ptr 0
  2398. #endif /* INTEL_NO_ITTNOTIFY_API */
  2399. #else /* INTEL_NO_MACRO_BODY */
  2400. #define __itt_relation_add_to_current_ptr 0
  2401. #define __itt_relation_add_ptr 0
  2402. #endif /* INTEL_NO_MACRO_BODY */
  2403. /** @endcond */
  2404. /** @} relations group */
  2405. /** @cond exclude_from_documentation */
  2406. #pragma pack(push, 8)
  2407. typedef struct ___itt_clock_info
  2408. {
  2409. unsigned long long clock_freq; /*!< Clock domain frequency */
  2410. unsigned long long clock_base; /*!< Clock domain base timestamp */
  2411. } __itt_clock_info;
  2412. #pragma pack(pop)
  2413. /** @endcond */
  2414. /** @cond exclude_from_documentation */
  2415. typedef void (ITTAPI *__itt_get_clock_info_fn)(__itt_clock_info* clock_info, void* data);
  2416. /** @endcond */
  2417. /** @cond exclude_from_documentation */
  2418. #pragma pack(push, 8)
  2419. typedef struct ___itt_clock_domain
  2420. {
  2421. __itt_clock_info info; /*!< Most recent clock domain info */
  2422. __itt_get_clock_info_fn fn; /*!< Callback function pointer */
  2423. void* fn_data; /*!< Input argument for the callback function */
  2424. int extra1; /*!< Reserved. Must be zero */
  2425. void* extra2; /*!< Reserved. Must be zero */
  2426. struct ___itt_clock_domain* next;
  2427. } __itt_clock_domain;
  2428. #pragma pack(pop)
  2429. /** @endcond */
  2430. /**
  2431. * @ingroup clockdomains
  2432. * @brief Create a clock domain.
  2433. * Certain applications require the capability to trace their application using
  2434. * a clock domain different than the CPU, for instance the instrumentation of events
  2435. * that occur on a GPU.
  2436. * Because the set of domains is expected to be static over the application's execution time,
  2437. * there is no mechanism to destroy a domain.
  2438. * Any domain can be accessed by any thread in the process, regardless of which thread created
  2439. * the domain. This call is thread-safe.
  2440. * @param[in] fn A pointer to a callback function which retrieves alternative CPU timestamps
  2441. * @param[in] fn_data Argument for a callback function; may be NULL
  2442. */
  2443. __itt_clock_domain* ITTAPI __itt_clock_domain_create(__itt_get_clock_info_fn fn, void* fn_data);
  2444. /** @cond exclude_from_documentation */
  2445. #ifndef INTEL_NO_MACRO_BODY
  2446. #ifndef INTEL_NO_ITTNOTIFY_API
  2447. ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info_fn fn, void* fn_data))
  2448. #define __itt_clock_domain_create ITTNOTIFY_DATA(clock_domain_create)
  2449. #define __itt_clock_domain_create_ptr ITTNOTIFY_NAME(clock_domain_create)
  2450. #else /* INTEL_NO_ITTNOTIFY_API */
  2451. #define __itt_clock_domain_create(fn,fn_data) (__itt_clock_domain*)0
  2452. #define __itt_clock_domain_create_ptr 0
  2453. #endif /* INTEL_NO_ITTNOTIFY_API */
  2454. #else /* INTEL_NO_MACRO_BODY */
  2455. #define __itt_clock_domain_create_ptr 0
  2456. #endif /* INTEL_NO_MACRO_BODY */
  2457. /** @endcond */
  2458. /**
  2459. * @ingroup clockdomains
  2460. * @brief Recalculate clock domains frequences and clock base timestamps.
  2461. */
  2462. void ITTAPI __itt_clock_domain_reset(void);
  2463. /** @cond exclude_from_documentation */
  2464. #ifndef INTEL_NO_MACRO_BODY
  2465. #ifndef INTEL_NO_ITTNOTIFY_API
  2466. ITT_STUBV(ITTAPI, void, clock_domain_reset, (void))
  2467. #define __itt_clock_domain_reset ITTNOTIFY_VOID(clock_domain_reset)
  2468. #define __itt_clock_domain_reset_ptr ITTNOTIFY_NAME(clock_domain_reset)
  2469. #else /* INTEL_NO_ITTNOTIFY_API */
  2470. #define __itt_clock_domain_reset()
  2471. #define __itt_clock_domain_reset_ptr 0
  2472. #endif /* INTEL_NO_ITTNOTIFY_API */
  2473. #else /* INTEL_NO_MACRO_BODY */
  2474. #define __itt_clock_domain_reset_ptr 0
  2475. #endif /* INTEL_NO_MACRO_BODY */
  2476. /** @endcond */
  2477. /**
  2478. * @ingroup clockdomain
  2479. * @brief Create an instance of identifier. This establishes the beginning of the lifetime of
  2480. * an instance of the given ID in the trace. Once this lifetime starts, the ID can be used to
  2481. * tag named entity instances in calls such as __itt_task_begin, and to specify relationships among
  2482. * identified named entity instances, using the \ref relations APIs.
  2483. * @param[in] domain The domain controlling the execution of this call.
  2484. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2485. * @param[in] timestamp The user defined timestamp.
  2486. * @param[in] id The ID to create.
  2487. */
  2488. void ITTAPI __itt_id_create_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id);
  2489. /**
  2490. * @ingroup clockdomain
  2491. * @brief Destroy an instance of identifier. This ends the lifetime of the current instance of the
  2492. * given ID value in the trace. Any relationships that are established after this lifetime ends are
  2493. * invalid. This call must be performed before the given ID value can be reused for a different
  2494. * named entity instance.
  2495. * @param[in] domain The domain controlling the execution of this call.
  2496. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2497. * @param[in] timestamp The user defined timestamp.
  2498. * @param[in] id The ID to destroy.
  2499. */
  2500. void ITTAPI __itt_id_destroy_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id);
  2501. /** @cond exclude_from_documentation */
  2502. #ifndef INTEL_NO_MACRO_BODY
  2503. #ifndef INTEL_NO_ITTNOTIFY_API
  2504. ITT_STUBV(ITTAPI, void, id_create_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id))
  2505. ITT_STUBV(ITTAPI, void, id_destroy_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id))
  2506. #define __itt_id_create_ex(d,x,y,z) ITTNOTIFY_VOID_D3(id_create_ex,d,x,y,z)
  2507. #define __itt_id_create_ex_ptr ITTNOTIFY_NAME(id_create_ex)
  2508. #define __itt_id_destroy_ex(d,x,y,z) ITTNOTIFY_VOID_D3(id_destroy_ex,d,x,y,z)
  2509. #define __itt_id_destroy_ex_ptr ITTNOTIFY_NAME(id_destroy_ex)
  2510. #else /* INTEL_NO_ITTNOTIFY_API */
  2511. #define __itt_id_create_ex(domain,clock_domain,timestamp,id)
  2512. #define __itt_id_create_ex_ptr 0
  2513. #define __itt_id_destroy_ex(domain,clock_domain,timestamp,id)
  2514. #define __itt_id_destroy_ex_ptr 0
  2515. #endif /* INTEL_NO_ITTNOTIFY_API */
  2516. #else /* INTEL_NO_MACRO_BODY */
  2517. #define __itt_id_create_ex_ptr 0
  2518. #define __itt_id_destroy_ex_ptr 0
  2519. #endif /* INTEL_NO_MACRO_BODY */
  2520. /** @endcond */
  2521. /**
  2522. * @ingroup clockdomain
  2523. * @brief Begin a task instance.
  2524. * @param[in] domain The domain for this task
  2525. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2526. * @param[in] timestamp The user defined timestamp.
  2527. * @param[in] taskid The instance ID for this task instance, or __itt_null
  2528. * @param[in] parentid The parent instance to which this task instance belongs, or __itt_null
  2529. * @param[in] name The name of this task
  2530. */
  2531. void ITTAPI __itt_task_begin_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name);
  2532. /**
  2533. * @ingroup clockdomain
  2534. * @brief Begin a task instance.
  2535. * @param[in] domain The domain for this task
  2536. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2537. * @param[in] timestamp The user defined timestamp.
  2538. * @param[in] taskid The identifier for this task instance, or __itt_null
  2539. * @param[in] parentid The parent of this task, or __itt_null
  2540. * @param[in] fn The pointer to the function you are tracing
  2541. */
  2542. void ITTAPI __itt_task_begin_fn_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, void* fn);
  2543. /**
  2544. * @ingroup clockdomain
  2545. * @brief End the current task instance.
  2546. * @param[in] domain The domain for this task
  2547. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2548. * @param[in] timestamp The user defined timestamp.
  2549. */
  2550. void ITTAPI __itt_task_end_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp);
  2551. /** @cond exclude_from_documentation */
  2552. #ifndef INTEL_NO_MACRO_BODY
  2553. #ifndef INTEL_NO_ITTNOTIFY_API
  2554. ITT_STUBV(ITTAPI, void, task_begin_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name))
  2555. ITT_STUBV(ITTAPI, void, task_begin_fn_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, void* fn))
  2556. ITT_STUBV(ITTAPI, void, task_end_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp))
  2557. #define __itt_task_begin_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(task_begin_ex,d,x,y,z,a,b)
  2558. #define __itt_task_begin_ex_ptr ITTNOTIFY_NAME(task_begin_ex)
  2559. #define __itt_task_begin_fn_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(task_begin_fn_ex,d,x,y,z,a,b)
  2560. #define __itt_task_begin_fn_ex_ptr ITTNOTIFY_NAME(task_begin_fn_ex)
  2561. #define __itt_task_end_ex(d,x,y) ITTNOTIFY_VOID_D2(task_end_ex,d,x,y)
  2562. #define __itt_task_end_ex_ptr ITTNOTIFY_NAME(task_end_ex)
  2563. #else /* INTEL_NO_ITTNOTIFY_API */
  2564. #define __itt_task_begin_ex(domain,clock_domain,timestamp,id,parentid,name)
  2565. #define __itt_task_begin_ex_ptr 0
  2566. #define __itt_task_begin_fn_ex(domain,clock_domain,timestamp,id,parentid,fn)
  2567. #define __itt_task_begin_fn_ex_ptr 0
  2568. #define __itt_task_end_ex(domain,clock_domain,timestamp)
  2569. #define __itt_task_end_ex_ptr 0
  2570. #endif /* INTEL_NO_ITTNOTIFY_API */
  2571. #else /* INTEL_NO_MACRO_BODY */
  2572. #define __itt_task_begin_ex_ptr 0
  2573. #define __itt_task_begin_fn_ex_ptr 0
  2574. #define __itt_task_end_ex_ptr 0
  2575. #endif /* INTEL_NO_MACRO_BODY */
  2576. /** @endcond */
  2577. /**
  2578. * @defgroup counters Counters
  2579. * @ingroup public
  2580. * Counters are user-defined objects with a monotonically increasing
  2581. * value. Counter values are 64-bit unsigned integers.
  2582. * Counters have names that can be displayed in
  2583. * the tools.
  2584. * @{
  2585. */
  2586. /**
  2587. * @brief opaque structure for counter identification
  2588. */
  2589. /** @cond exclude_from_documentation */
  2590. typedef struct ___itt_counter* __itt_counter;
  2591. /**
  2592. * @brief Create an unsigned 64 bits integer counter with given name/domain
  2593. *
  2594. * After __itt_counter_create() is called, __itt_counter_inc(id), __itt_counter_inc_delta(id, delta),
  2595. * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
  2596. * can be used to change the value of the counter, where value_ptr is a pointer to an unsigned 64 bits integer
  2597. *
  2598. * The call is equal to __itt_counter_create_typed(name, domain, __itt_metadata_u64)
  2599. */
  2600. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2601. __itt_counter ITTAPI __itt_counter_createA(const char *name, const char *domain);
  2602. __itt_counter ITTAPI __itt_counter_createW(const wchar_t *name, const wchar_t *domain);
  2603. #if defined(UNICODE) || defined(_UNICODE)
  2604. # define __itt_counter_create __itt_counter_createW
  2605. # define __itt_counter_create_ptr __itt_counter_createW_ptr
  2606. #else /* UNICODE */
  2607. # define __itt_counter_create __itt_counter_createA
  2608. # define __itt_counter_create_ptr __itt_counter_createA_ptr
  2609. #endif /* UNICODE */
  2610. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2611. __itt_counter ITTAPI __itt_counter_create(const char *name, const char *domain);
  2612. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2613. #ifndef INTEL_NO_MACRO_BODY
  2614. #ifndef INTEL_NO_ITTNOTIFY_API
  2615. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2616. ITT_STUB(ITTAPI, __itt_counter, counter_createA, (const char *name, const char *domain))
  2617. ITT_STUB(ITTAPI, __itt_counter, counter_createW, (const wchar_t *name, const wchar_t *domain))
  2618. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2619. ITT_STUB(ITTAPI, __itt_counter, counter_create, (const char *name, const char *domain))
  2620. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2621. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2622. #define __itt_counter_createA ITTNOTIFY_DATA(counter_createA)
  2623. #define __itt_counter_createA_ptr ITTNOTIFY_NAME(counter_createA)
  2624. #define __itt_counter_createW ITTNOTIFY_DATA(counter_createW)
  2625. #define __itt_counter_createW_ptr ITTNOTIFY_NAME(counter_createW)
  2626. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2627. #define __itt_counter_create ITTNOTIFY_DATA(counter_create)
  2628. #define __itt_counter_create_ptr ITTNOTIFY_NAME(counter_create)
  2629. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2630. #else /* INTEL_NO_ITTNOTIFY_API */
  2631. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2632. #define __itt_counter_createA(name, domain)
  2633. #define __itt_counter_createA_ptr 0
  2634. #define __itt_counter_createW(name, domain)
  2635. #define __itt_counter_createW_ptr 0
  2636. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2637. #define __itt_counter_create(name, domain)
  2638. #define __itt_counter_create_ptr 0
  2639. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2640. #endif /* INTEL_NO_ITTNOTIFY_API */
  2641. #else /* INTEL_NO_MACRO_BODY */
  2642. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2643. #define __itt_counter_createA_ptr 0
  2644. #define __itt_counter_createW_ptr 0
  2645. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2646. #define __itt_counter_create_ptr 0
  2647. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2648. #endif /* INTEL_NO_MACRO_BODY */
  2649. /** @endcond */
  2650. /**
  2651. * @brief Increment the unsigned 64 bits integer counter value
  2652. *
  2653. * Calling this function to non-unsigned 64 bits integer counters has no effect
  2654. */
  2655. void ITTAPI __itt_counter_inc(__itt_counter id);
  2656. #ifndef INTEL_NO_MACRO_BODY
  2657. #ifndef INTEL_NO_ITTNOTIFY_API
  2658. ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id))
  2659. #define __itt_counter_inc ITTNOTIFY_VOID(counter_inc)
  2660. #define __itt_counter_inc_ptr ITTNOTIFY_NAME(counter_inc)
  2661. #else /* INTEL_NO_ITTNOTIFY_API */
  2662. #define __itt_counter_inc(id)
  2663. #define __itt_counter_inc_ptr 0
  2664. #endif /* INTEL_NO_ITTNOTIFY_API */
  2665. #else /* INTEL_NO_MACRO_BODY */
  2666. #define __itt_counter_inc_ptr 0
  2667. #endif /* INTEL_NO_MACRO_BODY */
  2668. /** @endcond */
  2669. /**
  2670. * @brief Increment the unsigned 64 bits integer counter value with x
  2671. *
  2672. * Calling this function to non-unsigned 64 bits integer counters has no effect
  2673. */
  2674. void ITTAPI __itt_counter_inc_delta(__itt_counter id, unsigned long long value);
  2675. #ifndef INTEL_NO_MACRO_BODY
  2676. #ifndef INTEL_NO_ITTNOTIFY_API
  2677. ITT_STUBV(ITTAPI, void, counter_inc_delta, (__itt_counter id, unsigned long long value))
  2678. #define __itt_counter_inc_delta ITTNOTIFY_VOID(counter_inc_delta)
  2679. #define __itt_counter_inc_delta_ptr ITTNOTIFY_NAME(counter_inc_delta)
  2680. #else /* INTEL_NO_ITTNOTIFY_API */
  2681. #define __itt_counter_inc_delta(id, value)
  2682. #define __itt_counter_inc_delta_ptr 0
  2683. #endif /* INTEL_NO_ITTNOTIFY_API */
  2684. #else /* INTEL_NO_MACRO_BODY */
  2685. #define __itt_counter_inc_delta_ptr 0
  2686. #endif /* INTEL_NO_MACRO_BODY */
  2687. /** @endcond */
  2688. /**
  2689. * @brief Decrement the unsigned 64 bits integer counter value
  2690. *
  2691. * Calling this function to non-unsigned 64 bits integer counters has no effect
  2692. */
  2693. void ITTAPI __itt_counter_dec(__itt_counter id);
  2694. #ifndef INTEL_NO_MACRO_BODY
  2695. #ifndef INTEL_NO_ITTNOTIFY_API
  2696. ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id))
  2697. #define __itt_counter_dec ITTNOTIFY_VOID(counter_dec)
  2698. #define __itt_counter_dec_ptr ITTNOTIFY_NAME(counter_dec)
  2699. #else /* INTEL_NO_ITTNOTIFY_API */
  2700. #define __itt_counter_dec(id)
  2701. #define __itt_counter_dec_ptr 0
  2702. #endif /* INTEL_NO_ITTNOTIFY_API */
  2703. #else /* INTEL_NO_MACRO_BODY */
  2704. #define __itt_counter_dec_ptr 0
  2705. #endif /* INTEL_NO_MACRO_BODY */
  2706. /** @endcond */
  2707. /**
  2708. * @brief Decrement the unsigned 64 bits integer counter value with x
  2709. *
  2710. * Calling this function to non-unsigned 64 bits integer counters has no effect
  2711. */
  2712. void ITTAPI __itt_counter_dec_delta(__itt_counter id, unsigned long long value);
  2713. #ifndef INTEL_NO_MACRO_BODY
  2714. #ifndef INTEL_NO_ITTNOTIFY_API
  2715. ITT_STUBV(ITTAPI, void, counter_dec_delta, (__itt_counter id, unsigned long long value))
  2716. #define __itt_counter_dec_delta ITTNOTIFY_VOID(counter_dec_delta)
  2717. #define __itt_counter_dec_delta_ptr ITTNOTIFY_NAME(counter_dec_delta)
  2718. #else /* INTEL_NO_ITTNOTIFY_API */
  2719. #define __itt_counter_dec_delta(id, value)
  2720. #define __itt_counter_dec_delta_ptr 0
  2721. #endif /* INTEL_NO_ITTNOTIFY_API */
  2722. #else /* INTEL_NO_MACRO_BODY */
  2723. #define __itt_counter_dec_delta_ptr 0
  2724. #endif /* INTEL_NO_MACRO_BODY */
  2725. /** @endcond */
  2726. /**
  2727. * @ingroup counters
  2728. * @brief Increment a counter by one.
  2729. * The first call with a given name creates a counter by that name and sets its
  2730. * value to zero. Successive calls increment the counter value.
  2731. * @param[in] domain The domain controlling the call. Counter names are not domain specific.
  2732. * The domain argument is used only to enable or disable the API calls.
  2733. * @param[in] name The name of the counter
  2734. */
  2735. void ITTAPI __itt_counter_inc_v3(const __itt_domain *domain, __itt_string_handle *name);
  2736. /**
  2737. * @ingroup counters
  2738. * @brief Increment a counter by the value specified in delta.
  2739. * @param[in] domain The domain controlling the call. Counter names are not domain specific.
  2740. * The domain argument is used only to enable or disable the API calls.
  2741. * @param[in] name The name of the counter
  2742. * @param[in] delta The amount by which to increment the counter
  2743. */
  2744. void ITTAPI __itt_counter_inc_delta_v3(const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta);
  2745. #ifndef INTEL_NO_MACRO_BODY
  2746. #ifndef INTEL_NO_ITTNOTIFY_API
  2747. ITT_STUBV(ITTAPI, void, counter_inc_v3, (const __itt_domain *domain, __itt_string_handle *name))
  2748. ITT_STUBV(ITTAPI, void, counter_inc_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta))
  2749. #define __itt_counter_inc_v3(d,x) ITTNOTIFY_VOID_D1(counter_inc_v3,d,x)
  2750. #define __itt_counter_inc_v3_ptr ITTNOTIFY_NAME(counter_inc_v3)
  2751. #define __itt_counter_inc_delta_v3(d,x,y) ITTNOTIFY_VOID_D2(counter_inc_delta_v3,d,x,y)
  2752. #define __itt_counter_inc_delta_v3_ptr ITTNOTIFY_NAME(counter_inc_delta_v3)
  2753. #else /* INTEL_NO_ITTNOTIFY_API */
  2754. #define __itt_counter_inc_v3(domain,name)
  2755. #define __itt_counter_inc_v3_ptr 0
  2756. #define __itt_counter_inc_delta_v3(domain,name,delta)
  2757. #define __itt_counter_inc_delta_v3_ptr 0
  2758. #endif /* INTEL_NO_ITTNOTIFY_API */
  2759. #else /* INTEL_NO_MACRO_BODY */
  2760. #define __itt_counter_inc_v3_ptr 0
  2761. #define __itt_counter_inc_delta_v3_ptr 0
  2762. #endif /* INTEL_NO_MACRO_BODY */
  2763. /** @endcond */
  2764. /**
  2765. * @ingroup counters
  2766. * @brief Decrement a counter by one.
  2767. * The first call with a given name creates a counter by that name and sets its
  2768. * value to zero. Successive calls decrement the counter value.
  2769. * @param[in] domain The domain controlling the call. Counter names are not domain specific.
  2770. * The domain argument is used only to enable or disable the API calls.
  2771. * @param[in] name The name of the counter
  2772. */
  2773. void ITTAPI __itt_counter_dec_v3(const __itt_domain *domain, __itt_string_handle *name);
  2774. /**
  2775. * @ingroup counters
  2776. * @brief Decrement a counter by the value specified in delta.
  2777. * @param[in] domain The domain controlling the call. Counter names are not domain specific.
  2778. * The domain argument is used only to enable or disable the API calls.
  2779. * @param[in] name The name of the counter
  2780. * @param[in] delta The amount by which to decrement the counter
  2781. */
  2782. void ITTAPI __itt_counter_dec_delta_v3(const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta);
  2783. #ifndef INTEL_NO_MACRO_BODY
  2784. #ifndef INTEL_NO_ITTNOTIFY_API
  2785. ITT_STUBV(ITTAPI, void, counter_dec_v3, (const __itt_domain *domain, __itt_string_handle *name))
  2786. ITT_STUBV(ITTAPI, void, counter_dec_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta))
  2787. #define __itt_counter_dec_v3(d,x) ITTNOTIFY_VOID_D1(counter_dec_v3,d,x)
  2788. #define __itt_counter_dec_v3_ptr ITTNOTIFY_NAME(counter_dec_v3)
  2789. #define __itt_counter_dec_delta_v3(d,x,y) ITTNOTIFY_VOID_D2(counter_dec_delta_v3,d,x,y)
  2790. #define __itt_counter_dec_delta_v3_ptr ITTNOTIFY_NAME(counter_dec_delta_v3)
  2791. #else /* INTEL_NO_ITTNOTIFY_API */
  2792. #define __itt_counter_dec_v3(domain,name)
  2793. #define __itt_counter_dec_v3_ptr 0
  2794. #define __itt_counter_dec_delta_v3(domain,name,delta)
  2795. #define __itt_counter_dec_delta_v3_ptr 0
  2796. #endif /* INTEL_NO_ITTNOTIFY_API */
  2797. #else /* INTEL_NO_MACRO_BODY */
  2798. #define __itt_counter_dec_v3_ptr 0
  2799. #define __itt_counter_dec_delta_v3_ptr 0
  2800. #endif /* INTEL_NO_MACRO_BODY */
  2801. /** @endcond */
  2802. /** @} counters group */
  2803. /**
  2804. * @brief Set the counter value
  2805. */
  2806. void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr);
  2807. #ifndef INTEL_NO_MACRO_BODY
  2808. #ifndef INTEL_NO_ITTNOTIFY_API
  2809. ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr))
  2810. #define __itt_counter_set_value ITTNOTIFY_VOID(counter_set_value)
  2811. #define __itt_counter_set_value_ptr ITTNOTIFY_NAME(counter_set_value)
  2812. #else /* INTEL_NO_ITTNOTIFY_API */
  2813. #define __itt_counter_set_value(id, value_ptr)
  2814. #define __itt_counter_set_value_ptr 0
  2815. #endif /* INTEL_NO_ITTNOTIFY_API */
  2816. #else /* INTEL_NO_MACRO_BODY */
  2817. #define __itt_counter_set_value_ptr 0
  2818. #endif /* INTEL_NO_MACRO_BODY */
  2819. /** @endcond */
  2820. /**
  2821. * @brief Set the counter value
  2822. */
  2823. void ITTAPI __itt_counter_set_value_ex(__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr);
  2824. /** @cond exclude_from_documentation */
  2825. #ifndef INTEL_NO_MACRO_BODY
  2826. #ifndef INTEL_NO_ITTNOTIFY_API
  2827. ITT_STUBV(ITTAPI, void, counter_set_value_ex, (__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr))
  2828. #define __itt_counter_set_value_ex ITTNOTIFY_VOID(counter_set_value_ex)
  2829. #define __itt_counter_set_value_ex_ptr ITTNOTIFY_NAME(counter_set_value_ex)
  2830. #else /* INTEL_NO_ITTNOTIFY_API */
  2831. #define __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
  2832. #define __itt_counter_set_value_ex_ptr 0
  2833. #endif /* INTEL_NO_ITTNOTIFY_API */
  2834. #else /* INTEL_NO_MACRO_BODY */
  2835. #define __itt_counter_set_value_ex_ptr 0
  2836. #endif /* INTEL_NO_MACRO_BODY */
  2837. /** @endcond */
  2838. /**
  2839. * @brief Create a typed counter with given name/domain
  2840. *
  2841. * After __itt_counter_create_typed() is called, __itt_counter_inc(id), __itt_counter_inc_delta(id, delta),
  2842. * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
  2843. * can be used to change the value of the counter
  2844. */
  2845. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2846. __itt_counter ITTAPI __itt_counter_create_typedA(const char *name, const char *domain, __itt_metadata_type type);
  2847. __itt_counter ITTAPI __itt_counter_create_typedW(const wchar_t *name, const wchar_t *domain, __itt_metadata_type type);
  2848. #if defined(UNICODE) || defined(_UNICODE)
  2849. # define __itt_counter_create_typed __itt_counter_create_typedW
  2850. # define __itt_counter_create_typed_ptr __itt_counter_create_typedW_ptr
  2851. #else /* UNICODE */
  2852. # define __itt_counter_create_typed __itt_counter_create_typedA
  2853. # define __itt_counter_create_typed_ptr __itt_counter_create_typedA_ptr
  2854. #endif /* UNICODE */
  2855. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2856. __itt_counter ITTAPI __itt_counter_create_typed(const char *name, const char *domain, __itt_metadata_type type);
  2857. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2858. #ifndef INTEL_NO_MACRO_BODY
  2859. #ifndef INTEL_NO_ITTNOTIFY_API
  2860. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2861. ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA, (const char *name, const char *domain, __itt_metadata_type type))
  2862. ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW, (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type))
  2863. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2864. ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, const char *domain, __itt_metadata_type type))
  2865. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2866. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2867. #define __itt_counter_create_typedA ITTNOTIFY_DATA(counter_create_typedA)
  2868. #define __itt_counter_create_typedA_ptr ITTNOTIFY_NAME(counter_create_typedA)
  2869. #define __itt_counter_create_typedW ITTNOTIFY_DATA(counter_create_typedW)
  2870. #define __itt_counter_create_typedW_ptr ITTNOTIFY_NAME(counter_create_typedW)
  2871. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2872. #define __itt_counter_create_typed ITTNOTIFY_DATA(counter_create_typed)
  2873. #define __itt_counter_create_typed_ptr ITTNOTIFY_NAME(counter_create_typed)
  2874. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2875. #else /* INTEL_NO_ITTNOTIFY_API */
  2876. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2877. #define __itt_counter_create_typedA(name, domain, type)
  2878. #define __itt_counter_create_typedA_ptr 0
  2879. #define __itt_counter_create_typedW(name, domain, type)
  2880. #define __itt_counter_create_typedW_ptr 0
  2881. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2882. #define __itt_counter_create_typed(name, domain, type)
  2883. #define __itt_counter_create_typed_ptr 0
  2884. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2885. #endif /* INTEL_NO_ITTNOTIFY_API */
  2886. #else /* INTEL_NO_MACRO_BODY */
  2887. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  2888. #define __itt_counter_create_typedA_ptr 0
  2889. #define __itt_counter_create_typedW_ptr 0
  2890. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2891. #define __itt_counter_create_typed_ptr 0
  2892. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  2893. #endif /* INTEL_NO_MACRO_BODY */
  2894. /** @endcond */
  2895. /**
  2896. * @brief Destroy the counter identified by the pointer previously returned by __itt_counter_create() or
  2897. * __itt_counter_create_typed()
  2898. */
  2899. void ITTAPI __itt_counter_destroy(__itt_counter id);
  2900. #ifndef INTEL_NO_MACRO_BODY
  2901. #ifndef INTEL_NO_ITTNOTIFY_API
  2902. ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id))
  2903. #define __itt_counter_destroy ITTNOTIFY_VOID(counter_destroy)
  2904. #define __itt_counter_destroy_ptr ITTNOTIFY_NAME(counter_destroy)
  2905. #else /* INTEL_NO_ITTNOTIFY_API */
  2906. #define __itt_counter_destroy(id)
  2907. #define __itt_counter_destroy_ptr 0
  2908. #endif /* INTEL_NO_ITTNOTIFY_API */
  2909. #else /* INTEL_NO_MACRO_BODY */
  2910. #define __itt_counter_destroy_ptr 0
  2911. #endif /* INTEL_NO_MACRO_BODY */
  2912. /** @endcond */
  2913. /** @} counters group */
  2914. /**
  2915. * @ingroup markers
  2916. * @brief Create a marker instance.
  2917. * @param[in] domain The domain for this marker
  2918. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2919. * @param[in] timestamp The user defined timestamp.
  2920. * @param[in] id The instance ID for this marker, or __itt_null
  2921. * @param[in] name The name for this marker
  2922. * @param[in] scope The scope for this marker
  2923. */
  2924. void ITTAPI __itt_marker_ex(const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope);
  2925. /** @cond exclude_from_documentation */
  2926. #ifndef INTEL_NO_MACRO_BODY
  2927. #ifndef INTEL_NO_ITTNOTIFY_API
  2928. ITT_STUBV(ITTAPI, void, marker_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope))
  2929. #define __itt_marker_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(marker_ex,d,x,y,z,a,b)
  2930. #define __itt_marker_ex_ptr ITTNOTIFY_NAME(marker_ex)
  2931. #else /* INTEL_NO_ITTNOTIFY_API */
  2932. #define __itt_marker_ex(domain,clock_domain,timestamp,id,name,scope)
  2933. #define __itt_marker_ex_ptr 0
  2934. #endif /* INTEL_NO_ITTNOTIFY_API */
  2935. #else /* INTEL_NO_MACRO_BODY */
  2936. #define __itt_marker_ex_ptr 0
  2937. #endif /* INTEL_NO_MACRO_BODY */
  2938. /** @endcond */
  2939. /**
  2940. * @ingroup clockdomain
  2941. * @brief Add a relation to the current task instance.
  2942. * The current task instance is the head of the relation.
  2943. * @param[in] domain The domain controlling this call
  2944. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2945. * @param[in] timestamp The user defined timestamp.
  2946. * @param[in] relation The kind of relation
  2947. * @param[in] tail The ID for the tail of the relation
  2948. */
  2949. void ITTAPI __itt_relation_add_to_current_ex(const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail);
  2950. /**
  2951. * @ingroup clockdomain
  2952. * @brief Add a relation between two instance identifiers.
  2953. * @param[in] domain The domain controlling this call
  2954. * @param[in] clock_domain The clock domain controlling the execution of this call.
  2955. * @param[in] timestamp The user defined timestamp.
  2956. * @param[in] head The ID for the head of the relation
  2957. * @param[in] relation The kind of relation
  2958. * @param[in] tail The ID for the tail of the relation
  2959. */
  2960. void ITTAPI __itt_relation_add_ex(const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail);
  2961. /** @cond exclude_from_documentation */
  2962. #ifndef INTEL_NO_MACRO_BODY
  2963. #ifndef INTEL_NO_ITTNOTIFY_API
  2964. ITT_STUBV(ITTAPI, void, relation_add_to_current_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail))
  2965. ITT_STUBV(ITTAPI, void, relation_add_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail))
  2966. #define __itt_relation_add_to_current_ex(d,x,y,z,a) ITTNOTIFY_VOID_D4(relation_add_to_current_ex,d,x,y,z,a)
  2967. #define __itt_relation_add_to_current_ex_ptr ITTNOTIFY_NAME(relation_add_to_current_ex)
  2968. #define __itt_relation_add_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(relation_add_ex,d,x,y,z,a,b)
  2969. #define __itt_relation_add_ex_ptr ITTNOTIFY_NAME(relation_add_ex)
  2970. #else /* INTEL_NO_ITTNOTIFY_API */
  2971. #define __itt_relation_add_to_current_ex(domain,clock_domain,timestame,relation,tail)
  2972. #define __itt_relation_add_to_current_ex_ptr 0
  2973. #define __itt_relation_add_ex(domain,clock_domain,timestamp,head,relation,tail)
  2974. #define __itt_relation_add_ex_ptr 0
  2975. #endif /* INTEL_NO_ITTNOTIFY_API */
  2976. #else /* INTEL_NO_MACRO_BODY */
  2977. #define __itt_relation_add_to_current_ex_ptr 0
  2978. #define __itt_relation_add_ex_ptr 0
  2979. #endif /* INTEL_NO_MACRO_BODY */
  2980. /** @endcond */
  2981. /** @cond exclude_from_documentation */
  2982. typedef enum ___itt_track_group_type
  2983. {
  2984. __itt_track_group_type_normal = 0
  2985. } __itt_track_group_type;
  2986. /** @endcond */
  2987. /** @cond exclude_from_documentation */
  2988. #pragma pack(push, 8)
  2989. typedef struct ___itt_track_group
  2990. {
  2991. __itt_string_handle* name; /*!< Name of the track group */
  2992. struct ___itt_track* track; /*!< List of child tracks */
  2993. __itt_track_group_type tgtype; /*!< Type of the track group */
  2994. int extra1; /*!< Reserved. Must be zero */
  2995. void* extra2; /*!< Reserved. Must be zero */
  2996. struct ___itt_track_group* next;
  2997. } __itt_track_group;
  2998. #pragma pack(pop)
  2999. /** @endcond */
  3000. /**
  3001. * @brief Placeholder for custom track types. Currently, "normal" custom track
  3002. * is the only available track type.
  3003. */
  3004. typedef enum ___itt_track_type
  3005. {
  3006. __itt_track_type_normal = 0
  3007. #ifdef INTEL_ITTNOTIFY_API_PRIVATE
  3008. , __itt_track_type_queue
  3009. #endif /* INTEL_ITTNOTIFY_API_PRIVATE */
  3010. } __itt_track_type;
  3011. /** @cond exclude_from_documentation */
  3012. #pragma pack(push, 8)
  3013. typedef struct ___itt_track
  3014. {
  3015. __itt_string_handle* name; /*!< Name of the track group */
  3016. __itt_track_group* group; /*!< Parent group to a track */
  3017. __itt_track_type ttype; /*!< Type of the track */
  3018. int extra1; /*!< Reserved. Must be zero */
  3019. void* extra2; /*!< Reserved. Must be zero */
  3020. struct ___itt_track* next;
  3021. } __itt_track;
  3022. #pragma pack(pop)
  3023. /** @endcond */
  3024. /**
  3025. * @brief Create logical track group.
  3026. */
  3027. __itt_track_group* ITTAPI __itt_track_group_create(__itt_string_handle* name, __itt_track_group_type track_group_type);
  3028. /** @cond exclude_from_documentation */
  3029. #ifndef INTEL_NO_MACRO_BODY
  3030. #ifndef INTEL_NO_ITTNOTIFY_API
  3031. ITT_STUB(ITTAPI, __itt_track_group*, track_group_create, (__itt_string_handle* name, __itt_track_group_type track_group_type))
  3032. #define __itt_track_group_create ITTNOTIFY_DATA(track_group_create)
  3033. #define __itt_track_group_create_ptr ITTNOTIFY_NAME(track_group_create)
  3034. #else /* INTEL_NO_ITTNOTIFY_API */
  3035. #define __itt_track_group_create(name) (__itt_track_group*)0
  3036. #define __itt_track_group_create_ptr 0
  3037. #endif /* INTEL_NO_ITTNOTIFY_API */
  3038. #else /* INTEL_NO_MACRO_BODY */
  3039. #define __itt_track_group_create_ptr 0
  3040. #endif /* INTEL_NO_MACRO_BODY */
  3041. /** @endcond */
  3042. /**
  3043. * @brief Create logical track.
  3044. */
  3045. __itt_track* ITTAPI __itt_track_create(__itt_track_group* track_group, __itt_string_handle* name, __itt_track_type track_type);
  3046. /** @cond exclude_from_documentation */
  3047. #ifndef INTEL_NO_MACRO_BODY
  3048. #ifndef INTEL_NO_ITTNOTIFY_API
  3049. ITT_STUB(ITTAPI, __itt_track*, track_create, (__itt_track_group* track_group,__itt_string_handle* name, __itt_track_type track_type))
  3050. #define __itt_track_create ITTNOTIFY_DATA(track_create)
  3051. #define __itt_track_create_ptr ITTNOTIFY_NAME(track_create)
  3052. #else /* INTEL_NO_ITTNOTIFY_API */
  3053. #define __itt_track_create(track_group,name,track_type) (__itt_track*)0
  3054. #define __itt_track_create_ptr 0
  3055. #endif /* INTEL_NO_ITTNOTIFY_API */
  3056. #else /* INTEL_NO_MACRO_BODY */
  3057. #define __itt_track_create_ptr 0
  3058. #endif /* INTEL_NO_MACRO_BODY */
  3059. /** @endcond */
  3060. /**
  3061. * @brief Set the logical track.
  3062. */
  3063. void ITTAPI __itt_set_track(__itt_track* track);
  3064. /** @cond exclude_from_documentation */
  3065. #ifndef INTEL_NO_MACRO_BODY
  3066. #ifndef INTEL_NO_ITTNOTIFY_API
  3067. ITT_STUBV(ITTAPI, void, set_track, (__itt_track *track))
  3068. #define __itt_set_track ITTNOTIFY_VOID(set_track)
  3069. #define __itt_set_track_ptr ITTNOTIFY_NAME(set_track)
  3070. #else /* INTEL_NO_ITTNOTIFY_API */
  3071. #define __itt_set_track(track)
  3072. #define __itt_set_track_ptr 0
  3073. #endif /* INTEL_NO_ITTNOTIFY_API */
  3074. #else /* INTEL_NO_MACRO_BODY */
  3075. #define __itt_set_track_ptr 0
  3076. #endif /* INTEL_NO_MACRO_BODY */
  3077. /** @endcond */
  3078. /* ========================================================================== */
  3079. /** @cond exclude_from_gpa_documentation */
  3080. /**
  3081. * @defgroup events Events
  3082. * @ingroup public
  3083. * Events group
  3084. * @{
  3085. */
  3086. /** @brief user event type */
  3087. typedef int __itt_event;
  3088. /**
  3089. * @brief Create an event notification
  3090. * @note name or namelen being null/name and namelen not matching, user event feature not enabled
  3091. * @return non-zero event identifier upon success and __itt_err otherwise
  3092. */
  3093. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3094. __itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen);
  3095. __itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen);
  3096. #if defined(UNICODE) || defined(_UNICODE)
  3097. # define __itt_event_create __itt_event_createW
  3098. # define __itt_event_create_ptr __itt_event_createW_ptr
  3099. #else
  3100. # define __itt_event_create __itt_event_createA
  3101. # define __itt_event_create_ptr __itt_event_createA_ptr
  3102. #endif /* UNICODE */
  3103. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3104. __itt_event LIBITTAPI __itt_event_create(const char *name, int namelen);
  3105. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3106. /** @cond exclude_from_documentation */
  3107. #ifndef INTEL_NO_MACRO_BODY
  3108. #ifndef INTEL_NO_ITTNOTIFY_API
  3109. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3110. ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen))
  3111. ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen))
  3112. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3113. ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen))
  3114. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3115. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3116. #define __itt_event_createA ITTNOTIFY_DATA(event_createA)
  3117. #define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA)
  3118. #define __itt_event_createW ITTNOTIFY_DATA(event_createW)
  3119. #define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW)
  3120. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3121. #define __itt_event_create ITTNOTIFY_DATA(event_create)
  3122. #define __itt_event_create_ptr ITTNOTIFY_NAME(event_create)
  3123. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3124. #else /* INTEL_NO_ITTNOTIFY_API */
  3125. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3126. #define __itt_event_createA(name, namelen) (__itt_event)0
  3127. #define __itt_event_createA_ptr 0
  3128. #define __itt_event_createW(name, namelen) (__itt_event)0
  3129. #define __itt_event_createW_ptr 0
  3130. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3131. #define __itt_event_create(name, namelen) (__itt_event)0
  3132. #define __itt_event_create_ptr 0
  3133. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3134. #endif /* INTEL_NO_ITTNOTIFY_API */
  3135. #else /* INTEL_NO_MACRO_BODY */
  3136. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3137. #define __itt_event_createA_ptr 0
  3138. #define __itt_event_createW_ptr 0
  3139. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3140. #define __itt_event_create_ptr 0
  3141. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3142. #endif /* INTEL_NO_MACRO_BODY */
  3143. /** @endcond */
  3144. /**
  3145. * @brief Record an event occurrence.
  3146. * @return __itt_err upon failure (invalid event id/user event feature not enabled)
  3147. */
  3148. int LIBITTAPI __itt_event_start(__itt_event event);
  3149. /** @cond exclude_from_documentation */
  3150. #ifndef INTEL_NO_MACRO_BODY
  3151. #ifndef INTEL_NO_ITTNOTIFY_API
  3152. ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event))
  3153. #define __itt_event_start ITTNOTIFY_DATA(event_start)
  3154. #define __itt_event_start_ptr ITTNOTIFY_NAME(event_start)
  3155. #else /* INTEL_NO_ITTNOTIFY_API */
  3156. #define __itt_event_start(event) (int)0
  3157. #define __itt_event_start_ptr 0
  3158. #endif /* INTEL_NO_ITTNOTIFY_API */
  3159. #else /* INTEL_NO_MACRO_BODY */
  3160. #define __itt_event_start_ptr 0
  3161. #endif /* INTEL_NO_MACRO_BODY */
  3162. /** @endcond */
  3163. /**
  3164. * @brief Record an event end occurrence.
  3165. * @note It is optional if events do not have durations.
  3166. * @return __itt_err upon failure (invalid event id/user event feature not enabled)
  3167. */
  3168. int LIBITTAPI __itt_event_end(__itt_event event);
  3169. /** @cond exclude_from_documentation */
  3170. #ifndef INTEL_NO_MACRO_BODY
  3171. #ifndef INTEL_NO_ITTNOTIFY_API
  3172. ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event))
  3173. #define __itt_event_end ITTNOTIFY_DATA(event_end)
  3174. #define __itt_event_end_ptr ITTNOTIFY_NAME(event_end)
  3175. #else /* INTEL_NO_ITTNOTIFY_API */
  3176. #define __itt_event_end(event) (int)0
  3177. #define __itt_event_end_ptr 0
  3178. #endif /* INTEL_NO_ITTNOTIFY_API */
  3179. #else /* INTEL_NO_MACRO_BODY */
  3180. #define __itt_event_end_ptr 0
  3181. #endif /* INTEL_NO_MACRO_BODY */
  3182. /** @endcond */
  3183. /** @} events group */
  3184. /**
  3185. * @defgroup arrays Arrays Visualizer
  3186. * @ingroup public
  3187. * Visualize arrays
  3188. * @{
  3189. */
  3190. /**
  3191. * @enum __itt_av_data_type
  3192. * @brief Defines types of arrays data (for C/C++ intrinsic types)
  3193. */
  3194. typedef enum
  3195. {
  3196. __itt_e_first = 0,
  3197. __itt_e_char = 0, /* 1-byte integer */
  3198. __itt_e_uchar, /* 1-byte unsigned integer */
  3199. __itt_e_int16, /* 2-byte integer */
  3200. __itt_e_uint16, /* 2-byte unsigned integer */
  3201. __itt_e_int32, /* 4-byte integer */
  3202. __itt_e_uint32, /* 4-byte unsigned integer */
  3203. __itt_e_int64, /* 8-byte integer */
  3204. __itt_e_uint64, /* 8-byte unsigned integer */
  3205. __itt_e_float, /* 4-byte floating */
  3206. __itt_e_double, /* 8-byte floating */
  3207. __itt_e_last = __itt_e_double
  3208. } __itt_av_data_type;
  3209. /**
  3210. * @brief Save an array data to a file.
  3211. * Output format is defined by the file extension. The csv and bmp formats are supported (bmp - for 2-dimensional array only).
  3212. * @param[in] data - pointer to the array data
  3213. * @param[in] rank - the rank of the array
  3214. * @param[in] dimensions - pointer to an array of integers, which specifies the array dimensions.
  3215. * The size of dimensions must be equal to the rank
  3216. * @param[in] type - the type of the array, specified as one of the __itt_av_data_type values (for intrinsic types)
  3217. * @param[in] filePath - the file path; the output format is defined by the file extension
  3218. * @param[in] columnOrder - defines how the array is stored in the linear memory.
  3219. * It should be 1 for column-major order (e.g. in FORTRAN) or 0 - for row-major order (e.g. in C).
  3220. */
  3221. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3222. int ITTAPI __itt_av_saveA(void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder);
  3223. int ITTAPI __itt_av_saveW(void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder);
  3224. #if defined(UNICODE) || defined(_UNICODE)
  3225. # define __itt_av_save __itt_av_saveW
  3226. # define __itt_av_save_ptr __itt_av_saveW_ptr
  3227. #else /* UNICODE */
  3228. # define __itt_av_save __itt_av_saveA
  3229. # define __itt_av_save_ptr __itt_av_saveA_ptr
  3230. #endif /* UNICODE */
  3231. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3232. int ITTAPI __itt_av_save(void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder);
  3233. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3234. /** @cond exclude_from_documentation */
  3235. #ifndef INTEL_NO_MACRO_BODY
  3236. #ifndef INTEL_NO_ITTNOTIFY_API
  3237. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3238. ITT_STUB(ITTAPI, int, av_saveA, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder))
  3239. ITT_STUB(ITTAPI, int, av_saveW, (void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder))
  3240. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3241. ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder))
  3242. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3243. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3244. #define __itt_av_saveA ITTNOTIFY_DATA(av_saveA)
  3245. #define __itt_av_saveA_ptr ITTNOTIFY_NAME(av_saveA)
  3246. #define __itt_av_saveW ITTNOTIFY_DATA(av_saveW)
  3247. #define __itt_av_saveW_ptr ITTNOTIFY_NAME(av_saveW)
  3248. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3249. #define __itt_av_save ITTNOTIFY_DATA(av_save)
  3250. #define __itt_av_save_ptr ITTNOTIFY_NAME(av_save)
  3251. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3252. #else /* INTEL_NO_ITTNOTIFY_API */
  3253. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3254. #define __itt_av_saveA(name)
  3255. #define __itt_av_saveA_ptr 0
  3256. #define __itt_av_saveW(name)
  3257. #define __itt_av_saveW_ptr 0
  3258. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3259. #define __itt_av_save(name)
  3260. #define __itt_av_save_ptr 0
  3261. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3262. #endif /* INTEL_NO_ITTNOTIFY_API */
  3263. #else /* INTEL_NO_MACRO_BODY */
  3264. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3265. #define __itt_av_saveA_ptr 0
  3266. #define __itt_av_saveW_ptr 0
  3267. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3268. #define __itt_av_save_ptr 0
  3269. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3270. #endif /* INTEL_NO_MACRO_BODY */
  3271. /** @endcond */
  3272. void ITTAPI __itt_enable_attach(void);
  3273. /** @cond exclude_from_documentation */
  3274. #ifndef INTEL_NO_MACRO_BODY
  3275. #ifndef INTEL_NO_ITTNOTIFY_API
  3276. ITT_STUBV(ITTAPI, void, enable_attach, (void))
  3277. #define __itt_enable_attach ITTNOTIFY_VOID(enable_attach)
  3278. #define __itt_enable_attach_ptr ITTNOTIFY_NAME(enable_attach)
  3279. #else /* INTEL_NO_ITTNOTIFY_API */
  3280. #define __itt_enable_attach()
  3281. #define __itt_enable_attach_ptr 0
  3282. #endif /* INTEL_NO_ITTNOTIFY_API */
  3283. #else /* INTEL_NO_MACRO_BODY */
  3284. #define __itt_enable_attach_ptr 0
  3285. #endif /* INTEL_NO_MACRO_BODY */
  3286. /** @endcond */
  3287. /** @cond exclude_from_gpa_documentation */
  3288. /** @} arrays group */
  3289. /** @endcond */
  3290. /**
  3291. * @brief Module load info
  3292. * This API is used to report necessary information in case of module relocation
  3293. * @param[in] start_addr - relocated module start address
  3294. * @param[in] end_addr - relocated module end address
  3295. * @param[in] path - file system path to the module
  3296. */
  3297. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3298. void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr, const char *path);
  3299. void ITTAPI __itt_module_loadW(void *start_addr, void *end_addr, const wchar_t *path);
  3300. #if defined(UNICODE) || defined(_UNICODE)
  3301. # define __itt_module_load __itt_module_loadW
  3302. # define __itt_module_load_ptr __itt_module_loadW_ptr
  3303. #else /* UNICODE */
  3304. # define __itt_module_load __itt_module_loadA
  3305. # define __itt_module_load_ptr __itt_module_loadA_ptr
  3306. #endif /* UNICODE */
  3307. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3308. void ITTAPI __itt_module_load(void *start_addr, void *end_addr, const char *path);
  3309. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3310. /** @cond exclude_from_documentation */
  3311. #ifndef INTEL_NO_MACRO_BODY
  3312. #ifndef INTEL_NO_ITTNOTIFY_API
  3313. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3314. ITT_STUB(ITTAPI, void, module_loadA, (void *start_addr, void *end_addr, const char *path))
  3315. ITT_STUB(ITTAPI, void, module_loadW, (void *start_addr, void *end_addr, const wchar_t *path))
  3316. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3317. ITT_STUB(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path))
  3318. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3319. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3320. #define __itt_module_loadA ITTNOTIFY_VOID(module_loadA)
  3321. #define __itt_module_loadA_ptr ITTNOTIFY_NAME(module_loadA)
  3322. #define __itt_module_loadW ITTNOTIFY_VOID(module_loadW)
  3323. #define __itt_module_loadW_ptr ITTNOTIFY_NAME(module_loadW)
  3324. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3325. #define __itt_module_load ITTNOTIFY_VOID(module_load)
  3326. #define __itt_module_load_ptr ITTNOTIFY_NAME(module_load)
  3327. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3328. #else /* INTEL_NO_ITTNOTIFY_API */
  3329. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3330. #define __itt_module_loadA(start_addr, end_addr, path)
  3331. #define __itt_module_loadA_ptr 0
  3332. #define __itt_module_loadW(start_addr, end_addr, path)
  3333. #define __itt_module_loadW_ptr 0
  3334. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3335. #define __itt_module_load(start_addr, end_addr, path)
  3336. #define __itt_module_load_ptr 0
  3337. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3338. #endif /* INTEL_NO_ITTNOTIFY_API */
  3339. #else /* INTEL_NO_MACRO_BODY */
  3340. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3341. #define __itt_module_loadA_ptr 0
  3342. #define __itt_module_loadW_ptr 0
  3343. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3344. #define __itt_module_load_ptr 0
  3345. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3346. #endif /* INTEL_NO_MACRO_BODY */
  3347. /** @endcond */
  3348. #ifdef __cplusplus
  3349. }
  3350. #endif /* __cplusplus */
  3351. #endif /* _ITTNOTIFY_H_ */
  3352. #ifdef INTEL_ITTNOTIFY_API_PRIVATE
  3353. #ifndef _ITTNOTIFY_PRIVATE_
  3354. #define _ITTNOTIFY_PRIVATE_
  3355. #ifdef __cplusplus
  3356. extern "C" {
  3357. #endif /* __cplusplus */
  3358. /**
  3359. * @ingroup clockdomain
  3360. * @brief Begin an overlapped task instance.
  3361. * @param[in] domain The domain for this task
  3362. * @param[in] clock_domain The clock domain controlling the execution of this call.
  3363. * @param[in] timestamp The user defined timestamp.
  3364. * @param[in] taskid The identifier for this task instance, *cannot* be __itt_null.
  3365. * @param[in] parentid The parent of this task, or __itt_null.
  3366. * @param[in] name The name of this task.
  3367. */
  3368. void ITTAPI __itt_task_begin_overlapped_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name);
  3369. /**
  3370. * @ingroup clockdomain
  3371. * @brief End an overlapped task instance.
  3372. * @param[in] domain The domain for this task
  3373. * @param[in] clock_domain The clock domain controlling the execution of this call.
  3374. * @param[in] timestamp The user defined timestamp.
  3375. * @param[in] taskid Explicit ID of finished task
  3376. */
  3377. void ITTAPI __itt_task_end_overlapped_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid);
  3378. /** @cond exclude_from_documentation */
  3379. #ifndef INTEL_NO_MACRO_BODY
  3380. #ifndef INTEL_NO_ITTNOTIFY_API
  3381. ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex, (const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name))
  3382. ITT_STUBV(ITTAPI, void, task_end_overlapped_ex, (const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid))
  3383. #define __itt_task_begin_overlapped_ex(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(task_begin_overlapped_ex,d,x,y,z,a,b)
  3384. #define __itt_task_begin_overlapped_ex_ptr ITTNOTIFY_NAME(task_begin_overlapped_ex)
  3385. #define __itt_task_end_overlapped_ex(d,x,y,z) ITTNOTIFY_VOID_D3(task_end_overlapped_ex,d,x,y,z)
  3386. #define __itt_task_end_overlapped_ex_ptr ITTNOTIFY_NAME(task_end_overlapped_ex)
  3387. #else /* INTEL_NO_ITTNOTIFY_API */
  3388. #define __itt_task_begin_overlapped_ex(domain,clock_domain,timestamp,taskid,parentid,name)
  3389. #define __itt_task_begin_overlapped_ex_ptr 0
  3390. #define __itt_task_end_overlapped_ex(domain,clock_domain,timestamp,taskid)
  3391. #define __itt_task_end_overlapped_ex_ptr 0
  3392. #endif /* INTEL_NO_ITTNOTIFY_API */
  3393. #else /* INTEL_NO_MACRO_BODY */
  3394. #define __itt_task_begin_overlapped_ex_ptr 0
  3395. #define __itt_task_end_overlapped_ptr 0
  3396. #define __itt_task_end_overlapped_ex_ptr 0
  3397. #endif /* INTEL_NO_MACRO_BODY */
  3398. /** @endcond */
  3399. /**
  3400. * @defgroup makrs_internal Marks
  3401. * @ingroup internal
  3402. * Marks group
  3403. * @warning Internal API:
  3404. * - It is not shipped to outside of Intel
  3405. * - It is delivered to internal Intel teams using e-mail or SVN access only
  3406. * @{
  3407. */
  3408. /** @brief user mark type */
  3409. typedef int __itt_mark_type;
  3410. /**
  3411. * @brief Creates a user mark type with the specified name using char or Unicode string.
  3412. * @param[in] name - name of mark to create
  3413. * @return Returns a handle to the mark type
  3414. */
  3415. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3416. __itt_mark_type ITTAPI __itt_mark_createA(const char *name);
  3417. __itt_mark_type ITTAPI __itt_mark_createW(const wchar_t *name);
  3418. #if defined(UNICODE) || defined(_UNICODE)
  3419. # define __itt_mark_create __itt_mark_createW
  3420. # define __itt_mark_create_ptr __itt_mark_createW_ptr
  3421. #else /* UNICODE */
  3422. # define __itt_mark_create __itt_mark_createA
  3423. # define __itt_mark_create_ptr __itt_mark_createA_ptr
  3424. #endif /* UNICODE */
  3425. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3426. __itt_mark_type ITTAPI __itt_mark_create(const char *name);
  3427. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3428. /** @cond exclude_from_documentation */
  3429. #ifndef INTEL_NO_MACRO_BODY
  3430. #ifndef INTEL_NO_ITTNOTIFY_API
  3431. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3432. ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char *name))
  3433. ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name))
  3434. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3435. ITT_STUB(ITTAPI, __itt_mark_type, mark_create, (const char *name))
  3436. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3437. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3438. #define __itt_mark_createA ITTNOTIFY_DATA(mark_createA)
  3439. #define __itt_mark_createA_ptr ITTNOTIFY_NAME(mark_createA)
  3440. #define __itt_mark_createW ITTNOTIFY_DATA(mark_createW)
  3441. #define __itt_mark_createW_ptr ITTNOTIFY_NAME(mark_createW)
  3442. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3443. #define __itt_mark_create ITTNOTIFY_DATA(mark_create)
  3444. #define __itt_mark_create_ptr ITTNOTIFY_NAME(mark_create)
  3445. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3446. #else /* INTEL_NO_ITTNOTIFY_API */
  3447. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3448. #define __itt_mark_createA(name) (__itt_mark_type)0
  3449. #define __itt_mark_createA_ptr 0
  3450. #define __itt_mark_createW(name) (__itt_mark_type)0
  3451. #define __itt_mark_createW_ptr 0
  3452. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3453. #define __itt_mark_create(name) (__itt_mark_type)0
  3454. #define __itt_mark_create_ptr 0
  3455. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3456. #endif /* INTEL_NO_ITTNOTIFY_API */
  3457. #else /* INTEL_NO_MACRO_BODY */
  3458. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3459. #define __itt_mark_createA_ptr 0
  3460. #define __itt_mark_createW_ptr 0
  3461. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3462. #define __itt_mark_create_ptr 0
  3463. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3464. #endif /* INTEL_NO_MACRO_BODY */
  3465. /** @endcond */
  3466. /**
  3467. * @brief Creates a "discrete" user mark type of the specified type and an optional parameter using char or Unicode string.
  3468. *
  3469. * - The mark of "discrete" type is placed to collection results in case of success. It appears in overtime view(s) as a special tick sign.
  3470. * - The call is "synchronous" - function returns after mark is actually added to results.
  3471. * - This function is useful, for example, to mark different phases of application
  3472. * (beginning of the next mark automatically meand end of current region).
  3473. * - Can be used together with "continuous" marks (see below) at the same collection session
  3474. * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
  3475. * @param[in] parameter - string parameter of mark
  3476. * @return Returns zero value in case of success, non-zero value otherwise.
  3477. */
  3478. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3479. int ITTAPI __itt_markA(__itt_mark_type mt, const char *parameter);
  3480. int ITTAPI __itt_markW(__itt_mark_type mt, const wchar_t *parameter);
  3481. #if defined(UNICODE) || defined(_UNICODE)
  3482. # define __itt_mark __itt_markW
  3483. # define __itt_mark_ptr __itt_markW_ptr
  3484. #else /* UNICODE */
  3485. # define __itt_mark __itt_markA
  3486. # define __itt_mark_ptr __itt_markA_ptr
  3487. #endif /* UNICODE */
  3488. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3489. int ITTAPI __itt_mark(__itt_mark_type mt, const char *parameter);
  3490. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3491. /** @cond exclude_from_documentation */
  3492. #ifndef INTEL_NO_MACRO_BODY
  3493. #ifndef INTEL_NO_ITTNOTIFY_API
  3494. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3495. ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char *parameter))
  3496. ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter))
  3497. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3498. ITT_STUB(ITTAPI, int, mark, (__itt_mark_type mt, const char *parameter))
  3499. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3500. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3501. #define __itt_markA ITTNOTIFY_DATA(markA)
  3502. #define __itt_markA_ptr ITTNOTIFY_NAME(markA)
  3503. #define __itt_markW ITTNOTIFY_DATA(markW)
  3504. #define __itt_markW_ptr ITTNOTIFY_NAME(markW)
  3505. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3506. #define __itt_mark ITTNOTIFY_DATA(mark)
  3507. #define __itt_mark_ptr ITTNOTIFY_NAME(mark)
  3508. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3509. #else /* INTEL_NO_ITTNOTIFY_API */
  3510. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3511. #define __itt_markA(mt, parameter) (int)0
  3512. #define __itt_markA_ptr 0
  3513. #define __itt_markW(mt, parameter) (int)0
  3514. #define __itt_markW_ptr 0
  3515. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3516. #define __itt_mark(mt, parameter) (int)0
  3517. #define __itt_mark_ptr 0
  3518. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3519. #endif /* INTEL_NO_ITTNOTIFY_API */
  3520. #else /* INTEL_NO_MACRO_BODY */
  3521. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3522. #define __itt_markA_ptr 0
  3523. #define __itt_markW_ptr 0
  3524. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3525. #define __itt_mark_ptr 0
  3526. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3527. #endif /* INTEL_NO_MACRO_BODY */
  3528. /** @endcond */
  3529. /**
  3530. * @brief Use this if necessary to create a "discrete" user event type (mark) for process
  3531. * rather then for one thread
  3532. * @see int __itt_mark(__itt_mark_type mt, const char* parameter);
  3533. */
  3534. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3535. int ITTAPI __itt_mark_globalA(__itt_mark_type mt, const char *parameter);
  3536. int ITTAPI __itt_mark_globalW(__itt_mark_type mt, const wchar_t *parameter);
  3537. #if defined(UNICODE) || defined(_UNICODE)
  3538. # define __itt_mark_global __itt_mark_globalW
  3539. # define __itt_mark_global_ptr __itt_mark_globalW_ptr
  3540. #else /* UNICODE */
  3541. # define __itt_mark_global __itt_mark_globalA
  3542. # define __itt_mark_global_ptr __itt_mark_globalA_ptr
  3543. #endif /* UNICODE */
  3544. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3545. int ITTAPI __itt_mark_global(__itt_mark_type mt, const char *parameter);
  3546. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3547. /** @cond exclude_from_documentation */
  3548. #ifndef INTEL_NO_MACRO_BODY
  3549. #ifndef INTEL_NO_ITTNOTIFY_API
  3550. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3551. ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char *parameter))
  3552. ITT_STUB(ITTAPI, int, mark_globalW, (__itt_mark_type mt, const wchar_t *parameter))
  3553. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3554. ITT_STUB(ITTAPI, int, mark_global, (__itt_mark_type mt, const char *parameter))
  3555. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3556. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3557. #define __itt_mark_globalA ITTNOTIFY_DATA(mark_globalA)
  3558. #define __itt_mark_globalA_ptr ITTNOTIFY_NAME(mark_globalA)
  3559. #define __itt_mark_globalW ITTNOTIFY_DATA(mark_globalW)
  3560. #define __itt_mark_globalW_ptr ITTNOTIFY_NAME(mark_globalW)
  3561. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3562. #define __itt_mark_global ITTNOTIFY_DATA(mark_global)
  3563. #define __itt_mark_global_ptr ITTNOTIFY_NAME(mark_global)
  3564. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3565. #else /* INTEL_NO_ITTNOTIFY_API */
  3566. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3567. #define __itt_mark_globalA(mt, parameter) (int)0
  3568. #define __itt_mark_globalA_ptr 0
  3569. #define __itt_mark_globalW(mt, parameter) (int)0
  3570. #define __itt_mark_globalW_ptr 0
  3571. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3572. #define __itt_mark_global(mt, parameter) (int)0
  3573. #define __itt_mark_global_ptr 0
  3574. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3575. #endif /* INTEL_NO_ITTNOTIFY_API */
  3576. #else /* INTEL_NO_MACRO_BODY */
  3577. #if ITT_PLATFORM==ITT_PLATFORM_WIN
  3578. #define __itt_mark_globalA_ptr 0
  3579. #define __itt_mark_globalW_ptr 0
  3580. #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3581. #define __itt_mark_global_ptr 0
  3582. #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
  3583. #endif /* INTEL_NO_MACRO_BODY */
  3584. /** @endcond */
  3585. /**
  3586. * @brief Creates an "end" point for "continuous" mark with specified name.
  3587. *
  3588. * - Returns zero value in case of success, non-zero value otherwise.
  3589. * Also returns non-zero value when preceding "begin" point for the
  3590. * mark with the same name failed to be created or not created.
  3591. * - The mark of "continuous" type is placed to collection results in
  3592. * case of success. It appears in overtime view(s) as a special tick
  3593. * sign (different from "discrete" mark) together with line from
  3594. * corresponding "begin" mark to "end" mark.
  3595. * @note Continuous marks can overlap and be nested inside each other.
  3596. * Discrete mark can be nested inside marked region
  3597. * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
  3598. * @return Returns zero value in case of success, non-zero value otherwise.
  3599. */
  3600. int ITTAPI __itt_mark_off(__itt_mark_type mt);
  3601. /** @cond exclude_from_documentation */
  3602. #ifndef INTEL_NO_MACRO_BODY
  3603. #ifndef INTEL_NO_ITTNOTIFY_API
  3604. ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt))
  3605. #define __itt_mark_off ITTNOTIFY_DATA(mark_off)
  3606. #define __itt_mark_off_ptr ITTNOTIFY_NAME(mark_off)
  3607. #else /* INTEL_NO_ITTNOTIFY_API */
  3608. #define __itt_mark_off(mt) (int)0
  3609. #define __itt_mark_off_ptr 0
  3610. #endif /* INTEL_NO_ITTNOTIFY_API */
  3611. #else /* INTEL_NO_MACRO_BODY */
  3612. #define __itt_mark_off_ptr 0
  3613. #endif /* INTEL_NO_MACRO_BODY */
  3614. /** @endcond */
  3615. /**
  3616. * @brief Use this if necessary to create an "end" point for mark of process
  3617. * @see int __itt_mark_off(__itt_mark_type mt);
  3618. */
  3619. int ITTAPI __itt_mark_global_off(__itt_mark_type mt);
  3620. /** @cond exclude_from_documentation */
  3621. #ifndef INTEL_NO_MACRO_BODY
  3622. #ifndef INTEL_NO_ITTNOTIFY_API
  3623. ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt))
  3624. #define __itt_mark_global_off ITTNOTIFY_DATA(mark_global_off)
  3625. #define __itt_mark_global_off_ptr ITTNOTIFY_NAME(mark_global_off)
  3626. #else /* INTEL_NO_ITTNOTIFY_API */
  3627. #define __itt_mark_global_off(mt) (int)0
  3628. #define __itt_mark_global_off_ptr 0
  3629. #endif /* INTEL_NO_ITTNOTIFY_API */
  3630. #else /* INTEL_NO_MACRO_BODY */
  3631. #define __itt_mark_global_off_ptr 0
  3632. #endif /* INTEL_NO_MACRO_BODY */
  3633. /** @endcond */
  3634. /** @} marks group */
  3635. /**
  3636. * @defgroup counters_internal Counters
  3637. * @ingroup internal
  3638. * Counters group
  3639. * @{
  3640. */
  3641. /**
  3642. * @defgroup stitch Stack Stitching
  3643. * @ingroup internal
  3644. * Stack Stitching group
  3645. * @{
  3646. */
  3647. /**
  3648. * @brief opaque structure for counter identification
  3649. */
  3650. typedef struct ___itt_caller *__itt_caller;
  3651. /**
  3652. * @brief Create the stitch point e.g. a point in call stack where other stacks should be stitched to.
  3653. * The function returns a unique identifier which is used to match the cut points with corresponding stitch points.
  3654. */
  3655. __itt_caller ITTAPI __itt_stack_caller_create(void);
  3656. /** @cond exclude_from_documentation */
  3657. #ifndef INTEL_NO_MACRO_BODY
  3658. #ifndef INTEL_NO_ITTNOTIFY_API
  3659. ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
  3660. #define __itt_stack_caller_create ITTNOTIFY_DATA(stack_caller_create)
  3661. #define __itt_stack_caller_create_ptr ITTNOTIFY_NAME(stack_caller_create)
  3662. #else /* INTEL_NO_ITTNOTIFY_API */
  3663. #define __itt_stack_caller_create() (__itt_caller)0
  3664. #define __itt_stack_caller_create_ptr 0
  3665. #endif /* INTEL_NO_ITTNOTIFY_API */
  3666. #else /* INTEL_NO_MACRO_BODY */
  3667. #define __itt_stack_caller_create_ptr 0
  3668. #endif /* INTEL_NO_MACRO_BODY */
  3669. /** @endcond */
  3670. /**
  3671. * @brief Destroy the inforamtion about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
  3672. */
  3673. void ITTAPI __itt_stack_caller_destroy(__itt_caller id);
  3674. /** @cond exclude_from_documentation */
  3675. #ifndef INTEL_NO_MACRO_BODY
  3676. #ifndef INTEL_NO_ITTNOTIFY_API
  3677. ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id))
  3678. #define __itt_stack_caller_destroy ITTNOTIFY_VOID(stack_caller_destroy)
  3679. #define __itt_stack_caller_destroy_ptr ITTNOTIFY_NAME(stack_caller_destroy)
  3680. #else /* INTEL_NO_ITTNOTIFY_API */
  3681. #define __itt_stack_caller_destroy(id)
  3682. #define __itt_stack_caller_destroy_ptr 0
  3683. #endif /* INTEL_NO_ITTNOTIFY_API */
  3684. #else /* INTEL_NO_MACRO_BODY */
  3685. #define __itt_stack_caller_destroy_ptr 0
  3686. #endif /* INTEL_NO_MACRO_BODY */
  3687. /** @endcond */
  3688. /**
  3689. * @brief Sets the cut point. Stack from each event which occurs after this call will be cut
  3690. * at the same stack level the function was called and stitched to the corresponding stitch point.
  3691. */
  3692. void ITTAPI __itt_stack_callee_enter(__itt_caller id);
  3693. /** @cond exclude_from_documentation */
  3694. #ifndef INTEL_NO_MACRO_BODY
  3695. #ifndef INTEL_NO_ITTNOTIFY_API
  3696. ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id))
  3697. #define __itt_stack_callee_enter ITTNOTIFY_VOID(stack_callee_enter)
  3698. #define __itt_stack_callee_enter_ptr ITTNOTIFY_NAME(stack_callee_enter)
  3699. #else /* INTEL_NO_ITTNOTIFY_API */
  3700. #define __itt_stack_callee_enter(id)
  3701. #define __itt_stack_callee_enter_ptr 0
  3702. #endif /* INTEL_NO_ITTNOTIFY_API */
  3703. #else /* INTEL_NO_MACRO_BODY */
  3704. #define __itt_stack_callee_enter_ptr 0
  3705. #endif /* INTEL_NO_MACRO_BODY */
  3706. /** @endcond */
  3707. /**
  3708. * @brief This function eliminates the cut point which was set by latest __itt_stack_callee_enter().
  3709. */
  3710. void ITTAPI __itt_stack_callee_leave(__itt_caller id);
  3711. /** @cond exclude_from_documentation */
  3712. #ifndef INTEL_NO_MACRO_BODY
  3713. #ifndef INTEL_NO_ITTNOTIFY_API
  3714. ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id))
  3715. #define __itt_stack_callee_leave ITTNOTIFY_VOID(stack_callee_leave)
  3716. #define __itt_stack_callee_leave_ptr ITTNOTIFY_NAME(stack_callee_leave)
  3717. #else /* INTEL_NO_ITTNOTIFY_API */
  3718. #define __itt_stack_callee_leave(id)
  3719. #define __itt_stack_callee_leave_ptr 0
  3720. #endif /* INTEL_NO_ITTNOTIFY_API */
  3721. #else /* INTEL_NO_MACRO_BODY */
  3722. #define __itt_stack_callee_leave_ptr 0
  3723. #endif /* INTEL_NO_MACRO_BODY */
  3724. /** @endcond */
  3725. /** @} stitch group */
  3726. /* ***************************************************************************************************************************** */
  3727. #include <stdarg.h>
  3728. /** @cond exclude_from_documentation */
  3729. typedef enum __itt_error_code
  3730. {
  3731. __itt_error_success = 0, /*!< no error */
  3732. __itt_error_no_module = 1, /*!< module can't be loaded */
  3733. /* %1$s -- library name; win: %2$d -- system error code; unx: %2$s -- system error message. */
  3734. __itt_error_no_symbol = 2, /*!< symbol not found */
  3735. /* %1$s -- library name, %2$s -- symbol name. */
  3736. __itt_error_unknown_group = 3, /*!< unknown group specified */
  3737. /* %1$s -- env var name, %2$s -- group name. */
  3738. __itt_error_cant_read_env = 4, /*!< GetEnvironmentVariable() failed */
  3739. /* %1$s -- env var name, %2$d -- system error. */
  3740. __itt_error_env_too_long = 5, /*!< variable value too long */
  3741. /* %1$s -- env var name, %2$d -- actual length of the var, %3$d -- max allowed length. */
  3742. __itt_error_system = 6 /*!< pthread_mutexattr_init or pthread_mutex_init failed */
  3743. /* %1$s -- function name, %2$d -- errno. */
  3744. } __itt_error_code;
  3745. typedef void (__itt_error_handler_t)(__itt_error_code code, va_list);
  3746. __itt_error_handler_t* __itt_set_error_handler(__itt_error_handler_t*);
  3747. const char* ITTAPI __itt_api_version(void);
  3748. /** @endcond */
  3749. /** @cond exclude_from_documentation */
  3750. #ifndef INTEL_NO_MACRO_BODY
  3751. #ifndef INTEL_NO_ITTNOTIFY_API
  3752. #define __itt_error_handler ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, error_handler)
  3753. void __itt_error_handler(__itt_error_code code, va_list args);
  3754. extern const int ITTNOTIFY_NAME(err);
  3755. #define __itt_err ITTNOTIFY_NAME(err)
  3756. ITT_STUB(ITTAPI, const char*, api_version, (void))
  3757. #define __itt_api_version ITTNOTIFY_DATA(api_version)
  3758. #define __itt_api_version_ptr ITTNOTIFY_NAME(api_version)
  3759. #else /* INTEL_NO_ITTNOTIFY_API */
  3760. #define __itt_api_version() (const char*)0
  3761. #define __itt_api_version_ptr 0
  3762. #endif /* INTEL_NO_ITTNOTIFY_API */
  3763. #else /* INTEL_NO_MACRO_BODY */
  3764. #define __itt_api_version_ptr 0
  3765. #endif /* INTEL_NO_MACRO_BODY */
  3766. /** @endcond */
  3767. #ifdef __cplusplus
  3768. }
  3769. #endif /* __cplusplus */
  3770. #endif /* _ITTNOTIFY_PRIVATE_ */
  3771. #endif /* INTEL_ITTNOTIFY_API_PRIVATE */