forked from OSchip/llvm-project
d889d1efef
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 |
||
---|---|---|
.. | ||
ContinuousSyncMode | ||
Inputs | ||
Linux | ||
Posix | ||
CMakeLists.txt | ||
coverage-inline.cpp | ||
gcc-flag-compatibility.test | ||
infinite_loop.c | ||
instrprof-basic.c | ||
instrprof-bufferio.c | ||
instrprof-darwin-dead-strip.c | ||
instrprof-darwin-exports.c | ||
instrprof-dump.c | ||
instrprof-error.c | ||
instrprof-gcov-__gcov_flush-multiple.test | ||
instrprof-gcov-__gcov_flush-terminate.test | ||
instrprof-gcov-exceptions.test | ||
instrprof-gcov-multiple-bbs-single-line.test | ||
instrprof-gcov-one-line-function.test | ||
instrprof-gcov-switch.test | ||
instrprof-gcov-two-objects.test | ||
instrprof-get-filename.c | ||
instrprof-hostname.c | ||
instrprof-icall-promo.test | ||
instrprof-merge-match.test | ||
instrprof-merge.c | ||
instrprof-merging.cpp | ||
instrprof-order-file.test | ||
instrprof-override-filename-then-reset-default.c | ||
instrprof-override-filename-with-env.c | ||
instrprof-override-filename.c | ||
instrprof-path.c | ||
instrprof-reset-counters.c | ||
instrprof-set-dir-mode.c | ||
instrprof-set-file-object-merging.c | ||
instrprof-set-file-object.c | ||
instrprof-set-filename-then-reset-default.c | ||
instrprof-set-filename.c | ||
instrprof-value-prof-2.c | ||
instrprof-value-prof-evict.test | ||
instrprof-value-prof-reset.c | ||
instrprof-value-prof.c | ||
instrprof-value-prof.test | ||
instrprof-version-mismatch.c | ||
instrprof-without-libc.c | ||
instrprof-write-file-atexit-explicitly.c | ||
instrprof-write-file-only.c | ||
instrprof-write-file.c | ||
lit.cfg.py | ||
lit.site.cfg.py.in | ||
profile_test.h | ||
runtime_infinite.c |