summaryrefslogtreecommitdiff
path: root/compiler-rt/lib/profile/InstrProfilingRuntime.cpp
AgeCommit message (Collapse)Author
2022-10-28[PGO] Simplify InstrProfilingRuntime.cppWael Yehia
Differential Revision: https://reviews.llvm.org/D136192
2022-10-21[PGO][AIX] Improve dummy var retention and allow -bcdtors:csect linking.Wael Yehia
1) Use a static array of pointer to retain the dummy vars. 2) Associate liveness of the array with that of the runtime hook variable __llvm_profile_runtime. 3) Perform the runtime initialization through the runtime hook variable. 4) Preserve the runtime hook variable using the -u linker flag. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D136192
2020-03-24[profile] Make atexit hook a no-op on FuchsiaPetr Hosek
On Fuchsia, we always use the continuous mode with runtime counter relocation, so there's no need for atexit hook or support for dumping the profile manually. Differential Revision: https://reviews.llvm.org/D76556
2019-10-31[profile] Add a mode to continuously sync counter updates to a fileVedant Kumar
Add support for continuously syncing profile counter updates to a file. The motivation for this is that programs do not always exit cleanly. On iOS, for example, programs are usually killed via a signal from the OS. Running atexit() handlers after catching a signal is unreliable, so some method for progressively writing out profile data is necessary. The approach taken here is to mmap() the `__llvm_prf_cnts` section onto a raw profile. To do this, the linker must page-align the counter and data sections, and the runtime must ensure that counters are mapped to a page-aligned offset within a raw profile. Continuous mode is (for the moment) incompatible with the online merging mode. This limitation is lifted in https://reviews.llvm.org/D69586. Continuous mode is also (for the moment) incompatible with value profiling, as I'm not sure whether there is interest in this and the implementation may be tricky. As I have not been able to test extensively on non-Darwin platforms, only Darwin support is included for the moment. However, continuous mode may "just work" without modification on Linux and some UNIX-likes. AIUI the default value for the GNU linker's `--section-alignment` flag is set to the page size on many systems. This appears to be true for LLD as well, as its `no_nmagic` option is on by default. Continuous mode will not "just work" on Fuchsia or Windows, as it's not possible to mmap() a section on these platforms. There is a proposal to add a layer of indirection to the profile instrumentation to support these platforms. rdar://54210980 Differential Revision: https://reviews.llvm.org/D68351
2019-07-31compiler-rt: Rename .cc file in lib/profile to .cppNico Weber
See https://reviews.llvm.org/D58620 for discussion. Note how the comment in the file already said ".cpp" :) llvm-svn: 367460