Skip to content

Add support for collapsing PHP Xdebug traces#253

Open
MaartenStaa wants to merge 26 commits intojonhoo:mainfrom
MaartenStaa:collapse-xdebug
Open

Add support for collapsing PHP Xdebug traces#253
MaartenStaa wants to merge 26 commits intojonhoo:mainfrom
MaartenStaa:collapse-xdebug

Conversation

@MaartenStaa
Copy link

Inspired by and continued from #126 by @daniellockyer

This PR is a bit different, because in the meantime Xdebug 3 was released, which apparently introduced a new tracing format as far as I can tell based on the samples I've taken, and the old code. One caveat is that Xdebug actually produces gzipped files, which is not (yet) handled here, as it seems a bit out of scope for this tool.

I went through the comments on the old PR and think I've tackled them all, but please let me know if you have any other feedback.

Also, I love your streams and your book, keep up the great work :)

@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #253 (0dccda7) into master (acc8981) will decrease coverage by 0.50%.
The diff coverage is 79.37%.

@@            Coverage Diff             @@
##           master     #253      +/-   ##
==========================================
- Coverage   87.32%   86.82%   -0.51%     
==========================================
  Files          18       19       +1     
  Lines        2525     2687     +162     
==========================================
+ Hits         2205     2333     +128     
- Misses        320      354      +34     
Impacted Files Coverage Δ
src/collapse/mod.rs 52.63% <ø> (ø)
src/collapse/xdebug.rs 78.98% <78.98%> (ø)
src/collapse/guess.rs 72.09% <100.00%> (+1.36%) ⬆️
src/flamegraph/svg.rs 75.90% <0.00%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acc8981...0dccda7. Read the comment docs.

@lucc
Copy link

lucc commented Jan 13, 2026

Hello @MaartenStaa are you still interested in working on this? I would be interested in having this in an inferno release as I am still stuck on some old PHP version (PHP 7.4 on Rocky 8) and that does not have the xdebug.trace_format=3 (I assume your PR is for the trace_format=1).

@jonhoo are you still interested in including this code in inferno? Note that new PHP versions can natively produce a proper flamegraph trace with the xdebug.trace_format=3. But it might still be valuable for people that can not yet use xdebug >= 3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants