Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ittnotify: use untouched library #1456

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ if (TBB_FIND_PACKAGE AND TBB_DIR)
message(STATUS "Using external TBB for testing")
find_package(TBB REQUIRED)
else()
add_subdirectory(src/ittapi)
if (TBB_BUILD)
add_subdirectory(src/tbb)
endif()
Expand Down
21 changes: 21 additions & 0 deletions src/ittapi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include(FetchContent)

# Fetch the ittapi library if it doesn't exist
if(NOT TARGET ittapi::ittnotify)
FetchContent_Declare(
ittapi
# https://github.com/intel/ittapi/archive/refs/tags/v3.25.1.tar.gz
URL ${CMAKE_CURRENT_SOURCE_DIR}/ittapi-3.25.1.tar.gz
URL_HASH
SHA256=866a5a75a287a7440760146f99bd1093750c3fb5bf572c3bff2d4795628ebc7c
)
FetchContent_MakeAvailable(ittapi)
add_library(ittapi::ittnotify ALIAS ittnotify)
endif()

if(NOT TARGET ittapi::ittnotify)
message(
ERROR
"Failed to add Intel® Instrumentation and Tracing Technology (ITT) library"
)
endif()
Binary file added src/ittapi/ittapi-3.25.1.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions src/tbb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ endif()

target_link_libraries(tbb
PRIVATE
ittapi::ittnotify
Threads::Threads
${TBB_LIB_LINK_LIBS}
${TBB_COMMON_LINK_LIBS}
Expand Down
9 changes: 6 additions & 3 deletions src/tbb/itt_notify.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005-2022 Intel Corporation
Copyright (c) 2005-2024 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 @@ -24,8 +24,13 @@
#pragma weak dlopen
#pragma weak dlsym
#pragma weak dlerror
#include <limits.h>
#include <dlfcn.h>
#include <errno.h>
#endif /* WIN */

#include "itt_notify.h"

#if __TBB_BUILD

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

#include "tools_api/ittnotify_static.c"

namespace tbb {
namespace detail {
namespace r1 {
Expand Down
32 changes: 29 additions & 3 deletions src/tbb/itt_notify.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2005-2022 Intel Corporation
Copyright (c) 2005-2024 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 @@ -31,10 +31,36 @@
#define INTEL_ITTNOTIFY_API_PRIVATE
#endif

#include "tools_api/ittnotify.h"
#include "tools_api/legacy/ittnotify.h"
#include "ittnotify.h"
#include "legacy/ittnotify.h"

typedef enum ___itt_group_id
{
__itt_group_none = 0,
__itt_group_legacy = 1<<0,
__itt_group_control = 1<<1,
__itt_group_thread = 1<<2,
__itt_group_mark = 1<<3,
__itt_group_sync = 1<<4,
__itt_group_fsync = 1<<5,
__itt_group_jit = 1<<6,
__itt_group_model = 1<<7,
__itt_group_splitter_min = 1<<7,
__itt_group_counter = 1<<8,
__itt_group_frame = 1<<9,
__itt_group_stitch = 1<<10,
__itt_group_heap = 1<<11,
__itt_group_splitter_max = 1<<12,
__itt_group_structure = 1<<12,
__itt_group_suppress = 1<<13,
__itt_group_arrays = 1<<14,
__itt_group_module = 1<<15,
__itt_group_all = -1
} __itt_group_id;

extern "C" void __itt_fini_ittlib(void);
extern "C" void __itt_release_resources(void);
extern "C" int __itt_init_ittlib(const char *, __itt_group_id);

#if _WIN32||_WIN64
#undef _T
Expand Down
39 changes: 0 additions & 39 deletions src/tbb/tools_api/disable_warnings.h

This file was deleted.

Loading
Loading