Skip to content

feat(profiler): Support PHP DEBUG builds for the profiler#3908

Open
realFlowControl wants to merge 2 commits into
masterfrom
florian/profiler-debug
Open

feat(profiler): Support PHP DEBUG builds for the profiler#3908
realFlowControl wants to merge 2 commits into
masterfrom
florian/profiler-debug

Conversation

@realFlowControl
Copy link
Copy Markdown
Member

@realFlowControl realFlowControl commented May 22, 2026

Description

This adds PHP DEBUG build support to the profiler. It is not meant to be shipped as of know, we just need this in order to run ASAN tests for the Profiler in PHP ZTS builds, as the docker images we are using for our tests do only have a ZTS ASAN version that is also DEBUG.

This PR's CI already shows, that adding this would have shown us the bug reported as #3896 in our own CI early.

Plan:

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@github-actions github-actions Bot added the profiling Relates to the Continuous Profiler label May 22, 2026
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented May 22, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 3 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [8.0]   View in Datadog   GitLab

🔄 Retry job. This looks flaky and may succeed on retry. Process timed out while running tests, specifically in agent_headers_container_id_fargate.phpt

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [8.3]   View in Datadog   GitLab

🔄 Retry job. This looks flaky and may succeed on retry. 3 failed tests: Client-side SHM stats flushing timed out, trace filters not respected, and live debugger span probe installation failed.

Profiling ASAN Tests | PHP 8.5 debug-zts-asan (arm-8core-linux)   View in Datadog   GitHub Actions

See error Unhandled error: AddressSanitizer: heap-use-after-free in zend_string_dup at /opt/php/debug-zts-asan/include/php/Zend/zend_string.h:217

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.74% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e7932ed | Docs | Datadog PR Page | Give us feedback!

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 22, 2026

Benchmarks [ profiler ]

Benchmark execution time: 2026-05-26 10:47:21

Comparing candidate commit e7932ed in PR branch florian/profiler-debug with baseline commit 0fb4c56 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 9 unstable metrics.

realFlowControl and others added 2 commits May 26, 2026 12:27
The extern "C" alloc/free/realloc handlers delegate to a shared
*_impl function to avoid duplicating the body across the
cfg(php_debug) / cfg(not(php_debug)) variants. While LTO=fat +
codegen-units=1 in release builds would inline these single-call-site
wrappers anyway, this makes the perf contract explicit and removes
any doubt about an extra call surviving in the allocator hot path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@realFlowControl realFlowControl force-pushed the florian/profiler-debug branch from 12cd3e2 to e7932ed Compare May 26, 2026 10:30
@realFlowControl realFlowControl marked this pull request as ready for review May 26, 2026 10:47
@realFlowControl realFlowControl requested review from a team as code owners May 26, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Relates to the Continuous Profiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant