dev-master
9999999-devConverts XDebug TRACE files to https://github.com/brendangregg/FlameGraph compatible input
MIT
1.0.0
1.0.0.0Converts XDebug TRACE files to https://github.com/brendangregg/FlameGraph compatible input
MIT
Converts XDebug TRACE files to https://github.com/brendangregg/FlameGraph compatible input
From a given Xdebug generated trace file, outputs text suitable for https://github.com/brendangregg/FlameGraph flamegraph generator., (*1)
This requires xdebug.trace_format
setting to be set to 1
., (*2)
xdebug.trace_format
setting must be 1
in PHP configuration.This will output a trace file using time relative cost for each function:, (*3)
xtrace2fg TRACE_FILE | flamegraph.pl > OUTPUT.svg
And this will output a trace file using memory relative cost for each function:, (*4)
xtrace2fg memory TRACE_FILE | flamegraph.pl --color=mem > OUTPUT.svg
Where:, (*5)
FILE is the Xdebug TRACE file (generated using xdebug.trace_format=1), (*6)
OUTPUT.svg if the output filename, (*7)
You can load the SVG output file into any recent browser to benefit from browsing capabilities in the flame graph., (*8)
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., (*9)
XDEBUG_MODE=trace XDEBUG_TRIGGER=1 php -d'xdebug.trace_format=1' -f samples/test.php cp /tmp/trace.XXXXXX.xt samples/test.xt ./xtrace2fg samples/test.xt > samples/test.cost.output cat samples/test.cost.output | ~/FlameGraph/flamegraph.pl > samples/test.cost.svg ./xtrace2fg memory samples/test.xt > samples/test.memory.output cat samples/test.memory.output | ~/FlameGraph/flamegraph.pl --color=mem > samples/test.memory.svg
Converts XDebug TRACE files to https://github.com/brendangregg/FlameGraph compatible input
MIT
Converts XDebug TRACE files to https://github.com/brendangregg/FlameGraph compatible input
MIT