PHP frontend for Xdebug profiling?

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

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

  • http://www.rideontwo.com z0s0

    You’re just looking for an excuse to write it ;-P

  • jayboots

    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?

  • http://www.phpism.net Maarten Manders

    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.

  • http://aplosmedia.com/ Eric.Coleman

    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.

  • http://www.phppatterns.com HarryF

    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?

    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

    You’re just looking for an excuse to write it ;-P

    …and there’s that ;)

  • koto

    – Occasionally Wincachegrind “explodes” for no apparent reason. Not that I know my way around Delphi but without the source, it’s not promising.

    Just for the record – the new release of
    wincachegrind 1.0.0.12
    has source files included.

  • svanpoeck

    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…

  • Bob

    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.

  • lmpmbernardo

    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.

  • jayboots

    Thanks for the answer.

    Think HTML (or XML / XSLT?) will make a better display in the end, plus it’s easier to customize.

    If you said XUL I might be tempted to agree :)

  • http://www.medikoo.com mariuszn3

    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 :)

  • Pingback: SitePoint Blogs » wxDebug

  • Mike Smullin

    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.