Skip to content

feat(profiling): support generator unwinding#3807

Merged
morrisonlevi merged 7 commits intomasterfrom
PROF-14308-Support-generator-unwinding
Apr 22, 2026
Merged

feat(profiling): support generator unwinding#3807
morrisonlevi merged 7 commits intomasterfrom
PROF-14308-Support-generator-unwinding

Conversation

@morrisonlevi
Copy link
Copy Markdown
Collaborator

@morrisonlevi morrisonlevi commented Apr 20, 2026

Description

This adds support for generator unwinding in stack traces by calling zend_generator_check_placeholder_frame.

Note that there are some revert commits in the commit history. This is so you can see that prof-correctness tests fail without the implementation, and they pass now after re-applying the commits.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

morrisonlevi and others added 3 commits April 20, 2026 13:58
Covers the yield-from placeholder-frame path: the PHP script chains
main -> middle -> leaf via `yield from`, and the JSON asserts that
allocations inside `leaf` report the full delegating chain. Without
resolving the placeholder frame, `middle` would be missing from the
stack.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…er_frame

`cargo test` links the profiler as a regular binary, so the Zend symbol
cannot be resolved the way it is for the cdylib (lazy, at PHP load time).
Add a passthrough stub under CFG_STACK_WALKING_TESTS and swap the import
in stack_walking.rs the same way ddog_php_prof_function_run_time_cache is
handled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@morrisonlevi morrisonlevi added the profiling Relates to the Continuous Profiler label Apr 20, 2026
@datadog-prod-us1-5
Copy link
Copy Markdown

datadog-prod-us1-5 Bot commented Apr 20, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.68% (+0.04%)

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

…laceholder_frame"

This reverts commit ea7bb074999dbcde5a8f78d3c673383818641719.
This reverts commit 944a3cb8104f8c6faec54be4b8d12277b6c45dcd.
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 20, 2026

Benchmarks [ profiler ]

Benchmark execution time: 2026-04-20 23:29:07

Comparing candidate commit f2234b0 in PR branch PROF-14308-Support-generator-unwinding with baseline commit c46963f in branch master.

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

@morrisonlevi morrisonlevi marked this pull request as ready for review April 20, 2026 23:37
@morrisonlevi morrisonlevi requested review from a team as code owners April 20, 2026 23:37
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.

Looks right to me

@morrisonlevi morrisonlevi merged commit 9a2b413 into master Apr 22, 2026
2097 of 2100 checks passed
@morrisonlevi morrisonlevi deleted the PROF-14308-Support-generator-unwinding branch April 22, 2026 23:06
@github-actions github-actions Bot added this to the 1.19.0 milestone Apr 22, 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.

2 participants