jokkedk/webgrind

I cannot see the profiles listed in the dropdown of webgrind

Opened this issue ยท 9 comments

What steps will reproduce the problem?

  1. I set a profile_log as the output directory for xdebug which is in root
    folder.
  2. I set the same location in webgrind config file also
  3. I have necessary permissions to read and write into that file
  4. Still I dont see any profiles listed in the webgrind dropdown

What is the expected output? What do you see instead?
It should actually show all the profiles in the dropdown. I run one
website other than webgrind. Profile was getting created in the output
folder I mentioned for xdebug. But it was not showing up in the profile
dropdown in webgrind

What version of the product are you using? On what operating system?
Webgrind I am using the latest version and my operating system is windows
XP.

If you have verified that you can see actual cachegrind files being generated in your profiler_output_dir location, then it sounds like webgrind just doesn't see them.

I found today that having the %s script name piece in the profiler_output_name file format mask would result in webgrind not seeing any of the cachegrind files that I verified were in my profiler_output_dir.

You might try commenting out the profiler_output_name, thereby letting it default to cachegrind.out.%p , generate some cachegrind files that are in that format, and see if webgrind can see those.

Tried that, Webgrind still doesn't locate the files.

meal commented

I also have the same problem.

I too have the same issue (WIndows 7, Wamp 2). I have checked the directory and there are two files.

[xdebug]
xdebug.remote_enable=on
xdebug.remote_host="localhost"
xdebug.profiler_enable=1
xdebug.profiler_output_dir = "E:/wamp/tmp/xdebug"
;xdebug.profiler_output_name = "cachegrind.out.%p"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.idekey=xdebug
xdebug.remote_log="E:/wamp/tmp/xdebug/xdebug_remot.log"
zend_extension=E:/wamp/bin/php/php5.3.0/ext/php_xdebug.dll

config.php
static $storageDir = 'E:\wamp\tmp\xdebug';
static $profilerDir = 'E:\wamp\tmp\xdebug';

cb0 commented

I have exactly the same bug. Running on OS X "10.4.0 Darwin Kernel Version" with PHP Version 5.3.2.
Here is the stack track I get:

referer: http://localhost/grind/
[Wed May 25 15:13:08 2011] [error] [client ::1] PHP Stack trace:, referer: http://localhost/grind/
[Wed May 25 15:13:08 2011] [error] [client ::1] PHP 1. {main}() /Users/cbo/Sites/grind/index.php:0, referer: http://localhost/grind/
[Wed May 25 15:13:08 2011] [error] [client ::1] PHP 2. Webgrind_FileHandler::getInstance() /Users/cbo/Sites/grind/index.php:22, referer: http://localhost/grind/
[Wed May 25 15:13:08 2011] [error] [client ::1] PHP 3. Webgrind_FileHandler->__construct() /Users/cbo/Sites/grind/library/FileHandler.php:20, referer: http://localhost/grind/
[Wed May 25 15:13:08 2011] [error] [client ::1] PHP 4. Webgrind_FileHandler->getPrepFiles() /Users/cbo/Sites/grind/library/FileHandler.php:29, referer: http://localhost/grind/

Same problem here. They were all appearing fin3, then I refreshed and now they are all gone and I can't get them back. Tried clearing my cache and tried other browsers. Nothing. There are definitely cachegrind files and webgrind appears to be looking in the correct location. Nothing else changed.

I'm running xDebug on MAMP, PHP 5.2. Webgrind version 1.1.

** UPDATE **

I cleared out all existing cachegrind files, rebooted my server, did some tests to create new cachegrind files, then re-opened WebGrind. It's working again.

I had a similar issue. After much messing around I found it was a problem with the file locations path. Webgrind was pulling the xdebug save dir from the php.ini then using realPath( )' format it. Because it was returning a value from theini_get('xdebug.profiler_output_dir')the$profilerDirin the config file was ignored.realPath( )` was returning false and hence it could not find the files.

Long story short I had set my xdebug save location in the php.ini (xdebug.profiler_output_dir) to
var/www/xdebug
Which was working find. However running realPath( ) on it failed. Hence changing it to
/var/www/xdebug
With the preceding slash fixed it.

IIS/Windows/PHP via fast CGI
PHP 7.0

I had the same issue. The solution for me was to change xdebug.profiler_output_name= "cachegrind.out.%s"

The default option cachegrind.out.%p uses the PID to append to the file name. The issue I had was that every time a script was run, including webgrind, it ran using the same PID which overwrote the cachegrind file every time. Since webgrind is developed to ignore cachegrind files generated by the app itself, each invocation of webgrind would overwrite the cachegrind file and subsequently ignore itself! Changing the xdebug.profiler_output_name to the above option will append the script name to the cachegrind file, mitigating the issue.

@marknokes, cachegrind.out.%t did it for me. Great tool @jokkedk!