Has anyone put together a PHP front-end for viewing Xdebug 2.x’s profiling output yet?
Xdebug 1.x had this nice xdebug_dump_function_profile() function which planted a HTML table containing the profiling stats in your output – nice an easy to use, ignoring the minor issue that doing this “in band” with the code you are profiling slants the results. With Xdebug 2.x it was dropped and you now need a tool like kcachegrind or wincachegrind, an output file generated by Xdebug acting as the middle man.
The format of the profile output file is fairly straightforward (in fact the wincachegrind developer provides a nice short summary with the install README). Perhaps the trickier issue is how to deal with large files. And this could be a valid reason to use some AJAX… In fact it’s tempting to take a shot using wxpython (the book is out BTW – and it’s good) and put together a cross platform front end, but that’s another story.
Or do I need to do it myself ? ;)
Side note: the definitive Xdebug tutorial – http://derickrethans.nl/files/phparch-xdebug-qa.pdf
Related posts:
- Introducing php-tracer-weaver php-tracer-weaver is a tool for automatically generating docblock comments, with...
- PHP Support in NetBeans 6.5 Long dismissed as a "toy Java IDE", NetBeans - Sun's...
- Ready for PHP & MySQL Week at SitePoint? To celebrate the release of the new edition of well-loved...
- Pretty URLs: Pretty Easy! The fourth edition of Build Your Own Database Driven Website...
- How to Use PHP Namespaces, Part 1: The Basics In the first part of a series of articles, Craig...







You’re just looking for an excuse to write it ;-P
April 20th, 2006 at 11:20 pm
Why bother? kcachegrind and wincachegrind both do a good job and are very fast. I’m interested to know what brings you to wonder about a webified version. Are there particular features that are missing that you are interested in?
April 20th, 2006 at 11:33 pm
I didn’t use XDebug2 at all because of the missing output features. WinCacheGrind enables a much finer grained analysis though. IMHO, the only thing that’s missing is remote file access over FTP.
April 20th, 2006 at 11:34 pm
Pain in the ass to get either of those working on OS X, unless im missing the point ;)
Then again, I can just fire up parallels and use wincachegrind.
April 21st, 2006 at 12:30 am
There isn’t really a good reason but a there are a bunch of bad reasons which, put together, start to make a good reason like;
- It’s a different tool on different platforms (and sounds like tough luck of the OS X people). Personally my desktop is about 50/50 Windows / Ubuntu these days (plus it’s nice to keep Ubuntu K-free) so I’d like to use the same thing on both
- Occasionally Wincachegrind “explodes” for no apparent reason. Not that I know my way around Delphi but without the source, it’s not promising.
- Think HTML (or XML / XSLT?) will make a better display in the end, plus it’s easier to customize
…and there’s that ;)
April 21st, 2006 at 6:54 am
Just for the record – the new release of
wincachegrind 1.0.0.12 has source files included.
April 21st, 2006 at 7:54 am
Just looking for a quick answer –seems like a lot of experts are loose here ;) — does WinCacheGrind have any features Zend Studio Profiler has not ?
Just curious…
April 21st, 2006 at 8:19 am
I’m on OSX as well, and was recently surprised to find no solution for “grinding” cachegrind files natively. Even if the output was text on the command line – similar to the output of APD’s pprofp – I’d be in heaven. Graphs are for sucks anyways ;)
Please Harry – go forth and conquer.
April 21st, 2006 at 8:24 am
I wrote a 10 line php script that does the same as the ct_annotate perl script. It’s not the same as having a kcachegrind view but I find it almost as useful.
April 21st, 2006 at 3:22 pm
Thanks for the answer.
If you said XUL I might be tempted to agree :)
April 21st, 2006 at 5:21 pm
I’ve made myself php frontend but for Xdebug tracing. This gives times of execution but of course not the way the kcachegrind does. It’s just nice readable output of xdebug xt trace file – more usefull for debugging than profiling. It’s XHTML strict with some ajax functionality (to hide/show parts of trace)
I’m planing to publish it on my site but first I want to clear out some design/functionality issues that I’ve noticed in current version. If there’s interests in that, drop me a note maybe it will motivate me to push it forward :)
April 22nd, 2006 at 10:46 am
[...] In possession of wxPython in Action and with an itch to scratch, hacked together wxDebug (thanks to Python hosting)—a front end for viewing Xdebug profiling output, the UI design being inspired by (but by no means as good as) WinCacheGrind. A screenshot… [...]
May 16th, 2006 at 6:43 am
I’d love to see a KCachegrind or WinCachegrind plugin for Eclipse PDT. Combined with XDebug, that would allow me to debug and profile my PHP code all within the same IDE.
December 2nd, 2007 at 7:44 am