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