mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 12:01:58 +00:00
Merge pull request #56725 from ClickHouse/linker-time-trace
Enable profiling for linker
This commit is contained in:
commit
4b7c80d824
@ -273,6 +273,11 @@ option (ENABLE_BUILD_PROFILING "Enable profiling of build time" OFF)
|
|||||||
if (ENABLE_BUILD_PROFILING)
|
if (ENABLE_BUILD_PROFILING)
|
||||||
if (COMPILER_CLANG)
|
if (COMPILER_CLANG)
|
||||||
set (COMPILER_FLAGS "${COMPILER_FLAGS} -ftime-trace")
|
set (COMPILER_FLAGS "${COMPILER_FLAGS} -ftime-trace")
|
||||||
|
|
||||||
|
if (LINKER_NAME MATCHES "lld")
|
||||||
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--time-trace")
|
||||||
|
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--time-trace")
|
||||||
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
message (${RECONFIGURE_MESSAGE_LEVEL} "Build profiling is only available with CLang")
|
message (${RECONFIGURE_MESSAGE_LEVEL} "Build profiling is only available with CLang")
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -44,9 +44,9 @@ ORDER BY (date, file, name, args_name);
|
|||||||
INPUT_DIR=$1
|
INPUT_DIR=$1
|
||||||
OUTPUT_DIR=$2
|
OUTPUT_DIR=$2
|
||||||
|
|
||||||
find "$INPUT_DIR" -name '*.json' | grep -P '\.(c|cpp|cc|cxx)\.json$' | xargs -P $(nproc) -I{} bash -c "
|
find "$INPUT_DIR" -name '*.json' -or -name '*.time-trace' | grep -P '\.(c|cpp|cc|cxx)\.json|\.time-trace$' | xargs -P $(nproc) -I{} bash -c "
|
||||||
|
|
||||||
ORIGINAL_FILENAME=\$(echo '{}' | sed -r -e 's!\.json\$!!; s!/CMakeFiles/[^/]+\.dir!!')
|
ORIGINAL_FILENAME=\$(echo '{}' | sed -r -e 's!\.(json|time-trace)\$!!; s!/CMakeFiles/[^/]+\.dir!!')
|
||||||
LIBRARY_NAME=\$(echo '{}' | sed -r -e 's!^.*/CMakeFiles/([^/]+)\.dir/.*\$!\1!')
|
LIBRARY_NAME=\$(echo '{}' | sed -r -e 's!^.*/CMakeFiles/([^/]+)\.dir/.*\$!\1!')
|
||||||
START_TIME=\$(jq '.beginningOfTime' '{}')
|
START_TIME=\$(jq '.beginningOfTime' '{}')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user