diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-05-17 01:27:30 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-05-17 01:27:30 +0000 |
commit | 8a44ab3d8ee6684e359666a9ca23fbeb0e1883b7 (patch) | |
tree | 20357a21e436b9fddc1e7ede807efa987458be82 /lib/profile/InstrProfilingRuntime.cc | |
parent | 1a51c83ee1365e67aaa971321e6c26e096710700 (diff) |
InstrProf: Support profiling dlopen'd shared libraries
Shared objects are hard. After this commit, we do the right thing when
profiling two separate shared objects that have been dlopen'd with
`RTLD_LOCAL`, when the main executable is *not* being profiled.
This mainly simplifies the writer logic.
- At initialization, determine the output filename and truncate the
file. Depending on whether shared objects can see each other, this
may happen multiple times.
- At exit, each executable writes its own profile in append mode.
<rdar://problem/16918688>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingRuntime.cc')
-rw-r--r-- | lib/profile/InstrProfilingRuntime.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingRuntime.cc b/lib/profile/InstrProfilingRuntime.cc index 280de834b..081ecb29e 100644 --- a/lib/profile/InstrProfilingRuntime.cc +++ b/lib/profile/InstrProfilingRuntime.cc @@ -21,7 +21,7 @@ class RegisterRuntime { public: RegisterRuntime() { __llvm_profile_register_write_file_atexit(); - __llvm_profile_register_write_file(); + __llvm_profile_initialize_file(); } }; |