Skip to content

Commit b16d017

Browse files
committed
[profile] add runtime variable documentation
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269964 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b89453c commit b16d017

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

lib/profile/InstrProfiling.h

+29
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,33 @@ uint64_t __llvm_profile_get_version(void);
154154
uint64_t __llvm_profile_get_data_size(const __llvm_profile_data *Begin,
155155
const __llvm_profile_data *End);
156156

157+
/*!
158+
* This variable is defined in InstrProfilingRuntime.c as a hidden
159+
* symbol. Its main purpose is to enable profile runtime user to
160+
* bypass runtime initialization code -- if the client code explicitly
161+
* define this variable, then InstProfileRuntime.o won't be linked in.
162+
* Note that this variable's visibility needs to be hidden so that the
163+
* definition of this variable in an instrumented shared library won't
164+
* affect runtime initialization decision of the main program.
165+
*/
166+
COMPILER_RT_VISIBILITY extern int __llvm_profile_runtime;
167+
/*!
168+
* This variable is defined in InstrProfilingFile.c. Its visibility is
169+
* not hidden so that instrumented shared libraries and the main program
170+
* can share the raw data file with the same name.
171+
*/
172+
extern int __llvm_profile_OwnsFilename;
173+
extern const char *__llvm_profile_CurrentFilename;
174+
/*!
175+
* This variable is defined in InstrProfiling.c. Its main purpose is to
176+
* encode the raw profile version value and other format related information
177+
* such as whether the profile is from IR based instrumentation. The variable
178+
* is defined as weak so that compiler can emit an overriding definition
179+
* depending on user option. Since we don't support mixing FE and IR based
180+
* data in the same raw profile data file (in other words, shared libs and
181+
* main program are expected to be instrumented in the same way), there is
182+
* no need for this variale to be hidden.
183+
*/
184+
extern uint64_t __llvm_profile_raw_version;
185+
157186
#endif /* PROFILE_INSTRPROFILING_H_ */

0 commit comments

Comments
 (0)