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