summaryrefslogtreecommitdiff
path: root/toolchain-extras/profile-clang-extras.cpp
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2022-01-27 10:32:09 -0800
committerPirama Arumuga Nainar <pirama@google.com>2022-03-07 09:29:50 -0800
commit1d088275227fc16efee48b267ccfef65b6a55ec7 (patch)
tree73c18364cbb7a7fc6bab10af24fe89b87a686b0d /toolchain-extras/profile-clang-extras.cpp
parent6dba1c5eb7a70d71837fac4bc95ac6d76be1b8a8 (diff)
downloadextras-1d088275227fc16efee48b267ccfef65b6a55ec7.tar.gz
Create libraries for continuous mode
Bug: http://b/194128476 In continuous mode, the libraries don't need to call __llvm_profile_write_file. We still register the signal handler to keep this change low-touch. Test: build the new libraries and verify absence of call to __llvm_profile_write_file. Change-Id: I00dc15a56a41494b464a6715242c79845605ebc3
Diffstat (limited to 'toolchain-extras/profile-clang-extras.cpp')
-rw-r--r--toolchain-extras/profile-clang-extras.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/toolchain-extras/profile-clang-extras.cpp b/toolchain-extras/profile-clang-extras.cpp
index c45f9b39..6a7766ef 100644
--- a/toolchain-extras/profile-clang-extras.cpp
+++ b/toolchain-extras/profile-clang-extras.cpp
@@ -24,10 +24,16 @@ extern "C" {
static sighandler_t chained_signal_handler = SIG_ERR;
+#ifndef __CONTINUOUS_COVERAGE_MODE__
int __llvm_profile_write_file(void);
+#endif // __CONTINUOUS_COVERAGE_MODE__
static void llvm_signal_handler(__unused int signum) {
+ // TODO(pirama) Only disable __llvm_profile_write_file call to begin with.
+ // After continuous mode is stable, stop registering the signal handler.
+#ifndef __CONTINUOUS_COVERAGE_MODE__
__llvm_profile_write_file();
+#endif // __CONTINUOUS_COVERAGE_MODE__
if (chained_signal_handler != SIG_ERR && chained_signal_handler != SIG_IGN &&
chained_signal_handler != SIG_DFL) {