views:

810

answers:

4
+6  Q: 

XDebug trace gui?

Hey, I'm trying to find a gui to parse xdebug trace files. Although you can make them human readable, the sheer number of lines makes it unusable.

I'm looking for something like kcachegrind but for a trace file. My main goal behind all this is to find what the memory hogs are.

Thanks!

A: 

There's a script for vim at xdebug.org that lets you do 'code folding' to make them a little bit easier to dig into, but I've never seen anything that can parse that format into any kind of graphical representation.

TML
Cool i'll check that out. And if I ever get time, maybe I'll write a web based trace parser.
nolanpro
+3  A: 

I believe the PDT plugin for Eclipse will import trace logs and I know it can integrate with xdebug and do profiling

Part 1 of 5 on using PDT and xdebug

ctshryock
A: 

I just using started xdebug today came across this problem a few ahours ago too. I'd love a cachegrind style gui for xdebug traces.

A lot of the lower level calls contain uneccesary information like strlen() calls. I found that xdebug starts the trace file has 21 spaces for top level calls to functions, 23 spaces for second-level calls, 25 and so on. So you can do is grep out lines with more than 22 or more spaces to list top level calls, 24 for sencond and higher level calls etc.

cat trace.xt | grep -v '                      '

The web-based trace parser sounds a good idea. It could parse the output into a bunch of nested ul and li elements that could be collapsed. I'm tight for time too, but if you're up for a collaboration lemme know.

A: 

I don't know if this is exactly what you need, but you can enable profiling in XDebug and then dump a big cachegrind file. On my mac, I then used MacCallGrind to view those dumps in a GUI. I can at least see the whole stack of calls for a given request and how much time each call took. Is that what you mean? I haven't got that working in Eclipse PDT yet.

http://www.xdebug.org/docs/profiler

Sam McAfee
Cachegrind files are great, I use kcachegrind in ubuntu to view them. Unfortunately they don't show memory usage, which is really what I'm after. I guess at some point they did show memory but that feature was removed because it was inaccurate. However, trace files still have them.
nolanpro