llvm-project/compiler-rt/lib/profile
Petr Hosek d3db13af7e [profile] Support counter relocation at runtime
This is an alternative to the continous mode that was implemented in
D68351. This mode relies on padding and the ability to mmap a file over
the existing mapping which is generally only available on POSIX systems
and isn't suitable for other platforms.

This change instead introduces the ability to relocate counters at
runtime using a level of indirection. On every counter access, we add a
bias to the counter address. This bias is stored in a symbol that's
provided by the profile runtime and is initially set to zero, meaning no
relocation. The runtime can mmap the profile into memory at abitrary
location, and set bias to the offset between the original and the new
counter location, at which point every subsequent counter access will be
to the new location, which allows updating profile directly akin to the
continous mode.

The advantage of this implementation is that doesn't require any special
OS support. The disadvantage is the extra overhead due to additional
instructions required for each counter access (overhead both in terms of
binary size and performance) plus duplication of counters (i.e. one copy
in the binary itself and another copy that's mmapped).

Differential Revision: https://reviews.llvm.org/D69740
2020-01-17 15:02:23 -08:00
..
CMakeLists.txt [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
GCDAProfiling.c [compiler-rt] Add a critical section when flushing gcov counters 2019-12-12 09:23:32 +01:00
InstrProfiling.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfiling.h [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
InstrProfilingBiasVar.c [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
InstrProfilingBuffer.c [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
InstrProfilingFile.c [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
InstrProfilingInternal.h [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
InstrProfilingMerge.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfilingMergeFile.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfilingNameVar.c Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InstrProfilingPlatformDarwin.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPlatformFuchsia.c [profile] Support counter relocation at runtime 2020-01-17 15:02:23 -08:00
InstrProfilingPlatformLinux.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPlatformOther.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPlatformWindows.c Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
InstrProfilingPort.h [profile] Support online merging with continuous sync mode 2019-11-18 12:56:58 -08:00
InstrProfilingRuntime.cpp [profile] Add a mode to continuously sync counter updates to a file 2019-10-31 16:04:09 -07:00
InstrProfilingUtil.c [profile] Fix file contention causing dropped counts on Windows under -fprofile-generate 2019-11-27 15:55:13 +01:00
InstrProfilingUtil.h Add a shim for setenv on PS4 since it does not exist. 2019-11-12 15:05:45 -08:00
InstrProfilingValue.c Reland "[CMake] Support installation of InstrProfData.inc" 2019-11-22 14:09:46 -08:00
InstrProfilingWriter.c [profile] Avoid allocating a page on the stack, NFC 2019-12-11 10:04:00 -08:00
WindowsMMap.c [GCOV] Close file mapping handle on Windows, so flushed gcda files can be removed while the process is in execution 2018-11-07 09:38:26 +00:00
WindowsMMap.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00