Skip to content

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

Merged
realFlowControl merged 3 commits into
masterfrom
florian/profiler-debug
May 26, 2026
Merged

feat(profiler): Support PHP DEBUG builds for the profiler#3908
realFlowControl merged 3 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

🚦 2 Pipeline jobs failed

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

🔄 Retry job. This looks flaky and may succeed on retry. 5 tests failed due to process timeouts during execution.

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

🔄 Retry job. This looks flaky and may succeed on retry. 2 failed tests. Error: process timed out during installation of live debugger metric probe and client-side stats validation.

ℹ️ 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.70% (-0.05%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fdc38bd | 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 13:17:01

Comparing candidate commit fdc38bd in PR branch florian/profiler-debug with baseline commit 3fb0a73 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 29 metrics, 7 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
Copy link
Copy Markdown
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I always hated that there were no profiler debug builds!

Copy link
Copy Markdown
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Well, looks terrible but that's because I hate the debug API. Really wish it had the same API/ABI and everything was drop-in compatible (so you can have a debug extension on prod PHP and so on). But that's a tangent!

@realFlowControl realFlowControl merged commit 396a51e into master May 26, 2026
2125 of 2130 checks passed
@realFlowControl realFlowControl deleted the florian/profiler-debug branch May 26, 2026 14:56
@github-actions github-actions Bot added this to the 1.21.0 milestone May 26, 2026
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.

3 participants