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

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b1f4f0cd414 [Chore](build) add addr2line msg and remove variable 
use_dwarf (#54608)
b1f4f0cd414 is described below

commit b1f4f0cd41421e90ce7f6f8105b2fc5002d3181c
Author: Pxl <[email protected]>
AuthorDate: Wed Aug 13 11:55:12 2025 +0800

    [Chore](build) add addr2line msg and remove variable use_dwarf (#54608)
    
    ### What problem does this PR solve?
    add addr2line msg and remove variable use_dwarf
    
    Clang generally defaults to using DWARFv5 for debugging information.
    This has been the default for LLVM's Clang front-end since LLVM 14.
    
    ### Check List (For Author)
    
    - Test <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [ ] Manual test (add detailed scripts or steps below)
        - [ ] No need to test or manual test. Explain why:
    - [ ] This is a refactor/code format and no logic has been changed.
            - [ ] Previous test can cover this change.
            - [ ] No code files have been changed.
            - [ ] Other reason <!-- Add your reason?  -->
    
    - Behavior changed:
        - [ ] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [ ] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 be/CMakeLists.txt                        | 5 +----
 be/src/http/action/jeprofile_actions.cpp | 5 +++++
 build.sh                                 | 7 -------
 cloud/CMakeLists.txt                     | 6 +-----
 run-be-ut.sh                             | 5 -----
 run-cloud-ut.sh                          | 5 -----
 6 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index 1d56ae859c7..86f5a772ee1 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -277,6 +277,7 @@ set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_C_STANDARD 17)
 
 add_compile_options(-g
+                    -gdwarf-5
                     -Wall
                     -Wextra
                     -Werror
@@ -389,10 +390,6 @@ if (USE_UNWIND)
     endif()
 endif()
 
-if (USE_DWARF)
-    add_compile_options(-gdwarf-5)
-endif()
-
 # For CMAKE_BUILD_TYPE=Debug
 if (OS_MACOSX AND ARCH_ARM)
     # Using -O0 may meet ARM64 branch out of range errors when linking with 
tcmalloc.
diff --git a/be/src/http/action/jeprofile_actions.cpp 
b/be/src/http/action/jeprofile_actions.cpp
index 1d94bd76584..0d2863d5600 100644
--- a/be/src/http/action/jeprofile_actions.cpp
+++ b/be/src/http/action/jeprofile_actions.cpp
@@ -22,6 +22,7 @@
 
 #include <string>
 
+#include "agent/utils.h"
 #include "http/ev_http_server.h"
 #include "http/http_channel.h"
 #include "http/http_handler.h"
@@ -114,7 +115,11 @@ void DumpJeHeapProfileToDotActions::handle(HttpRequest* 
req) {
             HttpChannel::send_reply(req, HttpStatus::INTERNAL_SERVER_ERROR,
                                     "dump heap profile to dot failed, see 
be.INFO\n");
         } else {
+            std::string msg;
+            AgentUtils util;
             dot += 
"\n-------------------------------------------------------\n";
+            util.exec_cmd("type addr2line", &msg);
+            dot += "addr2line: " + msg + "\n";
             dot += "Copy the text after `digraph` in the above output to "
                    "http://www.webgraphviz.com to generate a dot graph.\n"
                    "after start heap profiler, if there is no operation, will 
print `No nodes to "
diff --git a/build.sh b/build.sh
index 58ec36d3123..a18089aa171 100755
--- a/build.sh
+++ b/build.sh
@@ -401,10 +401,6 @@ if [[ -z "${USE_BTHREAD_SCANNER}" ]]; then
     USE_BTHREAD_SCANNER='OFF'
 fi
 
-if [[ -z "${USE_DWARF}" ]]; then
-    USE_DWARF='OFF'
-fi
-
 if [[ -z "${USE_UNWIND}" ]]; then
     if [[ "${TARGET_SYSTEM}" != 'Darwin' ]]; then
         USE_UNWIND='ON'
@@ -501,7 +497,6 @@ echo "Get params:
     GLIBC_COMPATIBILITY                 -- ${GLIBC_COMPATIBILITY}
     USE_AVX2                            -- ${USE_AVX2}
     USE_LIBCPP                          -- ${USE_LIBCPP}
-    USE_DWARF                           -- ${USE_DWARF}
     USE_UNWIND                          -- ${USE_UNWIND}
     STRIP_DEBUG_INFO                    -- ${STRIP_DEBUG_INFO}
     USE_JEMALLOC                        -- ${USE_JEMALLOC}
@@ -604,7 +599,6 @@ if [[ "${BUILD_BE}" -eq 1 ]]; then
         
-DBUILD_FILE_CACHE_MICROBENCH_TOOL="${BUILD_FILE_CACHE_MICROBENCH_TOOL}" \
         -DBUILD_INDEX_TOOL="${BUILD_INDEX_TOOL}" \
         -DSTRIP_DEBUG_INFO="${STRIP_DEBUG_INFO}" \
-        -DUSE_DWARF="${USE_DWARF}" \
         -DUSE_UNWIND="${USE_UNWIND}" \
         -DDISPLAY_BUILD_TIME="${DISPLAY_BUILD_TIME}" \
         -DENABLE_PCH="${ENABLE_PCH}" \
@@ -652,7 +646,6 @@ if [[ "${BUILD_CLOUD}" -eq 1 ]]; then
         "${CMAKE_USE_CCACHE}" \
         -DUSE_LIBCPP="${USE_LIBCPP}" \
         -DSTRIP_DEBUG_INFO="${STRIP_DEBUG_INFO}" \
-        -DUSE_DWARF="${USE_DWARF}" \
         -DUSE_JEMALLOC="${USE_JEMALLOC}" \
         -DEXTRA_CXX_FLAGS="${EXTRA_CXX_FLAGS}" \
         -DBUILD_AZURE="${BUILD_AZURE}" \
diff --git a/cloud/CMakeLists.txt b/cloud/CMakeLists.txt
index 575e55f297f..21cabcd72ec 100644
--- a/cloud/CMakeLists.txt
+++ b/cloud/CMakeLists.txt
@@ -201,11 +201,7 @@ endif()
 # For any gcc builds:
 #   -g: Enable symbols for profiler tools. Produce debugging information in 
the operating system’s native formt
 #   -Wno-unused-local-typedefs: Do not warn for local typedefs that are unused.
-set(CXX_GCC_FLAGS "${CXX_GCC_FLAGS} -ggdb -Wno-unused-local-typedefs")
-
-if (USE_DWARF)
-    set(CXX_GCC_FLAGS "${CXX_GCC_FLAGS} -gdwarf-5")
-endif()
+set(CXX_GCC_FLAGS "${CXX_GCC_FLAGS} -ggdb -Wno-unused-local-typedefs 
-gdwarf-5")
 
 # For CMAKE_BUILD_TYPE=Debug
 set(CXX_FLAGS_DEBUG "${CXX_GCC_FLAGS} -O0")
diff --git a/run-be-ut.sh b/run-be-ut.sh
index be69aa30f94..62e62e7d406 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -207,10 +207,6 @@ if [[ -z "${USE_LIBCPP}" ]]; then
     fi
 fi
 
-if [[ -z "${USE_DWARF}" ]]; then
-    USE_DWARF='OFF'
-fi
-
 if [[ -z "${USE_AVX2}" ]]; then
     USE_AVX2='ON'
 fi
@@ -243,7 +239,6 @@ cd "${CMAKE_BUILD_DIR}"
     -DUSE_LIBCPP="${USE_LIBCPP}" \
     -DBUILD_META_TOOL=OFF \
     -DBUILD_FILE_CACHE_MICROBENCH_TOOL=OFF \
-    -DUSE_DWARF="${USE_DWARF}" \
     -DUSE_UNWIND="${USE_UNWIND}" \
     -DUSE_JEMALLOC=OFF \
     -DUSE_AVX2="${USE_AVX2}" \
diff --git a/run-cloud-ut.sh b/run-cloud-ut.sh
index c74eee7b5f3..2aa3fa80a56 100755
--- a/run-cloud-ut.sh
+++ b/run-cloud-ut.sh
@@ -170,10 +170,6 @@ if [[ -z "${USE_LIBCPP}" ]]; then
     fi
 fi
 
-if [[ -z "${USE_DWARF}" ]]; then
-    USE_DWARF=OFF
-fi
-
 if [[ -n "${DISABLE_BUILD_AZURE}" ]]; then
     BUILD_AZURE='OFF'
 fi
@@ -191,7 +187,6 @@ find . -name "*.gcda" -exec rm {} \;
     -DMAKE_TEST=ON \
     -DGLIBC_COMPATIBILITY="${GLIBC_COMPATIBILITY}" \
     -DUSE_LIBCPP="${USE_LIBCPP}" \
-    -DUSE_DWARF="${USE_DWARF}" \
     -DUSE_MEM_TRACKER=ON \
     -DUSE_JEMALLOC=OFF \
     -DSTRICT_MEMORY_USE=OFF \


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to