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