Skip to content

Commit

Permalink
Replacing files to update ittnotify to tag v3.23.0 (uxlfoundation#956)
Browse files Browse the repository at this point in the history
* Replacing files to update ittnotify to tag v3.23.0

* codespell error elimination

* Adding back changes made by PR uxlfoundation#917

* Adding back changes made by uxlfoundation#850

* Changing copyright

* ITT RELEASE RESOURCES MACRO

* Fixing copyright issue

* Address changes for frontend.cpp
  • Loading branch information
AnuyaWelling2801 authored Dec 12, 2022
1 parent bc48c4a commit 0e6d469
Show file tree
Hide file tree
Showing 11 changed files with 603 additions and 125 deletions.
5 changes: 4 additions & 1 deletion src/tbb/itt_notify.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005-2021 Intel Corporation
Copyright (c) 2005-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,6 +34,7 @@
#include "tools_api/ittnotify.h"
#include "tools_api/legacy/ittnotify.h"
extern "C" void __itt_fini_ittlib(void);
extern "C" void __itt_release_resources(void);

#if _WIN32||_WIN64
#undef _T
Expand Down Expand Up @@ -75,6 +76,7 @@ extern const tchar
#define ITT_NOTIFY(name,obj) __itt_##name(const_cast<void*>(static_cast<volatile void*>(obj)))
#define ITT_THREAD_SET_NAME(name) __itt_thread_set_name(name)
#define ITT_FINI_ITTLIB() __itt_fini_ittlib()
#define ITT_RELEASE_RESOURCES() __itt_release_resources()
#define ITT_SYNC_CREATE(obj, type, name) __itt_sync_create((void*)(obj), type, name, 2)
#define ITT_STACK_CREATE(obj) obj = __itt_stack_caller_create()
#define ITT_STACK_DESTROY(obj) (obj!=nullptr) ? __itt_stack_caller_destroy(static_cast<__itt_caller>(obj)) : ((void)0)
Expand All @@ -94,6 +96,7 @@ extern const tchar
#define ITT_NOTIFY(name,obj) ((void)0)
#define ITT_THREAD_SET_NAME(name) ((void)0)
#define ITT_FINI_ITTLIB() ((void)0)
#define ITT_RELEASE_RESOURCES() ((void)0)
#define ITT_SYNC_CREATE(obj, type, name) ((void)0)
#define ITT_STACK_CREATE(obj) ((void)0)
#define ITT_STACK_DESTROY(obj) ((void)0)
Expand Down
1 change: 1 addition & 0 deletions src/tbb/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void __TBB_InitOnce::remove_ref() {
if( k==0 ) {
governor::release_resources();
ITT_FINI_ITTLIB();
ITT_RELEASE_RESOURCES();
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/tbb/tools_api/disable_warnings.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005-2021 Intel Corporation
Copyright (c) 2005-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -16,14 +16,18 @@

#include "ittnotify_config.h"

#if ITT_PLATFORM==ITT_PLATFORM_WIN && _MSC_VER
#if ITT_PLATFORM==ITT_PLATFORM_WIN

#if defined _MSC_VER

#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */
#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */
#pragma warning (disable: 174) /* expression has no effect */
#pragma warning (disable: 4127) /* conditional expression is constant */
#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */

#endif

#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */

#if defined __INTEL_COMPILER
Expand Down
168 changes: 152 additions & 16 deletions src/tbb/tools_api/ittnotify.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005-2021 Intel Corporation
Copyright (c) 2005-2022 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,7 @@
@brief Public User API functions and types
@mainpage
The Instrumentation and Tracing Technology API (ITT API) is used to
The Instrumentation and Tracing Technology API (ITT API) is used to
annotate a user's program with additional information
that can be used by correctness and performance tools. The user inserts
calls in their program. Those calls generate information that is collected
Expand Down Expand Up @@ -188,7 +188,12 @@ The same ID may not be reused for different instances, unless a previous

#if ITT_PLATFORM==ITT_PLATFORM_WIN
/* use __forceinline (VC++ specific) */
#if defined(__MINGW32__) && !defined(__cplusplus)
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
#else
#define ITT_INLINE static __forceinline
#endif /* __MINGW32__ */

#define ITT_INLINE_ATTRIBUTE /* nothing */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
/*
Expand Down Expand Up @@ -249,20 +254,20 @@ The same ID may not be reused for different instances, unless a previous
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)

#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
#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)
#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)
#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)
#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)
#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
#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)
#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)
#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)
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
#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)
#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)
#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)
#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)
#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)
#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)
#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
#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)
#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)
#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)
#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)

#ifdef ITT_STUB
#undef ITT_STUB
Expand Down Expand Up @@ -590,6 +595,18 @@ typedef enum __itt_suppress_mode {
__itt_suppress_range
} __itt_suppress_mode_t;

/**
* @enum __itt_collection_state
* @brief Enumerator for collection state. All non-work states have negative values.
*/
typedef enum {
__itt_collection_uninitialized = 0, /* uninitialized */
__itt_collection_init_fail = 1, /* failed to init */
__itt_collection_collector_absent = 2, /* non work state collector exists */
__itt_collection_collector_exists = 3, /* work state collector exists */
__itt_collection_init_successful = 4 /* success to init */
} __itt_collection_state;

/**
* @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
*/
Expand Down Expand Up @@ -3869,6 +3886,125 @@ ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* modu
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */

/** @cond exclude_from_documentation */
#pragma pack(push, 8)

typedef struct ___itt_histogram
{
const __itt_domain* domain; /*!< Domain of the histogram*/
const char* nameA; /*!< Name of the histogram */
#if defined(UNICODE) || defined(_UNICODE)
const wchar_t* nameW;
#else /* UNICODE || _UNICODE */
void* nameW;
#endif /* UNICODE || _UNICODE */
__itt_metadata_type x_type; /*!< Type of the histogram X axis */
__itt_metadata_type y_type; /*!< Type of the histogram Y axis */
int extra1; /*!< Reserved to the runtime */
void* extra2; /*!< Reserved to the runtime */
struct ___itt_histogram* next;
} __itt_histogram;

#pragma pack(pop)
/** @endcond */

/**
* @brief Create a typed histogram instance with given name/domain.
* @param[in] domain The domain controlling the call.
* @param[in] name The name of the histogram.
* @param[in] x_type The type of the X axis in histogram (may be 0 to calculate batch statistics).
* @param[in] y_type The type of the Y axis in histogram.
*/
#if ITT_PLATFORM==ITT_PLATFORM_WIN
__itt_histogram* ITTAPI __itt_histogram_createA(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
__itt_histogram* ITTAPI __itt_histogram_createW(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
#if defined(UNICODE) || defined(_UNICODE)
# define __itt_histogram_create __itt_histogram_createW
# define __itt_histogram_create_ptr __itt_histogram_createW_ptr
#else /* UNICODE */
# define __itt_histogram_create __itt_histogram_createA
# define __itt_histogram_create_ptr __itt_histogram_createA_ptr
#endif /* UNICODE */
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
__itt_histogram* ITTAPI __itt_histogram_create(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */

/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
#if ITT_PLATFORM==ITT_PLATFORM_WIN
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
#define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
#define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
#define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
#define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#else /* INTEL_NO_ITTNOTIFY_API */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_histogram_createA(domain, name, x_type, y_type) (__itt_histogram*)0
#define __itt_histogram_createA_ptr 0
#define __itt_histogram_createW(domain, name, x_type, y_type) (__itt_histogram*)0
#define __itt_histogram_createW_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_histogram_create(domain, name, x_type, y_type) (__itt_histogram*)0
#define __itt_histogram_create_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#if ITT_PLATFORM==ITT_PLATFORM_WIN
#define __itt_histogram_createA_ptr 0
#define __itt_histogram_createW_ptr 0
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#define __itt_histogram_create_ptr 0
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
#endif /* INTEL_NO_MACRO_BODY */
/** @endcond */

/**
* @brief Submit statistics for a histogram instance.
* @param[in] histogram Pointer to the histogram instance to which the histogram statistic is to be dumped.
* @param[in] length The number of elements in dumped axis data array.
* @param[in] x_data The X axis dumped data itself (may be NULL to calculate batch statistics).
* @param[in] y_data The Y axis dumped data itself.
*/
void ITTAPI __itt_histogram_submit(__itt_histogram* histogram, size_t length, void* x_data, void* y_data);

/** @cond exclude_from_documentation */
#ifndef INTEL_NO_MACRO_BODY
#ifndef INTEL_NO_ITTNOTIFY_API
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* histogram, size_t length, void* x_data, void* y_data))
#define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
#define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
#else /* INTEL_NO_ITTNOTIFY_API */
#define __itt_histogram_submit(histogram, length, x_data, y_data)
#define __itt_histogram_submit_ptr 0
#endif /* INTEL_NO_ITTNOTIFY_API */
#else /* INTEL_NO_MACRO_BODY */
#define __itt_histogram_submit_ptr 0
#endif /* INTEL_NO_MACRO_BODY */

/**
* @brief function allows to obtain the current collection state at the moment
* @return collection state as a enum __itt_collection_state
*/
__itt_collection_state __itt_get_collection_state(void);

/**
* @brief function releases resources allocated by ITT API static part
* this API should be called from the library destructor
* @return void
*/
void __itt_release_resources(void);
/** @endcond */

#ifdef __cplusplus
}
#endif /* __cplusplus */
Expand Down
Loading

0 comments on commit 0e6d469

Please sign in to comment.