File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ class Profiler {
75
75
};
76
76
77
77
// / Time spend in the current scope, assigned to the function name.
78
- #define TIMESCOPE () llvm::TimeTraceScope TimeScope (__FUNCTION__ )
78
+ #define TIMESCOPE () llvm::TimeTraceScope TimeScope (__PRETTY_FUNCTION__ )
79
79
80
80
// / Time spend in the current scope, assigned to the function name and source
81
81
// / info.
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ extern void llvm::omp::target::ompt::connectLibrary();
21
21
#endif
22
22
23
23
__attribute__ ((constructor(101 ))) void init() {
24
+ Profiler::get ();
25
+ TIMESCOPE ();
26
+
24
27
DP (" Init offload library!\n " );
25
28
26
29
PM = new PluginManager ();
@@ -32,7 +35,6 @@ __attribute__((constructor(101))) void init() {
32
35
33
36
PM->init ();
34
37
35
- Profiler::get ();
36
38
PM->registerDelayedLibraries ();
37
39
}
38
40
Original file line number Diff line number Diff line change 12
12
13
13
#include " PluginManager.h"
14
14
#include " Shared/Debug.h"
15
+ #include " Shared/Profile.h"
15
16
16
17
#include " llvm/Support/Error.h"
17
18
#include " llvm/Support/ErrorHandling.h"
@@ -28,6 +29,7 @@ static const char *RTLNames[] = {ENABLED_OFFLOAD_PLUGINS};
28
29
Expected<std::unique_ptr<PluginAdaptorTy>>
29
30
PluginAdaptorTy::create (const std::string &Name) {
30
31
DP (" Attempting to load library '%s'...\n " , Name.c_str ());
32
+ TIMESCOPE_WITH_NAME_AND_IDENT (Name, (const ident_t *)nullptr );
31
33
32
34
std::string ErrMsg;
33
35
auto LibraryHandler = std::make_unique<DynamicLibrary>(
@@ -101,6 +103,7 @@ void PluginAdaptorTy::addOffloadEntries(DeviceImageTy &DI) {
101
103
}
102
104
103
105
void PluginManager::init () {
106
+ TIMESCOPE ();
104
107
DP (" Loading RTLs...\n " );
105
108
106
109
// Attempt to open all the plugins and, if they exist, check if the interface
@@ -123,6 +126,7 @@ void PluginManager::init() {
123
126
void PluginAdaptorTy::initDevices (PluginManager &PM) {
124
127
if (isUsed ())
125
128
return ;
129
+ TIMESCOPE ();
126
130
127
131
// If this RTL is not already in use, initialize it.
128
132
assert (getNumberOfPluginDevices () > 0 &&
You can’t perform that action at this time.
0 commit comments