-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathitt_notify.cpp
More file actions
95 lines (76 loc) · 2.92 KB
/
itt_notify.cpp
File metadata and controls
95 lines (76 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
Copyright (c) 2005-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#if DO_ITT_NOTIFY
#if _WIN32||_WIN64
#ifndef UNICODE
#define UNICODE
#endif
#else
#pragma weak dlopen
#pragma weak dlsym
#pragma weak dlerror
#endif /* WIN */
#if __TBB_BUILD
extern "C" void ITT_DoOneTimeInitialization();
#define __itt_init_ittlib_name(x,y) (ITT_DoOneTimeInitialization(), true)
#elif __TBBMALLOC_BUILD
extern "C" void MallocInitializeITT();
#define __itt_init_ittlib_name(x,y) (MallocInitializeITT(), true)
#else
#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 internal {
int __TBB_load_ittnotify() {
#if !(_WIN32||_WIN64)
// tool_api crashes without dlopen, check that it's present. Common case
// for lack of dlopen is static binaries, i.e. ones build with -static.
if (dlopen == NULL)
return 0;
#endif
return __itt_init_ittlib(NULL, // groups for:
(__itt_group_id)(__itt_group_sync // prepare/cancel/acquired/releasing
| __itt_group_thread // name threads
| __itt_group_stitch // stack stitching
| __itt_group_structure
));
}
}} // namespaces
#endif /* DO_ITT_NOTIFY */
#define __TBB_NO_IMPLICIT_LINKAGE 1
#include "itt_notify.h"
namespace tbb {
#if DO_ITT_NOTIFY
const tchar
*SyncType_GlobalLock = _T("TbbGlobalLock"),
*SyncType_Scheduler = _T("%Constant")
;
const tchar
*SyncObj_SchedulerInitialization = _T("TbbSchedulerInitialization"),
*SyncObj_SchedulersList = _T("TbbSchedulersList"),
*SyncObj_WorkerLifeCycleMgmt = _T("TBB Scheduler"),
*SyncObj_TaskStealingLoop = _T("TBB Scheduler"),
*SyncObj_WorkerTaskPool = _T("TBB Scheduler"),
*SyncObj_MasterTaskPool = _T("TBB Scheduler"),
*SyncObj_TaskPoolSpinning = _T("TBB Scheduler"),
*SyncObj_Mailbox = _T("TBB Scheduler"),
*SyncObj_TaskReturnList = _T("TBB Scheduler"),
*SyncObj_TaskStream = _T("TBB Scheduler"),
#if __TBB_PREVIEW_CRITICAL_TASKS
*SyncObj_CriticalTaskStream = _T("TBB Scheduler"),
#endif
*SyncObj_ContextsList = _T("TBB Scheduler")
;
#endif /* DO_ITT_NOTIFY */
} // namespace tbb