Graphical Plot of Xdebug Cachegrind
Graphical Plot of Xdebug Cachegrind - Update for How to Create Graphical View of Xdebug's Cachegrind Output.
This a command line approach of profiling a single php script using Xdebug. Running Xdebug profiler from CLI is simply by executing your php script along with xdebug directives using `-d` option, this will then create a cachegrind file which we're going to convert into a visual plot using xdebugtoolkit and Graphviz.
Requirements
Xdebug
Xdebugtoolkit
Graphviz
Procedures
Create cachegrind.
Profile your PHP script using Xdebug.
See example below to generate a cachegrind file named something like cachegrind.out. with appended timestamp within /tmp/ucpos folder.
Xdebugtoolkit.
Checkout xdebugtoolkit's latest stable version.
Convert cachegrind.
Inside xdebugtoolkit folder, execute cg2dot.py and graphviz's dot to convert cachegrind file into dot and then into PNG format.
Example below will create /tmp/ucpos/1271979967.png from parsed cachegrind /tmp/ucpos/cachegrind.out.1271979967
References
Xdebug, http://xdebug.org/
Xdebugtoolkit, http://code.google.com/p/xdebugtoolkit/
Graphviz, http://www.graphviz.org/
This a command line approach of profiling a single php script using Xdebug. Running Xdebug profiler from CLI is simply by executing your php script along with xdebug directives using `-d` option, this will then create a cachegrind file which we're going to convert into a visual plot using xdebugtoolkit and Graphviz.
Requirements
Xdebug
Xdebugtoolkit
Graphviz
Procedures
Create cachegrind.
Profile your PHP script using Xdebug.
See example below to generate a cachegrind file named something like cachegrind.out. with appended timestamp within /tmp/ucpos folder.
Xdebugtoolkit.
Checkout xdebugtoolkit's latest stable version.
Convert cachegrind.
Inside xdebugtoolkit folder, execute cg2dot.py and graphviz's dot to convert cachegrind file into dot and then into PNG format.
Example below will create /tmp/ucpos/1271979967.png from parsed cachegrind /tmp/ucpos/cachegrind.out.1271979967
References
Xdebug, http://xdebug.org/
Xdebugtoolkit, http://code.google.com/p/xdebugtoolkit/
Graphviz, http://www.graphviz.org/
Comments