From c744622109f738311a5a3c309ffd78c8b627402d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 13 Oct 2023 23:37:47 +0000 Subject: [PATCH] [Tool] Support ddprofile integration Signed-off-by: Deng Liu --- bin/start_backend.sh | 5 +++++ docker/dockerfiles/artifacts/artifact.Dockerfile | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/bin/start_backend.sh b/bin/start_backend.sh index 22b077ffac72d..7ae86758b4474 100755 --- a/bin/start_backend.sh +++ b/bin/start_backend.sh @@ -189,6 +189,11 @@ if [ ${RUN_CN} -eq 1 ]; then LOG_FILE=${LOG_DIR}/cn.out fi +if [ ${ENABLE_DD_PROFILE} == "true" ]; then + chmod 755 ${STARROCKS_HOME}/lib/ddprof + START_BE_CMD="${STARROCKS_HOME}/lib/ddprof ${START_BE_CMD}" +fi + if [ ${RUN_LOG_CONSOLE} -eq 1 ] ; then # force glog output to console (stderr) export GLOG_logtostderr=1 diff --git a/docker/dockerfiles/artifacts/artifact.Dockerfile b/docker/dockerfiles/artifacts/artifact.Dockerfile index 4be208a4f50b1..c76e29ed68d5f 100644 --- a/docker/dockerfiles/artifacts/artifact.Dockerfile +++ b/docker/dockerfiles/artifacts/artifact.Dockerfile @@ -51,4 +51,10 @@ COPY --from=fe-builder /build/starrocks/output /release/fe_artifacts COPY --from=be-builder /build/starrocks/output /release/be_artifacts COPY --from=broker-builder /build/starrocks/fs_brokers/apache_hdfs_broker/output /release/broker_artifacts + +# Get ddprof +RUN wget https://github.com/DataDog/ddprof/releases/download/v0.14.1/ddprof-0.14.1-amd64-linux.tar.xz -O ddprof-amd64-linux.tar.xz && \ + tar xvf ddprof-amd64-linux.tar.xz && \ + mv ddprof/bin/ddprof /release/be_artifacts/be/lib/ + WORKDIR /release