1
1
/* ******************************************************************************
2
- * Copyright (c) 2017, 2018 IBM Corp. and others
2
+ * Copyright (c) 2017, 2020 IBM Corp. and others
3
3
*
4
4
* This program and the accompanying materials are made available under
5
5
* the terms of the Eclipse Public License 2.0 which accompanies this
36
36
#include < unistd.h>
37
37
#include < sys/syscall.h>
38
38
39
+ #include " env/VerboseLog.hpp"
40
+
39
41
namespace TR {
40
42
41
43
/* *
@@ -57,7 +59,7 @@ namespace TR {
57
59
* These defaults can be overridden using the TR_CompileTimeProfiler env var.
58
60
*
59
61
* The current implementation only supports perf, but other profiling
60
- * utilities could be introduced.
62
+ * utilities could be introduced.
61
63
*
62
64
* In testing, the initial portion of the compile was lost, due to perf's
63
65
* start up. A delay has been added to manage this.
@@ -77,7 +79,7 @@ class CompileTimeProfiler
77
79
char timestr[_timeLength];
78
80
time_t timer = time (NULL );
79
81
snprintf (timestr, sizeof (timestr), " %i" , (int32_t )timer % 100000 );
80
-
82
+
81
83
char tidstr[_threadIDLength];
82
84
snprintf (tidstr, sizeof (tidstr), " %ld" , syscall (SYS_gettid));
83
85
@@ -86,8 +88,8 @@ class CompileTimeProfiler
86
88
snprintf (filename, sizeof (filename), " %s.%s.%s.data" , identifier ? identifier : " perf" , tidstr, timestr);
87
89
88
90
// Build up the constant options, with env var override
89
- if (filenamePos == 0 )
90
- parseOptions (cacheOptions, filenamePos, threadIDPos);
91
+ if (filenamePos == 0 )
92
+ parseOptions (cacheOptions, filenamePos, threadIDPos);
91
93
92
94
// Copy and specialize options
93
95
char *options[_optionsLength];
@@ -120,7 +122,7 @@ class CompileTimeProfiler
120
122
// Give perf some time to start
121
123
usleep (_initMicroSecDelay);
122
124
}
123
- }
125
+ }
124
126
125
127
~CompileTimeProfiler ()
126
128
{
@@ -162,7 +164,7 @@ class CompileTimeProfiler
162
164
if (*iter == ' ' )
163
165
{
164
166
*iter = ' \0 ' ;
165
- newArg = true ;
167
+ newArg = true ;
166
168
}
167
169
else if (newArg)
168
170
{
0 commit comments