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