Skip to content

Commit e307f4a

Browse files
committed
ittnotify: use untouched library
1 parent fd3960d commit e307f4a

14 files changed

+60
-8773
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ if (TBB_FIND_PACKAGE AND TBB_DIR)
239239
message(STATUS "Using external TBB for testing")
240240
find_package(TBB REQUIRED)
241241
else()
242+
add_subdirectory(src/ittapi)
242243
if (TBB_BUILD)
243244
add_subdirectory(src/tbb)
244245
endif()

src/ittapi/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
include(FetchContent)
2+
3+
# Fetch the ittapi library if it doesn't exist
4+
if(NOT TARGET ittapi::ittnotify)
5+
FetchContent_Declare(
6+
ittapi
7+
# https://github.com/intel/ittapi/archive/refs/tags/v3.25.1.tar.gz
8+
URL ${CMAKE_CURRENT_SOURCE_DIR}/ittapi-3.25.1.tar.gz
9+
URL_HASH
10+
SHA256=866a5a75a287a7440760146f99bd1093750c3fb5bf572c3bff2d4795628ebc7c
11+
)
12+
FetchContent_MakeAvailable(ittapi)
13+
add_library(ittapi::ittnotify ALIAS ittnotify)
14+
endif()
15+
16+
if(NOT TARGET ittapi::ittnotify)
17+
message(
18+
ERROR
19+
"Failed to add Intel® Instrumentation and Tracing Technology (ITT) library"
20+
)
21+
endif()

src/ittapi/ittapi-3.25.1.tar.gz

191 KB
Binary file not shown.

src/tbb/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ endif()
121121

122122
target_link_libraries(tbb
123123
PRIVATE
124+
ittapi::ittnotify
124125
Threads::Threads
125126
${TBB_LIB_LINK_LIBS}
126127
${TBB_COMMON_LINK_LIBS}

src/tbb/itt_notify.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@
2424
#pragma weak dlopen
2525
#pragma weak dlsym
2626
#pragma weak dlerror
27+
#include <limits.h>
28+
#include <dlfcn.h>
29+
#include <errno.h>
2730
#endif /* WIN */
2831

32+
#include "itt_notify.h"
33+
2934
#if __TBB_BUILD
3035

3136
extern "C" void ITT_DoOneTimeInitialization();
@@ -40,8 +45,6 @@ extern "C" void MallocInitializeITT();
4045
#error This file is expected to be used for either TBB or TBB allocator build.
4146
#endif // __TBB_BUILD
4247

43-
#include "tools_api/ittnotify_static.c"
44-
4548
namespace tbb {
4649
namespace detail {
4750
namespace r1 {

src/tbb/itt_notify.h

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,36 @@
3131
#define INTEL_ITTNOTIFY_API_PRIVATE
3232
#endif
3333

34-
#include "tools_api/ittnotify.h"
35-
#include "tools_api/legacy/ittnotify.h"
34+
#include "ittnotify.h"
35+
#include "legacy/ittnotify.h"
36+
37+
typedef enum ___itt_group_id
38+
{
39+
__itt_group_none = 0,
40+
__itt_group_legacy = 1<<0,
41+
__itt_group_control = 1<<1,
42+
__itt_group_thread = 1<<2,
43+
__itt_group_mark = 1<<3,
44+
__itt_group_sync = 1<<4,
45+
__itt_group_fsync = 1<<5,
46+
__itt_group_jit = 1<<6,
47+
__itt_group_model = 1<<7,
48+
__itt_group_splitter_min = 1<<7,
49+
__itt_group_counter = 1<<8,
50+
__itt_group_frame = 1<<9,
51+
__itt_group_stitch = 1<<10,
52+
__itt_group_heap = 1<<11,
53+
__itt_group_splitter_max = 1<<12,
54+
__itt_group_structure = 1<<12,
55+
__itt_group_suppress = 1<<13,
56+
__itt_group_arrays = 1<<14,
57+
__itt_group_module = 1<<15,
58+
__itt_group_all = -1
59+
} __itt_group_id;
60+
3661
extern "C" void __itt_fini_ittlib(void);
3762
extern "C" void __itt_release_resources(void);
63+
extern "C" int __itt_init_ittlib(const char *, __itt_group_id);
3864

3965
#if _WIN32||_WIN64
4066
#undef _T

src/tbb/tools_api/disable_warnings.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)