llvm-project/compiler-rt/test/profile
Vedant Kumar d889d1efef [profile] Add a mode to continuously sync counter updates to a file
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-10-31 16:04:09 -07:00
..
ContinuousSyncMode [profile] Add a mode to continuously sync counter updates to a file 2019-10-31 16:04:09 -07:00
Inputs [profile] Do not cache __llvm_profile_get_filename result 2019-10-18 23:33:40 +00:00
Linux compiler-rt: Rename remaining cc files in test/profile to cpp 2019-08-05 13:42:31 +00:00
Posix [profile] Use -fPIC -shared in a test instead of -dynamiclib 2019-10-19 00:51:27 +00:00
CMakeLists.txt Revert "[profile] Add a test dependency on cxx-headers" 2019-09-27 20:24:48 +00:00
coverage-inline.cpp [InstrProf] Use separate comdat group for data and counters 2019-02-27 23:38:44 +00:00
gcc-flag-compatibility.test
infinite_loop.c [PGO] Test case changes for D41059 2017-12-18 17:56:42 +00:00
instrprof-basic.c
instrprof-bufferio.c
instrprof-darwin-dead-strip.c [profile] Test the exported symbol set for empty programs 2018-02-28 19:00:16 +00:00
instrprof-darwin-exports.c [gcov/Darwin] Ensure external symbols are exported when using an export list 2018-12-03 20:53:58 +00:00
instrprof-dump.c
instrprof-error.c
instrprof-gcov-__gcov_flush-multiple.test [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
instrprof-gcov-__gcov_flush-terminate.test Add a test with __gcov_flush called before terminating the program. 2018-07-16 09:13:46 +00:00
instrprof-gcov-exceptions.test [InstrProf] Port test suite to Windows 2019-02-07 17:52:05 +00:00
instrprof-gcov-multiple-bbs-single-line.test [profile] Fix tests in compiler-rt for patch in gcov (https://reviews.llvm.org/D49659) 2018-09-20 16:21:09 +00:00
instrprof-gcov-one-line-function.test [GCOV] Add a test for function defined on one line (follow-up of https://reviews.llvm.org/D53600) 2018-10-30 18:41:41 +00:00
instrprof-gcov-switch.test [gcov] Add tests using switch, one with break clauses and one with fallthrough 2018-07-31 23:26:50 +00:00
instrprof-gcov-two-objects.test [Profile] Fix gcov tests 2018-09-25 11:12:15 +00:00
instrprof-get-filename.c [profile] Add interface to get profile filename 2018-07-19 19:03:50 +00:00
instrprof-hostname.c
instrprof-icall-promo.test compiler-rt: Rename remaining cc files in test/profile to cpp 2019-08-05 13:42:31 +00:00
instrprof-merge-match.test [InstrProf] Port test suite to Windows 2019-02-07 17:52:05 +00:00
instrprof-merge.c NFC: Unforget a colon in a few CHECK: directives. 2019-07-12 02:16:56 +00:00
instrprof-merging.cpp [llvm-cov] NFC: Specify a specific C++ standard in the test. 2019-09-24 00:01:51 +00:00
instrprof-order-file.test Reland compiler-rt support for order file instrumentation. 2019-03-08 15:30:56 +00:00
instrprof-override-filename-then-reset-default.c
instrprof-override-filename-with-env.c
instrprof-override-filename.c [profile] Move __llvm_profile_filename into a separate object 2017-06-29 17:42:24 +00:00
instrprof-path.c [InstrProf] Port test suite to Windows 2019-02-07 17:52:05 +00:00
instrprof-reset-counters.c Add space inside the regular expression. 2018-02-08 02:29:56 +00:00
instrprof-set-dir-mode.c [compiler-rt][test] Make instrprof-set-dir-mode test tolerant of group ID 2019-04-02 03:24:12 +00:00
instrprof-set-file-object-merging.c [test] Clean up previous raw profile before merging into it 2019-09-16 22:32:18 +00:00
instrprof-set-file-object.c (Reland with changes) Adding a function for setting coverage output file. 2019-06-24 21:32:50 +00:00
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] Port test suite to Windows 2019-02-07 17:52:05 +00:00
instrprof-without-libc.c [InstrProf] Port test suite to Windows 2019-02-07 17:52:05 +00:00
instrprof-write-file-atexit-explicitly.c
instrprof-write-file-only.c
instrprof-write-file.c [profile] Clean up stale raw profiles in instrprof-write-file.c 2019-10-31 16:04:08 -07:00
lit.cfg.py compiler-rt: Rename remaining cc files in test/profile to cpp 2019-08-05 13:42:31 +00:00
lit.site.cfg.py.in [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00
profile_test.h [profile][test] Fix Profile-* :: instrprof-merge.c etc. on SPARC 2019-07-11 18:26:24 +00:00
runtime_infinite.c [PGO] Test case changes for D41059 2017-12-18 17:56:42 +00:00