KCacheGrind is awesome. But the source code annotation (the “source code” tab) doesn’t work when the profile originated on a WAMP installation. When you take a profile on Windows, the header of the file looks like this:
version: 1 creator: xdebug 2.1.2 cmd: C:\wamp\www\wordpress\wp-admin\index.php part: 1 positions: line
And all of the file lines contain similar paths (
The backslashes seem to confuse KCacheGrind’s path resolution. The simple fix was to convert the backslashes to forward slashes. I did this with sed via cygwin:
sed -i 's/\\/\//g' cachegrind.out.*
You could probably achieve similar results with TextPad or GrepWin, though.
After that, all of the source code annotation worked. If it doesn’t work for you, try adding your source folder under KCacheGrind -> Settings -> Source Annotation.