diff options
author | Xinliang David Li <davidxl@google.com> | 2019-06-06 06:35:18 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2019-06-06 06:35:18 +0000 |
commit | c1867557d93d622f761b57af6e66e3e518bc0b9f (patch) | |
tree | 72685a8c1a95676d892d7093ff13c08cd085c751 /compiler-rt/lib/profile/InstrProfiling.h | |
parent | 9226ba6b376ea2a221e97c2f674841a496869f4d (diff) | |
download | bcm5719-llvm-c1867557d93d622f761b57af6e66e3e518bc0b9f.tar.gz bcm5719-llvm-c1867557d93d622f761b57af6e66e3e518bc0b9f.zip |
[Profile]: Add runtime interface to specify file handle for profile data.
Author: Sajjad Mirza
Differential Revision: http://reviews.llvm.org/D62541
llvm-svn: 362676
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfiling.h')
-rw-r--r-- | compiler-rt/lib/profile/InstrProfiling.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/compiler-rt/lib/profile/InstrProfiling.h b/compiler-rt/lib/profile/InstrProfiling.h index 91afd5e6b92..4d196a89b49 100644 --- a/compiler-rt/lib/profile/InstrProfiling.h +++ b/compiler-rt/lib/profile/InstrProfiling.h @@ -10,6 +10,7 @@ #define PROFILE_INSTRPROFILING_H_ #include "InstrProfilingPort.h" +#include <stdio.h> #define INSTR_PROF_VISIBILITY COMPILER_RT_VISIBILITY #include "InstrProfData.inc" @@ -125,7 +126,7 @@ int __llvm_orderfile_write_file(void); /*! * \brief this is a wrapper interface to \c __llvm_profile_write_file. * After this interface is invoked, a arleady dumped flag will be set - * so that profile won't be dumped again during program exit. + * so that profile won't be dumped again during program exit. * Invocation of interface __llvm_profile_reset_counters will clear * the flag. This interface is designed to be used to collect profile * data from user selected hot regions. The use model is @@ -157,6 +158,24 @@ int __llvm_orderfile_dump(void); */ void __llvm_profile_set_filename(const char *Name); +/*! + * \brief Set the FILE object for writing instrumentation data. + * + * Sets the FILE object to be used for subsequent calls to + * \a __llvm_profile_write_file(). The profile file name set by environment + * variable, command-line option, or calls to \a __llvm_profile_set_filename + * will be ignored. + * + * \c File will not be closed after a call to \a __llvm_profile_write_file() but + * it may be flushed. Passing NULL restores default behavior. + * + * If \c EnableMerge is nonzero, the runtime will always merge profiling data + * with the contents of the profiling file. If EnableMerge is zero, the runtime + * may still merge the data if it would have merged for another reason (for + * example, because of a %m specifier in the file name). + */ +void __llvm_profile_set_file_object(FILE *File, int EnableMerge); + /*! \brief Register to write instrumentation data to file at exit. */ int __llvm_profile_register_write_file_atexit(void); |