1 /* 2 Copyright (c) 2005-2021 Intel Corporation 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 #ifndef _LEGACY_ITTNOTIFY_H_ 18 #define _LEGACY_ITTNOTIFY_H_ 19 20 /** 21 * @file 22 * @brief Legacy User API functions and types 23 */ 24 25 /** @cond exclude_from_documentation */ 26 #ifndef ITT_OS_WIN 27 # define ITT_OS_WIN 1 28 #endif /* ITT_OS_WIN */ 29 30 #ifndef ITT_OS_LINUX 31 # define ITT_OS_LINUX 2 32 #endif /* ITT_OS_LINUX */ 33 34 #ifndef ITT_OS_MAC 35 # define ITT_OS_MAC 3 36 #endif /* ITT_OS_MAC */ 37 38 #ifndef ITT_OS_FREEBSD 39 # define ITT_OS_FREEBSD 4 40 #endif /* ITT_OS_FREEBSD */ 41 42 #ifndef ITT_OS 43 # if defined WIN32 || defined _WIN32 44 # define ITT_OS ITT_OS_WIN 45 # elif defined( __APPLE__ ) && defined( __MACH__ ) 46 # define ITT_OS ITT_OS_MAC 47 # elif defined( __FreeBSD__ ) 48 # define ITT_OS ITT_OS_FREEBSD 49 # else 50 # define ITT_OS ITT_OS_LINUX 51 # endif 52 #endif /* ITT_OS */ 53 54 #ifndef ITT_PLATFORM_WIN 55 # define ITT_PLATFORM_WIN 1 56 #endif /* ITT_PLATFORM_WIN */ 57 58 #ifndef ITT_PLATFORM_POSIX 59 # define ITT_PLATFORM_POSIX 2 60 #endif /* ITT_PLATFORM_POSIX */ 61 62 #ifndef ITT_PLATFORM_MAC 63 # define ITT_PLATFORM_MAC 3 64 #endif /* ITT_PLATFORM_MAC */ 65 66 #ifndef ITT_PLATFORM_FREEBSD 67 # define ITT_PLATFORM_FREEBSD 4 68 #endif /* ITT_PLATFORM_FREEBSD */ 69 70 #ifndef ITT_PLATFORM 71 # if ITT_OS==ITT_OS_WIN 72 # define ITT_PLATFORM ITT_PLATFORM_WIN 73 # elif ITT_OS==ITT_OS_MAC 74 # define ITT_PLATFORM ITT_PLATFORM_MAC 75 # elif ITT_OS==ITT_OS_FREEBSD 76 # define ITT_PLATFORM ITT_PLATFORM_FREEBSD 77 # else 78 # define ITT_PLATFORM ITT_PLATFORM_POSIX 79 # endif 80 #endif /* ITT_PLATFORM */ 81 82 #if defined(_UNICODE) && !defined(UNICODE) 83 #define UNICODE 84 #endif 85 86 #include <stddef.h> 87 #if ITT_PLATFORM==ITT_PLATFORM_WIN 88 #include <tchar.h> 89 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 90 #include <stdint.h> 91 #if defined(UNICODE) || defined(_UNICODE) 92 #include <wchar.h> 93 #endif /* UNICODE || _UNICODE */ 94 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 95 96 #ifndef ITTAPI_CDECL 97 # if ITT_PLATFORM==ITT_PLATFORM_WIN 98 # define ITTAPI_CDECL __cdecl 99 # else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 100 # if defined _M_IX86 || defined __i386__ 101 # define ITTAPI_CDECL __attribute__ ((cdecl)) 102 # else /* _M_IX86 || __i386__ */ 103 # define ITTAPI_CDECL /* actual only on x86 platform */ 104 # endif /* _M_IX86 || __i386__ */ 105 # endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 106 #endif /* ITTAPI_CDECL */ 107 108 #ifndef STDCALL 109 # if ITT_PLATFORM==ITT_PLATFORM_WIN 110 # define STDCALL __stdcall 111 # else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 112 # if defined _M_IX86 || defined __i386__ 113 # define STDCALL __attribute__ ((stdcall)) 114 # else /* _M_IX86 || __i386__ */ 115 # define STDCALL /* supported only on x86 platform */ 116 # endif /* _M_IX86 || __i386__ */ 117 # endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 118 #endif /* STDCALL */ 119 120 #define ITTAPI ITTAPI_CDECL 121 #define LIBITTAPI ITTAPI_CDECL 122 123 /* TODO: Temporary for compatibility! */ 124 #define ITTAPI_CALL ITTAPI_CDECL 125 #define LIBITTAPI_CALL ITTAPI_CDECL 126 127 #if ITT_PLATFORM==ITT_PLATFORM_WIN 128 /* use __forceinline (VC++ specific) */ 129 #define ITT_INLINE static __forceinline 130 #define ITT_INLINE_ATTRIBUTE /* nothing */ 131 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 132 /* 133 * Generally, functions are not inlined unless optimization is specified. 134 * For functions declared inline, this attribute inlines the function even 135 * if no optimization level was specified. 136 */ 137 #ifdef __STRICT_ANSI__ 138 #define ITT_INLINE static 139 #define ITT_INLINE_ATTRIBUTE __attribute__((unused)) 140 #else /* __STRICT_ANSI__ */ 141 #define ITT_INLINE static inline 142 #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused)) 143 #endif /* __STRICT_ANSI__ */ 144 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 145 /** @endcond */ 146 147 /** @cond exclude_from_documentation */ 148 /* Helper macro for joining tokens */ 149 #define ITT_JOIN_AUX(p,n) p##n 150 #define ITT_JOIN(p,n) ITT_JOIN_AUX(p,n) 151 152 #ifdef ITT_MAJOR 153 #undef ITT_MAJOR 154 #endif 155 #ifdef ITT_MINOR 156 #undef ITT_MINOR 157 #endif 158 #define ITT_MAJOR 3 159 #define ITT_MINOR 0 160 161 /* Standard versioning of a token with major and minor version numbers */ 162 #define ITT_VERSIONIZE(x) \ 163 ITT_JOIN(x, \ 164 ITT_JOIN(_, \ 165 ITT_JOIN(ITT_MAJOR, \ 166 ITT_JOIN(_, ITT_MINOR)))) 167 168 #ifndef INTEL_ITTNOTIFY_PREFIX 169 # define INTEL_ITTNOTIFY_PREFIX __itt_ 170 #endif /* INTEL_ITTNOTIFY_PREFIX */ 171 #ifndef INTEL_ITTNOTIFY_POSTFIX 172 # define INTEL_ITTNOTIFY_POSTFIX _ptr_ 173 #endif /* INTEL_ITTNOTIFY_POSTFIX */ 174 175 #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n) 176 #define ITTNOTIFY_NAME(n) ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX))) 177 178 #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n) 179 #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n) 180 181 #define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d) 182 #define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x) 183 #define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y) 184 #define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z) 185 #define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a) 186 #define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b) 187 #define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c) 188 #define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d) 189 #define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x) 190 #define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y) 191 #define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z) 192 #define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a) 193 #define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b) 194 #define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c) 195 196 #ifdef ITT_STUB 197 #undef ITT_STUB 198 #endif 199 #ifdef ITT_STUBV 200 #undef ITT_STUBV 201 #endif 202 #define ITT_STUBV(api,type,name,args) \ 203 typedef type (api* ITT_JOIN(ITTNOTIFY_NAME(name),_t)) args; \ 204 extern ITT_JOIN(ITTNOTIFY_NAME(name),_t) ITTNOTIFY_NAME(name); 205 #define ITT_STUB ITT_STUBV 206 /** @endcond */ 207 208 #ifdef __cplusplus 209 extern "C" { 210 #endif /* __cplusplus */ 211 212 /** 213 * @defgroup legacy Legacy API 214 * @{ 215 * @} 216 */ 217 218 /** 219 * @defgroup legacy_control Collection Control 220 * @ingroup legacy 221 * General behavior: application continues to run, but no profiling information is being collected 222 * 223 * Pausing occurs not only for the current thread but for all process as well as spawned processes 224 * - Intel(R) Parallel Inspector and Intel(R) Inspector XE: 225 * - Does not analyze or report errors that involve memory access. 226 * - Other errors are reported as usual. Pausing data collection in 227 * Intel(R) Parallel Inspector and Intel(R) Inspector XE 228 * only pauses tracing and analyzing memory access. 229 * It does not pause tracing or analyzing threading APIs. 230 * . 231 * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE: 232 * - Does continue to record when new threads are started. 233 * . 234 * - Other effects: 235 * - Possible reduction of runtime overhead. 236 * . 237 * @{ 238 */ 239 #ifndef _ITTNOTIFY_H_ 240 /** @brief Pause collection */ 241 void ITTAPI __itt_pause(void); 242 /** @brief Resume collection */ 243 void ITTAPI __itt_resume(void); 244 /** @brief Detach collection */ 245 void ITTAPI __itt_detach(void); 246 247 /** @cond exclude_from_documentation */ 248 #ifndef INTEL_NO_MACRO_BODY 249 #ifndef INTEL_NO_ITTNOTIFY_API 250 ITT_STUBV(ITTAPI, void, pause, (void)) 251 ITT_STUBV(ITTAPI, void, resume, (void)) 252 ITT_STUBV(ITTAPI, void, detach, (void)) 253 #define __itt_pause ITTNOTIFY_VOID(pause) 254 #define __itt_pause_ptr ITTNOTIFY_NAME(pause) 255 #define __itt_resume ITTNOTIFY_VOID(resume) 256 #define __itt_resume_ptr ITTNOTIFY_NAME(resume) 257 #define __itt_detach ITTNOTIFY_VOID(detach) 258 #define __itt_detach_ptr ITTNOTIFY_NAME(detach) 259 #else /* INTEL_NO_ITTNOTIFY_API */ 260 #define __itt_pause() 261 #define __itt_pause_ptr 0 262 #define __itt_resume() 263 #define __itt_resume_ptr 0 264 #define __itt_detach() 265 #define __itt_detach_ptr 0 266 #endif /* INTEL_NO_ITTNOTIFY_API */ 267 #else /* INTEL_NO_MACRO_BODY */ 268 #define __itt_pause_ptr 0 269 #define __itt_resume_ptr 0 270 #define __itt_detach_ptr 0 271 #endif /* INTEL_NO_MACRO_BODY */ 272 /** @endcond */ 273 #endif /* _ITTNOTIFY_H_ */ 274 /** @} legacy_control group */ 275 276 /** 277 * @defgroup legacy_threads Threads 278 * @ingroup legacy 279 * Threads group 280 * @warning Legacy API 281 * @{ 282 */ 283 /** 284 * @deprecated Legacy API 285 * @brief Set name to be associated with thread in analysis GUI. 286 * @return __itt_err upon failure (name or namelen being null,name and namelen mismatched) 287 */ 288 #if ITT_PLATFORM==ITT_PLATFORM_WIN 289 int LIBITTAPI __itt_thr_name_setA(const char *name, int namelen); 290 int LIBITTAPI __itt_thr_name_setW(const wchar_t *name, int namelen); 291 #if defined(UNICODE) || defined(_UNICODE) 292 # define __itt_thr_name_set __itt_thr_name_setW 293 # define __itt_thr_name_set_ptr __itt_thr_name_setW_ptr 294 #else 295 # define __itt_thr_name_set __itt_thr_name_setA 296 # define __itt_thr_name_set_ptr __itt_thr_name_setA_ptr 297 #endif /* UNICODE */ 298 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 299 int LIBITTAPI __itt_thr_name_set(const char *name, int namelen); 300 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 301 302 /** @cond exclude_from_documentation */ 303 #ifndef INTEL_NO_MACRO_BODY 304 #ifndef INTEL_NO_ITTNOTIFY_API 305 #if ITT_PLATFORM==ITT_PLATFORM_WIN 306 ITT_STUB(LIBITTAPI, int, thr_name_setA, (const char *name, int namelen)) 307 ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen)) 308 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 309 ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen)) 310 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 311 #if ITT_PLATFORM==ITT_PLATFORM_WIN 312 #define __itt_thr_name_setA ITTNOTIFY_DATA(thr_name_setA) 313 #define __itt_thr_name_setA_ptr ITTNOTIFY_NAME(thr_name_setA) 314 #define __itt_thr_name_setW ITTNOTIFY_DATA(thr_name_setW) 315 #define __itt_thr_name_setW_ptr ITTNOTIFY_NAME(thr_name_setW) 316 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 317 #define __itt_thr_name_set ITTNOTIFY_DATA(thr_name_set) 318 #define __itt_thr_name_set_ptr ITTNOTIFY_NAME(thr_name_set) 319 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 320 #else /* INTEL_NO_ITTNOTIFY_API */ 321 #if ITT_PLATFORM==ITT_PLATFORM_WIN 322 #define __itt_thr_name_setA(name, namelen) 323 #define __itt_thr_name_setA_ptr 0 324 #define __itt_thr_name_setW(name, namelen) 325 #define __itt_thr_name_setW_ptr 0 326 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 327 #define __itt_thr_name_set(name, namelen) 328 #define __itt_thr_name_set_ptr 0 329 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 330 #endif /* INTEL_NO_ITTNOTIFY_API */ 331 #else /* INTEL_NO_MACRO_BODY */ 332 #if ITT_PLATFORM==ITT_PLATFORM_WIN 333 #define __itt_thr_name_setA_ptr 0 334 #define __itt_thr_name_setW_ptr 0 335 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 336 #define __itt_thr_name_set_ptr 0 337 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 338 #endif /* INTEL_NO_MACRO_BODY */ 339 /** @endcond */ 340 341 /** 342 * @deprecated Legacy API 343 * @brief Mark current thread as ignored from this point on, for the duration of its existence. 344 */ 345 void LIBITTAPI __itt_thr_ignore(void); 346 347 /** @cond exclude_from_documentation */ 348 #ifndef INTEL_NO_MACRO_BODY 349 #ifndef INTEL_NO_ITTNOTIFY_API 350 ITT_STUBV(LIBITTAPI, void, thr_ignore, (void)) 351 #define __itt_thr_ignore ITTNOTIFY_VOID(thr_ignore) 352 #define __itt_thr_ignore_ptr ITTNOTIFY_NAME(thr_ignore) 353 #else /* INTEL_NO_ITTNOTIFY_API */ 354 #define __itt_thr_ignore() 355 #define __itt_thr_ignore_ptr 0 356 #endif /* INTEL_NO_ITTNOTIFY_API */ 357 #else /* INTEL_NO_MACRO_BODY */ 358 #define __itt_thr_ignore_ptr 0 359 #endif /* INTEL_NO_MACRO_BODY */ 360 /** @endcond */ 361 /** @} legacy_threads group */ 362 363 /** 364 * @defgroup legacy_sync Synchronization 365 * @ingroup legacy 366 * Synchronization group 367 * @warning Legacy API 368 * @{ 369 */ 370 /** 371 * @hideinitializer 372 * @brief possible value of attribute argument for sync object type 373 */ 374 #define __itt_attr_barrier 1 375 376 /** 377 * @hideinitializer 378 * @brief possible value of attribute argument for sync object type 379 */ 380 #define __itt_attr_mutex 2 381 382 /** 383 * @deprecated Legacy API 384 * @brief Assign a name to a sync object using char or Unicode string 385 * @param[in] addr - pointer to the sync object. You should use a real pointer to your object 386 * to make sure that the values don't clash with other object addresses 387 * @param[in] objtype - null-terminated object type string. If NULL is passed, the object will 388 * be assumed to be of generic "User Synchronization" type 389 * @param[in] objname - null-terminated object name string. If NULL, no name will be assigned 390 * to the object -- you can use the __itt_sync_rename call later to assign 391 * the name 392 * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values which defines the 393 * exact semantics of how prepare/acquired/releasing calls work. 394 */ 395 #if ITT_PLATFORM==ITT_PLATFORM_WIN 396 void ITTAPI __itt_sync_set_nameA(void *addr, const char *objtype, const char *objname, int attribute); 397 void ITTAPI __itt_sync_set_nameW(void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute); 398 #if defined(UNICODE) || defined(_UNICODE) 399 # define __itt_sync_set_name __itt_sync_set_nameW 400 # define __itt_sync_set_name_ptr __itt_sync_set_nameW_ptr 401 #else /* UNICODE */ 402 # define __itt_sync_set_name __itt_sync_set_nameA 403 # define __itt_sync_set_name_ptr __itt_sync_set_nameA_ptr 404 #endif /* UNICODE */ 405 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 406 void ITTAPI __itt_sync_set_name(void *addr, const char* objtype, const char* objname, int attribute); 407 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 408 409 /** @cond exclude_from_documentation */ 410 #ifndef INTEL_NO_MACRO_BODY 411 #ifndef INTEL_NO_ITTNOTIFY_API 412 #if ITT_PLATFORM==ITT_PLATFORM_WIN 413 ITT_STUBV(ITTAPI, void, sync_set_nameA, (void *addr, const char *objtype, const char *objname, int attribute)) 414 ITT_STUBV(ITTAPI, void, sync_set_nameW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute)) 415 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 416 ITT_STUBV(ITTAPI, void, sync_set_name, (void *addr, const char *objtype, const char *objname, int attribute)) 417 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 418 #if ITT_PLATFORM==ITT_PLATFORM_WIN 419 #define __itt_sync_set_nameA ITTNOTIFY_VOID(sync_set_nameA) 420 #define __itt_sync_set_nameA_ptr ITTNOTIFY_NAME(sync_set_nameA) 421 #define __itt_sync_set_nameW ITTNOTIFY_VOID(sync_set_nameW) 422 #define __itt_sync_set_nameW_ptr ITTNOTIFY_NAME(sync_set_nameW) 423 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 424 #define __itt_sync_set_name ITTNOTIFY_VOID(sync_set_name) 425 #define __itt_sync_set_name_ptr ITTNOTIFY_NAME(sync_set_name) 426 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 427 #else /* INTEL_NO_ITTNOTIFY_API */ 428 #if ITT_PLATFORM==ITT_PLATFORM_WIN 429 #define __itt_sync_set_nameA(addr, objtype, objname, attribute) 430 #define __itt_sync_set_nameA_ptr 0 431 #define __itt_sync_set_nameW(addr, objtype, objname, attribute) 432 #define __itt_sync_set_nameW_ptr 0 433 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 434 #define __itt_sync_set_name(addr, objtype, objname, attribute) 435 #define __itt_sync_set_name_ptr 0 436 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 437 #endif /* INTEL_NO_ITTNOTIFY_API */ 438 #else /* INTEL_NO_MACRO_BODY */ 439 #if ITT_PLATFORM==ITT_PLATFORM_WIN 440 #define __itt_sync_set_nameA_ptr 0 441 #define __itt_sync_set_nameW_ptr 0 442 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 443 #define __itt_sync_set_name_ptr 0 444 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 445 #endif /* INTEL_NO_MACRO_BODY */ 446 /** @endcond */ 447 448 /** 449 * @deprecated Legacy API 450 * @brief Assign a name and type to a sync object using char or Unicode string 451 * @param[in] addr - pointer to the sync object. You should use a real pointer to your object 452 * to make sure that the values don't clash with other object addresses 453 * @param[in] objtype - null-terminated object type string. If NULL is passed, the object will 454 * be assumed to be of generic "User Synchronization" type 455 * @param[in] objname - null-terminated object name string. If NULL, no name will be assigned 456 * to the object -- you can use the __itt_sync_rename call later to assign 457 * the name 458 * @param[in] typelen, namelen - a length of string for appropriate objtype and objname parameter 459 * @param[in] attribute - one of [#__itt_attr_barrier, #__itt_attr_mutex] values which defines the 460 * exact semantics of how prepare/acquired/releasing calls work. 461 * @return __itt_err upon failure (name or namelen being null,name and namelen mismatched) 462 */ 463 #if ITT_PLATFORM==ITT_PLATFORM_WIN 464 int LIBITTAPI __itt_notify_sync_nameA(void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute); 465 int LIBITTAPI __itt_notify_sync_nameW(void *addr, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute); 466 #if defined(UNICODE) || defined(_UNICODE) 467 # define __itt_notify_sync_name __itt_notify_sync_nameW 468 #else 469 # define __itt_notify_sync_name __itt_notify_sync_nameA 470 #endif 471 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 472 int LIBITTAPI __itt_notify_sync_name(void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute); 473 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 474 475 /** @cond exclude_from_documentation */ 476 #ifndef INTEL_NO_MACRO_BODY 477 #ifndef INTEL_NO_ITTNOTIFY_API 478 #if ITT_PLATFORM==ITT_PLATFORM_WIN 479 ITT_STUB(LIBITTAPI, int, notify_sync_nameA, (void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute)) 480 ITT_STUB(LIBITTAPI, int, notify_sync_nameW, (void *addr, const wchar_t *objtype, int typelen, const wchar_t *objname, int namelen, int attribute)) 481 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 482 ITT_STUB(LIBITTAPI, int, notify_sync_name, (void *addr, const char *objtype, int typelen, const char *objname, int namelen, int attribute)) 483 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 484 #if ITT_PLATFORM==ITT_PLATFORM_WIN 485 #define __itt_notify_sync_nameA ITTNOTIFY_DATA(notify_sync_nameA) 486 #define __itt_notify_sync_nameA_ptr ITTNOTIFY_NAME(notify_sync_nameA) 487 #define __itt_notify_sync_nameW ITTNOTIFY_DATA(notify_sync_nameW) 488 #define __itt_notify_sync_nameW_ptr ITTNOTIFY_NAME(notify_sync_nameW) 489 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 490 #define __itt_notify_sync_name ITTNOTIFY_DATA(notify_sync_name) 491 #define __itt_notify_sync_name_ptr ITTNOTIFY_NAME(notify_sync_name) 492 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 493 #else /* INTEL_NO_ITTNOTIFY_API */ 494 #if ITT_PLATFORM==ITT_PLATFORM_WIN 495 #define __itt_notify_sync_nameA(addr, objtype, typelen, objname, namelen, attribute) 496 #define __itt_notify_sync_nameA_ptr 0 497 #define __itt_notify_sync_nameW(addr, objtype, typelen, objname, namelen, attribute) 498 #define __itt_notify_sync_nameW_ptr 0 499 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 500 #define __itt_notify_sync_name(addr, objtype, typelen, objname, namelen, attribute) 501 #define __itt_notify_sync_name_ptr 0 502 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 503 #endif /* INTEL_NO_ITTNOTIFY_API */ 504 #else /* INTEL_NO_MACRO_BODY */ 505 #if ITT_PLATFORM==ITT_PLATFORM_WIN 506 #define __itt_notify_sync_nameA_ptr 0 507 #define __itt_notify_sync_nameW_ptr 0 508 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 509 #define __itt_notify_sync_name_ptr 0 510 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 511 #endif /* INTEL_NO_MACRO_BODY */ 512 /** @endcond */ 513 514 /** 515 * @deprecated Legacy API 516 * @brief Enter spin loop on user-defined sync object 517 */ 518 void LIBITTAPI __itt_notify_sync_prepare(void* addr); 519 520 /** @cond exclude_from_documentation */ 521 #ifndef INTEL_NO_MACRO_BODY 522 #ifndef INTEL_NO_ITTNOTIFY_API 523 ITT_STUBV(LIBITTAPI, void, notify_sync_prepare, (void *addr)) 524 #define __itt_notify_sync_prepare ITTNOTIFY_VOID(notify_sync_prepare) 525 #define __itt_notify_sync_prepare_ptr ITTNOTIFY_NAME(notify_sync_prepare) 526 #else /* INTEL_NO_ITTNOTIFY_API */ 527 #define __itt_notify_sync_prepare(addr) 528 #define __itt_notify_sync_prepare_ptr 0 529 #endif /* INTEL_NO_ITTNOTIFY_API */ 530 #else /* INTEL_NO_MACRO_BODY */ 531 #define __itt_notify_sync_prepare_ptr 0 532 #endif /* INTEL_NO_MACRO_BODY */ 533 /** @endcond */ 534 535 /** 536 * @deprecated Legacy API 537 * @brief Quit spin loop without acquiring spin object 538 */ 539 void LIBITTAPI __itt_notify_sync_cancel(void *addr); 540 541 /** @cond exclude_from_documentation */ 542 #ifndef INTEL_NO_MACRO_BODY 543 #ifndef INTEL_NO_ITTNOTIFY_API 544 ITT_STUBV(LIBITTAPI, void, notify_sync_cancel, (void *addr)) 545 #define __itt_notify_sync_cancel ITTNOTIFY_VOID(notify_sync_cancel) 546 #define __itt_notify_sync_cancel_ptr ITTNOTIFY_NAME(notify_sync_cancel) 547 #else /* INTEL_NO_ITTNOTIFY_API */ 548 #define __itt_notify_sync_cancel(addr) 549 #define __itt_notify_sync_cancel_ptr 0 550 #endif /* INTEL_NO_ITTNOTIFY_API */ 551 #else /* INTEL_NO_MACRO_BODY */ 552 #define __itt_notify_sync_cancel_ptr 0 553 #endif /* INTEL_NO_MACRO_BODY */ 554 /** @endcond */ 555 556 /** 557 * @deprecated Legacy API 558 * @brief Successful spin loop completion (sync object acquired) 559 */ 560 void LIBITTAPI __itt_notify_sync_acquired(void *addr); 561 562 /** @cond exclude_from_documentation */ 563 #ifndef INTEL_NO_MACRO_BODY 564 #ifndef INTEL_NO_ITTNOTIFY_API 565 ITT_STUBV(LIBITTAPI, void, notify_sync_acquired, (void *addr)) 566 #define __itt_notify_sync_acquired ITTNOTIFY_VOID(notify_sync_acquired) 567 #define __itt_notify_sync_acquired_ptr ITTNOTIFY_NAME(notify_sync_acquired) 568 #else /* INTEL_NO_ITTNOTIFY_API */ 569 #define __itt_notify_sync_acquired(addr) 570 #define __itt_notify_sync_acquired_ptr 0 571 #endif /* INTEL_NO_ITTNOTIFY_API */ 572 #else /* INTEL_NO_MACRO_BODY */ 573 #define __itt_notify_sync_acquired_ptr 0 574 #endif /* INTEL_NO_MACRO_BODY */ 575 /** @endcond */ 576 577 /** 578 * @deprecated Legacy API 579 * @brief Start sync object releasing code. Is called before the lock release call. 580 */ 581 void LIBITTAPI __itt_notify_sync_releasing(void* addr); 582 583 /** @cond exclude_from_documentation */ 584 #ifndef INTEL_NO_MACRO_BODY 585 #ifndef INTEL_NO_ITTNOTIFY_API 586 ITT_STUBV(LIBITTAPI, void, notify_sync_releasing, (void *addr)) 587 #define __itt_notify_sync_releasing ITTNOTIFY_VOID(notify_sync_releasing) 588 #define __itt_notify_sync_releasing_ptr ITTNOTIFY_NAME(notify_sync_releasing) 589 #else /* INTEL_NO_ITTNOTIFY_API */ 590 #define __itt_notify_sync_releasing(addr) 591 #define __itt_notify_sync_releasing_ptr 0 592 #endif /* INTEL_NO_ITTNOTIFY_API */ 593 #else /* INTEL_NO_MACRO_BODY */ 594 #define __itt_notify_sync_releasing_ptr 0 595 #endif /* INTEL_NO_MACRO_BODY */ 596 /** @endcond */ 597 /** @} legacy_sync group */ 598 599 #ifndef _ITTNOTIFY_H_ 600 /** 601 * @defgroup legacy_events Events 602 * @ingroup legacy 603 * Events group 604 * @{ 605 */ 606 607 /** @brief user event type */ 608 typedef int __itt_event; 609 610 /** 611 * @brief Create an event notification 612 * @note name or namelen being null/name and namelen not matching, user event feature not enabled 613 * @return non-zero event identifier upon success and __itt_err otherwise 614 */ 615 #if ITT_PLATFORM==ITT_PLATFORM_WIN 616 __itt_event LIBITTAPI __itt_event_createA(const char *name, int namelen); 617 __itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen); 618 #if defined(UNICODE) || defined(_UNICODE) 619 # define __itt_event_create __itt_event_createW 620 # define __itt_event_create_ptr __itt_event_createW_ptr 621 #else 622 # define __itt_event_create __itt_event_createA 623 # define __itt_event_create_ptr __itt_event_createA_ptr 624 #endif /* UNICODE */ 625 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 626 __itt_event LIBITTAPI __itt_event_create(const char *name, int namelen); 627 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 628 629 /** @cond exclude_from_documentation */ 630 #ifndef INTEL_NO_MACRO_BODY 631 #ifndef INTEL_NO_ITTNOTIFY_API 632 #if ITT_PLATFORM==ITT_PLATFORM_WIN 633 ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char *name, int namelen)) 634 ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen)) 635 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 636 ITT_STUB(LIBITTAPI, __itt_event, event_create, (const char *name, int namelen)) 637 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 638 #if ITT_PLATFORM==ITT_PLATFORM_WIN 639 #define __itt_event_createA ITTNOTIFY_DATA(event_createA) 640 #define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA) 641 #define __itt_event_createW ITTNOTIFY_DATA(event_createW) 642 #define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW) 643 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 644 #define __itt_event_create ITTNOTIFY_DATA(event_create) 645 #define __itt_event_create_ptr ITTNOTIFY_NAME(event_create) 646 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 647 #else /* INTEL_NO_ITTNOTIFY_API */ 648 #if ITT_PLATFORM==ITT_PLATFORM_WIN 649 #define __itt_event_createA(name, namelen) (__itt_event)0 650 #define __itt_event_createA_ptr 0 651 #define __itt_event_createW(name, namelen) (__itt_event)0 652 #define __itt_event_createW_ptr 0 653 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 654 #define __itt_event_create(name, namelen) (__itt_event)0 655 #define __itt_event_create_ptr 0 656 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 657 #endif /* INTEL_NO_ITTNOTIFY_API */ 658 #else /* INTEL_NO_MACRO_BODY */ 659 #if ITT_PLATFORM==ITT_PLATFORM_WIN 660 #define __itt_event_createA_ptr 0 661 #define __itt_event_createW_ptr 0 662 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 663 #define __itt_event_create_ptr 0 664 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 665 #endif /* INTEL_NO_MACRO_BODY */ 666 /** @endcond */ 667 668 /** 669 * @brief Record an event occurrence. 670 * @return __itt_err upon failure (invalid event id/user event feature not enabled) 671 */ 672 int LIBITTAPI __itt_event_start(__itt_event event); 673 674 /** @cond exclude_from_documentation */ 675 #ifndef INTEL_NO_MACRO_BODY 676 #ifndef INTEL_NO_ITTNOTIFY_API 677 ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event)) 678 #define __itt_event_start ITTNOTIFY_DATA(event_start) 679 #define __itt_event_start_ptr ITTNOTIFY_NAME(event_start) 680 #else /* INTEL_NO_ITTNOTIFY_API */ 681 #define __itt_event_start(event) (int)0 682 #define __itt_event_start_ptr 0 683 #endif /* INTEL_NO_ITTNOTIFY_API */ 684 #else /* INTEL_NO_MACRO_BODY */ 685 #define __itt_event_start_ptr 0 686 #endif /* INTEL_NO_MACRO_BODY */ 687 /** @endcond */ 688 689 /** 690 * @brief Record an event end occurrence. 691 * @note It is optional if events do not have durations. 692 * @return __itt_err upon failure (invalid event id/user event feature not enabled) 693 */ 694 int LIBITTAPI __itt_event_end(__itt_event event); 695 696 /** @cond exclude_from_documentation */ 697 #ifndef INTEL_NO_MACRO_BODY 698 #ifndef INTEL_NO_ITTNOTIFY_API 699 ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event)) 700 #define __itt_event_end ITTNOTIFY_DATA(event_end) 701 #define __itt_event_end_ptr ITTNOTIFY_NAME(event_end) 702 #else /* INTEL_NO_ITTNOTIFY_API */ 703 #define __itt_event_end(event) (int)0 704 #define __itt_event_end_ptr 0 705 #endif /* INTEL_NO_ITTNOTIFY_API */ 706 #else /* INTEL_NO_MACRO_BODY */ 707 #define __itt_event_end_ptr 0 708 #endif /* INTEL_NO_MACRO_BODY */ 709 /** @endcond */ 710 /** @} legacy_events group */ 711 #endif /* _ITTNOTIFY_H_ */ 712 713 /** 714 * @defgroup legacy_memory Memory Accesses 715 * @ingroup legacy 716 */ 717 718 /** 719 * @deprecated Legacy API 720 * @brief Inform the tool of memory accesses on reading 721 */ 722 void LIBITTAPI __itt_memory_read(void *addr, size_t size); 723 724 /** @cond exclude_from_documentation */ 725 #ifndef INTEL_NO_MACRO_BODY 726 #ifndef INTEL_NO_ITTNOTIFY_API 727 ITT_STUBV(LIBITTAPI, void, memory_read, (void *addr, size_t size)) 728 #define __itt_memory_read ITTNOTIFY_VOID(memory_read) 729 #define __itt_memory_read_ptr ITTNOTIFY_NAME(memory_read) 730 #else /* INTEL_NO_ITTNOTIFY_API */ 731 #define __itt_memory_read(addr, size) 732 #define __itt_memory_read_ptr 0 733 #endif /* INTEL_NO_ITTNOTIFY_API */ 734 #else /* INTEL_NO_MACRO_BODY */ 735 #define __itt_memory_read_ptr 0 736 #endif /* INTEL_NO_MACRO_BODY */ 737 /** @endcond */ 738 739 /** 740 * @deprecated Legacy API 741 * @brief Inform the tool of memory accesses on writing 742 */ 743 void LIBITTAPI __itt_memory_write(void *addr, size_t size); 744 745 /** @cond exclude_from_documentation */ 746 #ifndef INTEL_NO_MACRO_BODY 747 #ifndef INTEL_NO_ITTNOTIFY_API 748 ITT_STUBV(LIBITTAPI, void, memory_write, (void *addr, size_t size)) 749 #define __itt_memory_write ITTNOTIFY_VOID(memory_write) 750 #define __itt_memory_write_ptr ITTNOTIFY_NAME(memory_write) 751 #else /* INTEL_NO_ITTNOTIFY_API */ 752 #define __itt_memory_write(addr, size) 753 #define __itt_memory_write_ptr 0 754 #endif /* INTEL_NO_ITTNOTIFY_API */ 755 #else /* INTEL_NO_MACRO_BODY */ 756 #define __itt_memory_write_ptr 0 757 #endif /* INTEL_NO_MACRO_BODY */ 758 /** @endcond */ 759 760 /** 761 * @deprecated Legacy API 762 * @brief Inform the tool of memory accesses on updating 763 */ 764 void LIBITTAPI __itt_memory_update(void *address, size_t size); 765 766 /** @cond exclude_from_documentation */ 767 #ifndef INTEL_NO_MACRO_BODY 768 #ifndef INTEL_NO_ITTNOTIFY_API 769 ITT_STUBV(LIBITTAPI, void, memory_update, (void *addr, size_t size)) 770 #define __itt_memory_update ITTNOTIFY_VOID(memory_update) 771 #define __itt_memory_update_ptr ITTNOTIFY_NAME(memory_update) 772 #else /* INTEL_NO_ITTNOTIFY_API */ 773 #define __itt_memory_update(addr, size) 774 #define __itt_memory_update_ptr 0 775 #endif /* INTEL_NO_ITTNOTIFY_API */ 776 #else /* INTEL_NO_MACRO_BODY */ 777 #define __itt_memory_update_ptr 0 778 #endif /* INTEL_NO_MACRO_BODY */ 779 /** @endcond */ 780 /** @} legacy_memory group */ 781 782 /** 783 * @defgroup legacy_state Thread and Object States 784 * @ingroup legacy 785 */ 786 787 /** @brief state type */ 788 typedef int __itt_state_t; 789 790 /** @cond exclude_from_documentation */ 791 typedef enum __itt_obj_state { 792 __itt_obj_state_err = 0, 793 __itt_obj_state_clr = 1, 794 __itt_obj_state_set = 2, 795 __itt_obj_state_use = 3 796 } __itt_obj_state_t; 797 798 typedef enum __itt_thr_state { 799 __itt_thr_state_err = 0, 800 __itt_thr_state_clr = 1, 801 __itt_thr_state_set = 2 802 } __itt_thr_state_t; 803 804 typedef enum __itt_obj_prop { 805 __itt_obj_prop_watch = 1, 806 __itt_obj_prop_ignore = 2, 807 __itt_obj_prop_sharable = 3 808 } __itt_obj_prop_t; 809 810 typedef enum __itt_thr_prop { 811 __itt_thr_prop_quiet = 1 812 } __itt_thr_prop_t; 813 /** @endcond */ 814 815 /** 816 * @deprecated Legacy API 817 * @brief managing thread and object states 818 */ 819 __itt_state_t LIBITTAPI __itt_state_get(void); 820 821 /** @cond exclude_from_documentation */ 822 #ifndef INTEL_NO_MACRO_BODY 823 #ifndef INTEL_NO_ITTNOTIFY_API 824 ITT_STUB(ITTAPI, __itt_state_t, state_get, (void)) 825 #define __itt_state_get ITTNOTIFY_DATA(state_get) 826 #define __itt_state_get_ptr ITTNOTIFY_NAME(state_get) 827 #else /* INTEL_NO_ITTNOTIFY_API */ 828 #define __itt_state_get(void) (__itt_state_t)0 829 #define __itt_state_get_ptr 0 830 #endif /* INTEL_NO_ITTNOTIFY_API */ 831 #else /* INTEL_NO_MACRO_BODY */ 832 #define __itt_state_get_ptr 0 833 #endif /* INTEL_NO_MACRO_BODY */ 834 /** @endcond */ 835 836 /** 837 * @deprecated Legacy API 838 * @brief managing thread and object states 839 */ 840 __itt_state_t LIBITTAPI __itt_state_set(__itt_state_t s); 841 842 /** @cond exclude_from_documentation */ 843 #ifndef INTEL_NO_MACRO_BODY 844 #ifndef INTEL_NO_ITTNOTIFY_API 845 ITT_STUB(ITTAPI, __itt_state_t, state_set, (__itt_state_t s)) 846 #define __itt_state_set ITTNOTIFY_DATA(state_set) 847 #define __itt_state_set_ptr ITTNOTIFY_NAME(state_set) 848 #else /* INTEL_NO_ITTNOTIFY_API */ 849 #define __itt_state_set(s) (__itt_state_t)0 850 #define __itt_state_set_ptr 0 851 #endif /* INTEL_NO_ITTNOTIFY_API */ 852 #else /* INTEL_NO_MACRO_BODY */ 853 #define __itt_state_set_ptr 0 854 #endif /* INTEL_NO_MACRO_BODY */ 855 /** @endcond */ 856 857 /** 858 * @deprecated Legacy API 859 * @brief managing thread and object modes 860 */ 861 __itt_thr_state_t LIBITTAPI __itt_thr_mode_set(__itt_thr_prop_t p, __itt_thr_state_t s); 862 863 /** @cond exclude_from_documentation */ 864 #ifndef INTEL_NO_MACRO_BODY 865 #ifndef INTEL_NO_ITTNOTIFY_API 866 ITT_STUB(ITTAPI, __itt_thr_state_t, thr_mode_set, (__itt_thr_prop_t p, __itt_thr_state_t s)) 867 #define __itt_thr_mode_set ITTNOTIFY_DATA(thr_mode_set) 868 #define __itt_thr_mode_set_ptr ITTNOTIFY_NAME(thr_mode_set) 869 #else /* INTEL_NO_ITTNOTIFY_API */ 870 #define __itt_thr_mode_set(p, s) (__itt_thr_state_t)0 871 #define __itt_thr_mode_set_ptr 0 872 #endif /* INTEL_NO_ITTNOTIFY_API */ 873 #else /* INTEL_NO_MACRO_BODY */ 874 #define __itt_thr_mode_set_ptr 0 875 #endif /* INTEL_NO_MACRO_BODY */ 876 /** @endcond */ 877 878 /** 879 * @deprecated Legacy API 880 * @brief managing thread and object modes 881 */ 882 __itt_obj_state_t LIBITTAPI __itt_obj_mode_set(__itt_obj_prop_t p, __itt_obj_state_t s); 883 884 /** @cond exclude_from_documentation */ 885 #ifndef INTEL_NO_MACRO_BODY 886 #ifndef INTEL_NO_ITTNOTIFY_API 887 ITT_STUB(ITTAPI, __itt_obj_state_t, obj_mode_set, (__itt_obj_prop_t p, __itt_obj_state_t s)) 888 #define __itt_obj_mode_set ITTNOTIFY_DATA(obj_mode_set) 889 #define __itt_obj_mode_set_ptr ITTNOTIFY_NAME(obj_mode_set) 890 #else /* INTEL_NO_ITTNOTIFY_API */ 891 #define __itt_obj_mode_set(p, s) (__itt_obj_state_t)0 892 #define __itt_obj_mode_set_ptr 0 893 #endif /* INTEL_NO_ITTNOTIFY_API */ 894 #else /* INTEL_NO_MACRO_BODY */ 895 #define __itt_obj_mode_set_ptr 0 896 #endif /* INTEL_NO_MACRO_BODY */ 897 /** @endcond */ 898 /** @} legacy_state group */ 899 900 /** 901 * @defgroup frames Frames 902 * @ingroup legacy 903 * Frames group 904 * @{ 905 */ 906 /** 907 * @brief opaque structure for frame identification 908 */ 909 typedef struct __itt_frame_t *__itt_frame; 910 911 /** 912 * @brief Create a global frame with given domain 913 */ 914 #if ITT_PLATFORM==ITT_PLATFORM_WIN 915 __itt_frame ITTAPI __itt_frame_createA(const char *domain); 916 __itt_frame ITTAPI __itt_frame_createW(const wchar_t *domain); 917 #if defined(UNICODE) || defined(_UNICODE) 918 # define __itt_frame_create __itt_frame_createW 919 # define __itt_frame_create_ptr __itt_frame_createW_ptr 920 #else /* UNICODE */ 921 # define __itt_frame_create __itt_frame_createA 922 # define __itt_frame_create_ptr __itt_frame_createA_ptr 923 #endif /* UNICODE */ 924 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 925 __itt_frame ITTAPI __itt_frame_create(const char *domain); 926 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 927 928 /** @cond exclude_from_documentation */ 929 #ifndef INTEL_NO_MACRO_BODY 930 #ifndef INTEL_NO_ITTNOTIFY_API 931 #if ITT_PLATFORM==ITT_PLATFORM_WIN 932 ITT_STUB(ITTAPI, __itt_frame, frame_createA, (const char *domain)) 933 ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain)) 934 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 935 ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain)) 936 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 937 #if ITT_PLATFORM==ITT_PLATFORM_WIN 938 #define __itt_frame_createA ITTNOTIFY_DATA(frame_createA) 939 #define __itt_frame_createA_ptr ITTNOTIFY_NAME(frame_createA) 940 #define __itt_frame_createW ITTNOTIFY_DATA(frame_createW) 941 #define __itt_frame_createW_ptr ITTNOTIFY_NAME(frame_createW) 942 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 943 #define __itt_frame_create ITTNOTIFY_DATA(frame_create) 944 #define __itt_frame_create_ptr ITTNOTIFY_NAME(frame_create) 945 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 946 #else /* INTEL_NO_ITTNOTIFY_API */ 947 #if ITT_PLATFORM==ITT_PLATFORM_WIN 948 #define __itt_frame_createA(domain) 949 #define __itt_frame_createA_ptr 0 950 #define __itt_frame_createW(domain) 951 #define __itt_frame_createW_ptr 0 952 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 953 #define __itt_frame_create(domain) 954 #define __itt_frame_create_ptr 0 955 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 956 #endif /* INTEL_NO_ITTNOTIFY_API */ 957 #else /* INTEL_NO_MACRO_BODY */ 958 #if ITT_PLATFORM==ITT_PLATFORM_WIN 959 #define __itt_frame_createA_ptr 0 960 #define __itt_frame_createW_ptr 0 961 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 962 #define __itt_frame_create_ptr 0 963 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ 964 #endif /* INTEL_NO_MACRO_BODY */ 965 /** @endcond */ 966 967 /** @brief Record a frame begin occurrence. */ 968 void ITTAPI __itt_frame_begin(__itt_frame frame); 969 /** @brief Record a frame end occurrence. */ 970 void ITTAPI __itt_frame_end (__itt_frame frame); 971 972 /** @cond exclude_from_documentation */ 973 #ifndef INTEL_NO_MACRO_BODY 974 #ifndef INTEL_NO_ITTNOTIFY_API 975 ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame)) 976 ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame)) 977 #define __itt_frame_begin ITTNOTIFY_VOID(frame_begin) 978 #define __itt_frame_begin_ptr ITTNOTIFY_NAME(frame_begin) 979 #define __itt_frame_end ITTNOTIFY_VOID(frame_end) 980 #define __itt_frame_end_ptr ITTNOTIFY_NAME(frame_end) 981 #else /* INTEL_NO_ITTNOTIFY_API */ 982 #define __itt_frame_begin(frame) 983 #define __itt_frame_begin_ptr 0 984 #define __itt_frame_end(frame) 985 #define __itt_frame_end_ptr 0 986 #endif /* INTEL_NO_ITTNOTIFY_API */ 987 #else /* INTEL_NO_MACRO_BODY */ 988 #define __itt_frame_begin_ptr 0 989 #define __itt_frame_end_ptr 0 990 #endif /* INTEL_NO_MACRO_BODY */ 991 /** @endcond */ 992 /** @} frames group */ 993 994 #ifdef __cplusplus 995 } 996 #endif /* __cplusplus */ 997 998 #endif /* _LEGACY_ITTNOTIFY_H_ */ 999