I have enabled Xdebug in my PHP installation and tried it with Drupal 7. I am interested in profiling, which function runs how many times and where are called (whole tree). There are php.ini settings:

xdebug.profiler_enable_trigger = 1

In Drupal 7 it generates cachegrind.out.XXX file, which i was able to open in PHPstorm, or in wincachegrind.

But in Drupal 8, it generates aprox. 400MB file and when i try to open it (PHPstorm or wincachegrind), it throws errors. These are different Incorrect profiler snapshot format, incorrect function parameters, ...

Have someone successfully profiled Drupal 8 functions with Xdebug? Is there some special setting, which I am missing? I wonder, that in Drupal 7 it worked smoothly. Or if you have better tool for this purpose, I would be happy, if you could post it here.

I use windows and PHP 5.6. That is why I choose xdebug and asked this question. Xhprof is not for PHP 5.6 and Tideways for windows is "crap"...

enter image description here

  • Have you looked at xhprof? edit: now it is called Tideways jeffgeerling.com/blog/2017/… – Kevin Jul 20 '17 at 13:44
  • Hi @Kevin. I have tried it today, but as I have php 5.6, it is not possible to use xhprof. Tideways is paid service, and when tried under windows, it crashed my php, and there were also problems in tideways service :) I forgot to mention, that I use windows. But will try your suggested drupalVM link and let you know. – Juraj Nemec Jul 23 '17 at 14:25
  • You can run it locally as far as I understand, for free. You should run it in a VM because Windows support isn't great for LAMP based stacks and open source tools. – Kevin Jul 23 '17 at 15:28

The format shouldn't dependent on the Drupal version, most likely you're running Drupal 7 and 8 on different PHP version which may use different Xdebug.

Since XDebug 2.3, the format of cachegrind files changed and WinCacheGrind does not support this new Callgrind format yet.

So you should use XHProf, or different software which may support it, depending on your operating system.

See also: Missing function names when opening CacheGrind file in WinCacheGrind.

  • Hi. No there was the same PHP on Drupal 7 and Drupal 8 (actually i was running it on xampp for windows) PHP version 5.6. I have edited the question. But you do not answered to whole question - because it is not problem of wincachegrind, i also tried opening in phpstorm. So the problem is clearly in Xdebug, which i am trying to solve. Another solutions are good, but only as secondary approach. Main question was how to make xdebug work on specified configuration. Thanks! – Juraj Nemec Jul 23 '17 at 14:38
  • It isn't xdebug. You need to try running this in a VM, not windows. – Kevin Jul 23 '17 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.