ittnotify.h 195 KB

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