llvm-project/compiler-rt/lib
Calixte Denizet 8f46269f0c [profile] Don't dump counters when forking and don't reset when calling exec** functions
Summary:
There is no need to write out gcdas when forking because we can just reset the counters in the parent process.
Let say a counter is N before the fork, then fork and this counter is set to 0 in the child process.
In the parent process, the counter is incremented by P and in the child process it's incremented by C.
When dump is ran at exit, parent process will dump N+P for the given counter and the child process will dump 0+C, so when the gcdas are merged the resulting counter will be N+P+C.
About exec** functions, since the current process is replaced by an another one there is no need to reset the counters but just write out the gcdas since the counters are definitely lost.
To avoid to have lists in a bad state, we just lock them during the fork and the flush (if called explicitely) and lock them when an element is added.

Reviewers: marco-c

Reviewed By: marco-c

Subscribers: hiraditya, cfe-commits, #sanitizers, llvm-commits, sylvestre.ledru

Tags: #clang, #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D74953
2020-02-24 10:38:33 +01:00
..
BlocksRuntime [compiler-rt] Test commit: remove some trailing white spaces. 2017-08-25 19:36:30 +00:00
asan [NFC][compiler-rt][test] Fully qualify string -> std::string 2020-02-19 08:59:26 -08:00
builtins [Hexagon] Define __ELF__ by default. 2020-02-21 16:10:31 -06:00
cfi Improve error message when '=' is missing in {ASAN,...}_OPTIONS. 2019-06-15 01:37:14 +00:00
crt Check for aarch64 when not using .init_arrays 2020-01-02 10:10:49 -08:00
dfsan [compiler-rt] Remove some cpplint filters 2019-09-12 02:20:36 +00:00
fuzzer [libFuzzer] Fix denominator in the "inputs have DFT" log line. 2020-02-19 11:05:14 -08:00
gwp_asan [GWP-ASan] Silence gcc error 2020-02-13 13:08:37 -08:00
hwasan hwasan_symbolize: allow 0x in the address field 2020-02-03 18:23:48 -08:00
interception Fix check-interception link error in compiler-rt debug mode 2019-10-10 23:30:54 +00:00
lsan [lsan] Support LeakSanitizer runtime on Fuchsia 2020-01-28 11:34:53 -08:00
msan [SanitizerCommon] Print the current value of options when printing out help. 2019-11-14 14:04:34 -08:00
profile [profile] Don't dump counters when forking and don't reset when calling exec** functions 2020-02-24 10:38:33 +01:00
safestack compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cpp 2019-08-01 13:56:52 +00:00
sanitizer_common [compiler-rt] Restrict sanitizer_linux.cpp dlinfo(3) to FreeBSD 2020-02-11 12:10:03 +01:00
scudo [scudo][standalone] Shift some data from dynamic to static 2020-02-18 09:38:50 -08:00
stats compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
tsan tsan: removing redundant loop in ThreadClock::release() 2020-02-19 17:30:00 +01:00
ubsan [UBSan] Appease linter 2019-10-10 11:32:06 +00:00
ubsan_minimal compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cpp 2019-08-01 12:41:23 +00:00
xray Re-land "[compiler-rt] Migrate llvm::make_unique to std::make_unique" 2019-08-15 14:57:44 +00:00
CMakeLists.txt Reland "[compiler-rt] Simple crtbegin.o and crtend.o implementation" 2019-04-30 18:13:22 +00:00