From e70e36754f0c5bbcd9dc54fa3119f7bec0df8907 Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Fri, 9 Jan 2026 10:07:23 -0800 Subject: [PATCH 1/8] make encoders_profile gitlab job --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3991ecfd346..d977e3dd1ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -400,3 +400,21 @@ lib_injection_tests: - pyenv install ${PYTHON} && pyenv global ${PYTHON} - python --version - python lib-injection/sources/sitecustomize.py + + +encoders_profile: + needs: [] + stage: tests + tags: [ "arch:amd64" ] + image: registry.ddbuild.io/images/mirror/ubuntu:25.04 + script: + - export PYENV_ROOT="${HOME}/.pyenv" + - export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}" + - apt-get update && apt install build-essential zlib1g-dev libssl-dev curl git -y + - PYENV_GIT_TAG=v2.6.17 curl https://pyenv.run | bash + - pyenv --version + - pyenv install 3.10 && pyenv global 3.10 + - python --version + - mkdir profile_output + - bash scripts/profiles/encoders/setup.sh profile_output + - bash scripts/profiles/encoders/run.sh profile_output From 49f16bf56ca106f7e1e7e20a1e0cdfaad73e0dbb Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Fri, 9 Jan 2026 10:13:28 -0800 Subject: [PATCH 2/8] rustup --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d977e3dd1ee..11e5e9fa7bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -415,6 +415,9 @@ encoders_profile: - pyenv --version - pyenv install 3.10 && pyenv global 3.10 - python --version + - | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + export PATH="$HOME/.cargo/bin:$PATH" - mkdir profile_output - bash scripts/profiles/encoders/setup.sh profile_output - bash scripts/profiles/encoders/run.sh profile_output From b2a68ead6c6c16d2ba853a3de39d2bc9190c428b Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Fri, 9 Jan 2026 10:34:10 -0800 Subject: [PATCH 3/8] no sudo ctypes --- scripts/profiles/encoders/run.sh | 4 ++-- scripts/profiles/encoders/setup.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/profiles/encoders/run.sh b/scripts/profiles/encoders/run.sh index c8bc19cd8aa..a9ed3a00ba8 100755 --- a/scripts/profiles/encoders/run.sh +++ b/scripts/profiles/encoders/run.sh @@ -20,7 +20,7 @@ function profile { PYTHONPATH="." python scripts/profiles/encoders/run.py ${ver} & sleep 2 - sudo `which austinp` -bsi ${AUSTIN_INTERVAL} -x ${AUSTIN_EXPOSURE} -o ${PREFIX}/artifacts/${ver/./_}.mojo -p $! + `which austinp` -bsi ${AUSTIN_INTERVAL} -x ${AUSTIN_EXPOSURE} -o ${PREFIX}/artifacts/${ver/./_}.mojo -p $! LC_ALL=C sed -i 's|/home/runner/work/dd-trace-py/dd-trace-py/ddtrace/||g' ${PREFIX}/artifacts/${ver/./_}.mojo austinp-resolve ${PREFIX}/artifacts/${ver/./_}.mojo ${PREFIX}/artifacts/${ver/./_}.resolved.mojo || true } @@ -30,4 +30,4 @@ source ${PREFIX}/bin/activate profile "v0.4" profile "v0.5" -sudo chown -R $(id -u):$(id -g) ${PREFIX}/artifacts/* +chown -R $(id -u):$(id -g) ${PREFIX}/artifacts/* diff --git a/scripts/profiles/encoders/setup.sh b/scripts/profiles/encoders/setup.sh index df3961d00ed..9aea42f128f 100755 --- a/scripts/profiles/encoders/setup.sh +++ b/scripts/profiles/encoders/setup.sh @@ -18,7 +18,7 @@ source ${PREFIX}/bin/activate pip install pip --upgrade # Install dependencies -pip install hypothesis msgpack pytest mock austin-python~=1.7 austin-dist~=3.6 +pip install ctypes hypothesis msgpack pytest mock austin-python~=1.7 austin-dist~=3.6 # Install ddtrace pip install -e . From 409c6a6f7dbcfc7080e75cdda53741c1ac2b71cd Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Fri, 9 Jan 2026 10:42:37 -0800 Subject: [PATCH 4/8] libffi for ctypes --- .gitlab-ci.yml | 2 +- scripts/profiles/encoders/setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 11e5e9fa7bb..38a8a19055f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -410,7 +410,7 @@ encoders_profile: script: - export PYENV_ROOT="${HOME}/.pyenv" - export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}" - - apt-get update && apt install build-essential zlib1g-dev libssl-dev curl git -y + - apt-get update && apt install build-essential zlib1g-dev libssl-dev curl git libffi-dev -y - PYENV_GIT_TAG=v2.6.17 curl https://pyenv.run | bash - pyenv --version - pyenv install 3.10 && pyenv global 3.10 diff --git a/scripts/profiles/encoders/setup.sh b/scripts/profiles/encoders/setup.sh index 9aea42f128f..df3961d00ed 100755 --- a/scripts/profiles/encoders/setup.sh +++ b/scripts/profiles/encoders/setup.sh @@ -18,7 +18,7 @@ source ${PREFIX}/bin/activate pip install pip --upgrade # Install dependencies -pip install ctypes hypothesis msgpack pytest mock austin-python~=1.7 austin-dist~=3.6 +pip install hypothesis msgpack pytest mock austin-python~=1.7 austin-dist~=3.6 # Install ddtrace pip install -e . From 1461c6275d08d95f7a5fa5b988ebc3aa489ba334 Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Fri, 9 Jan 2026 10:59:57 -0800 Subject: [PATCH 5/8] install sudo --- .gitlab-ci.yml | 2 +- scripts/profiles/encoders/run.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 38a8a19055f..641213218c6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -410,7 +410,7 @@ encoders_profile: script: - export PYENV_ROOT="${HOME}/.pyenv" - export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}" - - apt-get update && apt install build-essential zlib1g-dev libssl-dev curl git libffi-dev -y + - apt-get update && apt install build-essential zlib1g-dev libssl-dev curl git libffi-dev sudo -y - PYENV_GIT_TAG=v2.6.17 curl https://pyenv.run | bash - pyenv --version - pyenv install 3.10 && pyenv global 3.10 diff --git a/scripts/profiles/encoders/run.sh b/scripts/profiles/encoders/run.sh index a9ed3a00ba8..c8bc19cd8aa 100755 --- a/scripts/profiles/encoders/run.sh +++ b/scripts/profiles/encoders/run.sh @@ -20,7 +20,7 @@ function profile { PYTHONPATH="." python scripts/profiles/encoders/run.py ${ver} & sleep 2 - `which austinp` -bsi ${AUSTIN_INTERVAL} -x ${AUSTIN_EXPOSURE} -o ${PREFIX}/artifacts/${ver/./_}.mojo -p $! + sudo `which austinp` -bsi ${AUSTIN_INTERVAL} -x ${AUSTIN_EXPOSURE} -o ${PREFIX}/artifacts/${ver/./_}.mojo -p $! LC_ALL=C sed -i 's|/home/runner/work/dd-trace-py/dd-trace-py/ddtrace/||g' ${PREFIX}/artifacts/${ver/./_}.mojo austinp-resolve ${PREFIX}/artifacts/${ver/./_}.mojo ${PREFIX}/artifacts/${ver/./_}.resolved.mojo || true } @@ -30,4 +30,4 @@ source ${PREFIX}/bin/activate profile "v0.4" profile "v0.5" -chown -R $(id -u):$(id -g) ${PREFIX}/artifacts/* +sudo chown -R $(id -u):$(id -g) ${PREFIX}/artifacts/* From b4f22d1a895cb1fd8d38807d5deb89372ffcde3b Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Fri, 9 Jan 2026 11:29:12 -0800 Subject: [PATCH 6/8] no bash --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 641213218c6..f21cfb7a52a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -419,5 +419,5 @@ encoders_profile: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y export PATH="$HOME/.cargo/bin:$PATH" - mkdir profile_output - - bash scripts/profiles/encoders/setup.sh profile_output - - bash scripts/profiles/encoders/run.sh profile_output + - scripts/profiles/encoders/setup.sh profile_output + - scripts/profiles/encoders/run.sh profile_output From f9950be625281ecec5eba8304b09a6efce2dbe75 Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Fri, 9 Jan 2026 11:34:04 -0800 Subject: [PATCH 7/8] bash flags --- scripts/profiles/encoders/run.sh | 2 +- scripts/profiles/encoders/setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/profiles/encoders/run.sh b/scripts/profiles/encoders/run.sh index c8bc19cd8aa..66372281fe6 100755 --- a/scripts/profiles/encoders/run.sh +++ b/scripts/profiles/encoders/run.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash -eu +#!/usr/bin/bash set -eu diff --git a/scripts/profiles/encoders/setup.sh b/scripts/profiles/encoders/setup.sh index df3961d00ed..db4f01c8d2d 100755 --- a/scripts/profiles/encoders/setup.sh +++ b/scripts/profiles/encoders/setup.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash -eu +#!/usr/bin/bash set -eu From 4e90b68324e28650dfb67a4d9ad3d7fab53a622c Mon Sep 17 00:00:00 2001 From: Emmett Butler Date: Mon, 12 Jan 2026 11:07:02 -0800 Subject: [PATCH 8/8] cast it into the fire --- .github/workflows/django-overhead-profile.yml | 47 ------------------- .github/workflows/encoders-profile.yml | 47 ------------------- .github/workflows/flask-overhead-profile.yml | 43 ----------------- .gitlab-ci.yml | 21 --------- 4 files changed, 158 deletions(-) delete mode 100644 .github/workflows/django-overhead-profile.yml delete mode 100644 .github/workflows/encoders-profile.yml delete mode 100644 .github/workflows/flask-overhead-profile.yml diff --git a/.github/workflows/django-overhead-profile.yml b/.github/workflows/django-overhead-profile.yml deleted file mode 100644 index e53d9aa916a..00000000000 --- a/.github/workflows/django-overhead-profile.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: django-overhead-profile -on: - push: - branches: - - main - - mq-working-branch-* - merge_group: - pull_request: - paths: - - 'ddtrace/**' - - 'scripts/profiles/django-simple/**' - - '.github/workflows/django-overhead-profile.yml' - -jobs: - django-overhead-profile: - runs-on: ubuntu-latest - env: - PREFIX: ${{ github.workspace }}/prefix - DD_CODE_ORIGIN_FOR_SPANS_ENABLED: "1" - DD_PROFILING_ENABLED: "1" - DD_PROFILING_OUTPUT_PPROF: ${{ github.workspace }}/prefix/artifacts/ddtrace_profile - DD_EXCEPTION_REPLAY_ENABLED: "1" - defaults: - run: - working-directory: ddtrace - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - path: ddtrace - - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: "3.10" - - - name: Setup - run: | - bash scripts/profiles/django-simple/setup.sh ${PREFIX} - - - name: Run - run: | - bash scripts/profiles/django-simple/run.sh ${PREFIX} - - - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: django-overhead-profile - path: ${{ github.workspace }}/prefix/artifacts diff --git a/.github/workflows/encoders-profile.yml b/.github/workflows/encoders-profile.yml deleted file mode 100644 index 884719dc4e2..00000000000 --- a/.github/workflows/encoders-profile.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: encoders-profile -on: - push: - branches: - - main - - mq-working-branch-* - merge_group: - pull_request: - paths: - - 'ddtrace/internal/_encoding.pyx' - - 'scripts/profiles/encoders/**' - - '.github/workflows/encoders-profile.yml' - -jobs: - encoders-profile: - runs-on: ubuntu-latest - env: - PREFIX: ${{ github.workspace }}/prefix - defaults: - run: - working-directory: ddtrace - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - path: ddtrace - - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: "3.10" - - - name: Setup - run: | - bash scripts/profiles/encoders/setup.sh ${PREFIX} - - - name: Run - run: | - bash scripts/profiles/encoders/run.sh ${PREFIX} - for a in `ls ${PREFIX}/artifacts` - do - sed -i 's|${{ github.workspace }}/ddtrace/||g' ${PREFIX}/artifacts/$a - done - - - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: encoders-profile - path: ${{ github.workspace }}/prefix/artifacts diff --git a/.github/workflows/flask-overhead-profile.yml b/.github/workflows/flask-overhead-profile.yml deleted file mode 100644 index d34fff2a338..00000000000 --- a/.github/workflows/flask-overhead-profile.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: flask-overhead-profile -on: - push: - branches: - - main - - mq-working-branch-* - merge_group: - pull_request: - paths: - - 'ddtrace/**' - - 'scripts/profiles/flask-simple/**' - - '.github/workflows/flask-overhead-profile.yml' - -jobs: - flask-overhead-profile: - runs-on: ubuntu-latest - env: - PREFIX: ${{ github.workspace }}/prefix - defaults: - run: - working-directory: ddtrace - steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - path: ddtrace - - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 - with: - python-version: "3.10" - - - name: Setup - run: | - bash scripts/profiles/flask-simple/setup.sh ${PREFIX} - - - name: Run - run: | - bash scripts/profiles/flask-simple/run.sh ${PREFIX} - - - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: flask-overhead-profile - path: ${{ github.workspace }}/prefix/artifacts diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f21cfb7a52a..3991ecfd346 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -400,24 +400,3 @@ lib_injection_tests: - pyenv install ${PYTHON} && pyenv global ${PYTHON} - python --version - python lib-injection/sources/sitecustomize.py - - -encoders_profile: - needs: [] - stage: tests - tags: [ "arch:amd64" ] - image: registry.ddbuild.io/images/mirror/ubuntu:25.04 - script: - - export PYENV_ROOT="${HOME}/.pyenv" - - export PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}" - - apt-get update && apt install build-essential zlib1g-dev libssl-dev curl git libffi-dev sudo -y - - PYENV_GIT_TAG=v2.6.17 curl https://pyenv.run | bash - - pyenv --version - - pyenv install 3.10 && pyenv global 3.10 - - python --version - - | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - export PATH="$HOME/.cargo/bin:$PATH" - - mkdir profile_output - - scripts/profiles/encoders/setup.sh profile_output - - scripts/profiles/encoders/run.sh profile_output