ittnotify.h 192 KB

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