Download the PHP package pounard/xtrace2fg without Composer
On this page you can find all versions of the php package pounard/xtrace2fg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pounard/xtrace2fg
More information about pounard/xtrace2fg
Files in pounard/xtrace2fg
Package xtrace2fg
Short Description Converts XDebug TRACE files to https://github.com/brendangregg/FlameGraph compatible input
License MIT
Informations about the package xtrace2fg
XDebug TRACE files to FlameGraph converter
From a given Xdebug generated trace file, outputs text suitable for https://github.com/brendangregg/FlameGraph flamegraph generator.
This requires xdebug.trace_format
setting to be set to 1
.
Prerequisites
- You need https://github.com/brendangregg/FlameGraph to be installed somewhere.
xdebug.trace_format
setting must be1
in PHP configuration.
Usage
This will output a trace file using time relative cost for each function:
And this will output a trace file using memory relative cost for each function:
Where:
-
FILE is the Xdebug TRACE file (generated using xdebug.trace_format=1)
- OUTPUT.svg if the output filename
You can load the SVG output file into any recent browser to benefit from browsing capabilities in the flame graph.
Warning, memory support is experimental, and is NOT doing what you'd expect because it will revert all functions that actually free memory to 0. You will see functions that consume memory without freeing it, but it not necessarily mean it's a leak, since it could be garbage collected somewhere else.