This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new f0bb0c9538b [feature](coverage): refresh the coverage file before 
exiting the program (#28740)
f0bb0c9538b is described below

commit f0bb0c9538b4060fcd51cddffa5e38297498d838
Author: feifeifeimoon <wangyufeim...@gmail.com>
AuthorDate: Thu Dec 21 11:11:42 2023 +0800

    [feature](coverage): refresh the coverage file before exiting the program 
(#28740)
---
 be/CMakeLists.txt             | 2 +-
 be/src/service/doris_main.cpp | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 116c4fd96e0..d59ee18f8ed 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -739,7 +739,7 @@ set(BUILD_SHARED_LIBS OFF)
 
 option(ENABLE_CLANG_COVERAGE "coverage option" OFF)
 if (ENABLE_CLANG_COVERAGE AND ENABLE_CLANG_COVERAGE STREQUAL ON AND 
COMPILER_CLANG)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate 
-fcoverage-mapping")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate 
-fcoverage-mapping -DLLVM_PROFILE")
 endif ()
 
 if (${MAKE_TEST} STREQUAL "ON")
diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index d0c68996b38..a350f4438ae 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -77,6 +77,7 @@ static void help(const char*);
 
 extern "C" {
 void __lsan_do_leak_check();
+int __llvm_profile_write_file();
 }
 
 namespace doris {
@@ -549,7 +550,11 @@ int main(int argc, char** argv) {
 #endif
         sleep(10);
     }
-
+    LOG(INFO) << "Doris main exiting.";
+#if defined(LLVM_PROFILE)
+    __llvm_profile_write_file();
+    LOG(INFO) << "Flush profile file.";
+#endif
     doris::TabletSchemaCache::stop_and_join();
     http_service.stop();
     brpc_service.join();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to