I am attempting to use xdebug to profile an application written in php7.
I've written a script that sets the follow ini
settings:
ini_set('xdebug.trace_format',1); // Note: I tried 0 and 2 here as well
ini_set('xdebug.profiler_enable',1);
xdebug_start_trace('/tmp/cachegrind.out');
// RUN CODE HERE
xdebug_stop_trace();
Running the script created the cachegrind files as I would expect:
root@host:/# ls /tmp | grep cachegrind
cachegrind.out.0028fd.xt
cachegrind.out.0072ab.xt
cachegrind.out.009b09.xt
cachegrind.out.025ac3.xt
Here is the first few lines of a cachegrind file so that the format is visible:
Version: 2.4.1
File format: 4
TRACE START [2016-10-28 05:26:57]
2 3784 1 0.242945 2692856
2 3785 0 0.242955 2692800 DI\Container->set 1 /path/public/api/index.php 100
2 3785 1 0.242966 2692800
2 3786 0 0.242973 2692800 spl_autoload_call 0 /path/public/api/index.php 103
3 3787 0 0.242982 2692896 Fuel\Core\Autoloader::load 1 /path/public/api/index.php 103
4 3788 0 0.242990 2692896 strpos 0 /path/fuel/core/classes/autoloader.php 219
However, when I try to open this file in qcachegrind
, it fails to open:
The error message reads: "Error loading /path/to/cachegrind/file
: Unknown file format
Anyone know what's going on here? I'd like to be able to use a tool like this to profile my application.
I also shelled out $30 to try opening the file in MCG but that app crashes immediately upon opening any of these files.
As a side note, the file is fairly large, but not so large that I'd expect apps to be freaking out:
❯ ls -al /Users/johnpc/repos/cachegrind.out.094ffa.xt
-rw-r--r-- 1 johnpc staff 62744095 Oct 28 02:13 /Users/johnpc/repos/cachegrind.out.094ffa.xt