View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001710 | Xdebug | Profiling | public | 2019-10-04 16:59 | 2020-11-18 15:33 |
Reporter | enor | Assigned To | derick | ||
Priority | low | Severity | minor | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | 2.6.0 | ||||
Target Version | 3.1dev | ||||
Summary | 0001710: Doubled recursion count in kcachegrind on select recursive function | ||||
Description | I tried profiling a recursive function with a little test script. When viewing the cachegrind output in kcachegrind I can see the correct number of function calls when clicking the main entry point in the call graph (27). However, when i click the recursive function, it shows doubled count (54) which I did not expect. | ||||
Steps To Reproduce | 1. Run the following script in documentRoot with profiling enabled. 2. Inspect the output with kcachegrind. <?php $list = ['one', 'two', 'three']; foreach ($list as $item) { outputWithRecursion($item, 10); } function outputWithRecursion(string $item, int $countdown): void { $countdown--; if ($countdown > 0) { echo sprintf('not yet (%d)...', $countdown); outputWithRecursion($item, $countdown); } else { echo sprintf('Finally there: %s(%d) ', $item, $countdown); } } | ||||
Additional Information | PHP Version 7.2.19-0ubuntu0.18.04.2 HTTP Response Headers X-Xdebug-Profile-Filename /var/www/xworkshop/cachegrind.out.832 xdebug support enabled Version 2.6.0 IDE Key PHPSTORM # xdebug.ini settings zend_extension=xdebug.so xdebug.remote_connect_back=0 xdebug.remote_enable=0 xdebut.remote_host=localhost xdebug.remote_port=9001 xdebug.remote_log=/var/www/xworkshop/remote.log xdebug.auto_trace=1 xdebug.profiler_enable=1 xdebug.profiler_output_dir=/var/www/xworkshop | ||||
Tags | No tags attached. | ||||
Operating System | Ubuntu 18.04 | ||||
PHP Version | 7.2.15-7.2.19 | ||||
|
|
|
Thanks for filing this ticket. I'll likely address this in Xdebug 3.0, after I've done some major refactoring. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-10-04 16:59 | enor | New Issue | |
2019-10-04 16:59 | enor | File Added: cachegrind_recursion_main.png | |
2019-10-04 16:59 | enor | File Added: cachegrind_recursion_output.png | |
2019-10-07 14:48 | derick | Assigned To | => derick |
2019-10-07 14:48 | derick | Status | new => acknowledged |
2019-10-07 14:48 | derick | Note Added: 0005168 | |
2019-10-07 14:49 | derick | Target Version | => 3.0dev |
2020-11-18 15:33 | derick | Target Version | 3.0dev => 3.1dev |