tideways / php-xhprof-extension

This XHProf PHP extension fork has outlived its purpose and is archived in favor of the revitalized https://github.com/longxinH/xhprof
https://tideways.com
Apache License 2.0
1.63k stars 208 forks source link

Error in data format? #63

Closed danepowell closed 5 years ago

danepowell commented 6 years ago

I'm trying to use the XHProf UI (the latest available, from back in 2015) to view data generated by Tideways (master branch, afc61bd1e3336ef207247c5e92ae6b5dab0a6e1c). I'm following the instructions in the Tideways readme pretty much to the letter to capture data. Here's what gets written: 5bad2159280f2.Drush.xhprof.txt

XHProf is throwing this error when I try to view the data:

Got error 'PHP message: Error in Raw Data: parent & child are both: Drush\Commands\DrushCommands::getConfig\n

That seems to be coming from here (if I simply comment out the return statement after that error, everything seems to work fine): https://github.com/phacility/xhprof/blob/0bbf2a2ac34f495e42aa852293fe0ed821659047/xhprof_lib/utils/xhprof_lib.php#L589

It would appear that Tideways is generating incompatible data, or I'm using it wrong somehow. Any idea what's up? I'm not really an expert on the XHProf data format.

beberlei commented 6 years ago

@danepowell Yes you are right, we are seeing this ourselves sometime. It looks like either the recursion detection is not working, or the instrumentation adds some items incorrectly. What you can do right now is unset() all entries where child and parent are the same.

DuaelFr commented 5 years ago

Why don't you replace the return; by a continue;? This would prevent the entire execution to fail as the expected return of this function is an array, not null.

beberlei commented 5 years ago

Fixed by https://github.com/tideways/php-xhprof-extension/commit/710f532cb3a3c2b6d7808f35bab4182a19f723bd