View Issue Details

IDProjectCategoryView StatusLast Update
0000613XdebugProfilingpublic2021-03-17 17:29
ReporterTyrael Assigned Toderick  
PrioritylowSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version2.2dev 
Summary0000613: Allow starting/stoping/restarting the profiling
DescriptionIt would be a good thing to allow the profiler to be controlled from the userland.
This could especially be handy when you have to profile daemons, because if you call pcntl_fork then the file descriptors would be cloned.
This would cause that both instance would be outputting the profiling information to the same file, and which is far more worse: the file handler would be closed when the parent or any child exits.
TagsNo tags attached.
Operating System
PHP Version5.3.3

Activities

derick

2016-12-13 21:05

administrator   ~0004040

This would be good to have, but with the current architecture it's really difficult to do. So I am not targeting this for a specific version.

jimp

2019-08-25 21:34

reporter   ~0005124

Starting and stopping like the function trace feature would be great. But would it be possible to fix it like 0000938 did for debugging forked processes, basically starting a new profile instance when the PID changes? Unfortunately none of the trigger mechanisms provided by xdebug.profiler_enable_trigger work with forked processes since the standard PHP request processing is not occurring.

See: https://bugs.xdebug.org/view.php?id=938

Fixed issue 0000938: Improve support for debugging forked PHP scripts
https://github.com/xdebug/xdebug/commit/421f19e90da0ac444725102ffed3acd3d4cc23fc

derick

2021-03-17 09:21

administrator   ~0005740

Is this issue still relevant to you?

jimp

2021-03-17 14:35

reporter   ~0005789

Yes. I am still working with daemon PHP processes that do the 99% of the actual work and profiling is desirable. Last I tried this, I couldn't profile the daemon process either because the profiler closes as soon as the first child exits. I also think it would help when working with Swoole coroutines that handle separate requests.

Issue History

Date Modified Username Field Change
2010-09-03 14:56 Tyrael New Issue
2010-09-03 14:56 Tyrael PHP Version => 5.3.3
2010-09-03 14:56 Tyrael Xdebug Version => 2.2.0-dev
2016-12-13 21:05 derick Note Added: 0004040
2016-12-13 21:05 derick Assigned To => derick
2016-12-13 21:05 derick Status new => acknowledged
2019-08-25 21:34 jimp Note Added: 0005124
2020-03-12 16:47 derick Category Feature/Change request => Profiling
2021-03-17 09:21 derick Status acknowledged => feedback
2021-03-17 09:21 derick Note Added: 0005740
2021-03-17 14:35 jimp Note Added: 0005789
2021-03-17 17:29 derick Priority normal => low
2021-03-17 17:29 derick Status feedback => new