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