View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000216 | Xdebug | Profiling | public | 2006-10-27 22:25 | 2020-03-12 17:37 |
Reporter | quotemstr | Assigned To | derick | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | unable to reproduce | ||
Summary | 0000216: calluser* makes profiling much less useful | ||||
Description | The problem arises from PHP using calluser* like other languages would use a direct call through an indirect function reference, e.g., a function pointer. In code that uses a lot of this style of calling functions, e.g. callbacks, it's impossible to tell what functions are called by what other functions across a call_user_func because all functions called that way are grouped together at the calluser* node. Let's say A is the set of functions that call through calluser, and B is the set of functions called. Every A will be shown as calling calluser, which then is shown to be connected to every B. We can't make the postprocessor perform the differentiation because it doesn't have enough information. My solution (and patch, will I will post later) is to recognize and special-case call_user_func, call_user_func_array, call_user_method, and call_user_method_array, and make any children of the nodes represented by these calls sibling of the call's parent. So in the example below, instead of f1()-->call_user_func, f()-->call_user_func, call_user_func-->g1() and call_user_func-->g2(), we get f1-->g1(), f2-->g2(), f1-->call_user_func() and f2-->call_user_func(). I'll post the patch in a comment or something. In the future, a more general way of recognizing and paramaterizing certain functions based on their parameters would be useful -- i.e., make any function get treated the way Xdebug currently treats require and include. | ||||
Additional Information | Example: function f1() { function f2() { function g1() { function g2() { f1(); f1 and f2 both get tagged with all the time, even though f2 is obviously a lot more expensive. | ||||
Tags | No tags attached. | ||||
Operating System | RHEL4 | ||||
PHP Version | 5.1.6 | ||||
|
--- xdebug_profiler.c.orig 2006-10-08 16:54:15.000000000 -0400 +static int xdebug_profiler_skip_p(function_stack_entry* fse) {
|
|
The patch in the comment got garbled, feel free to send patches to xdebug-dev@lists.xdebug.org. Also, I think it might be better to handle call_user in the same way as include... the name of the class/method can be added to the call_user function's name, such as call_user_func::classname->method. Please feel free to discuss this on the xdebug-dev@lists.xdebug.org mailinglist as well. |
|
Reminder sent to quotemstr The patch in the comment got garbled, feel free to send patches to xdebug-dev@lists.xdebug.org. Also, I think it might be better to handle call_user in the same way as include... the name of the class/method can be added to the call_user function's name, such as call_user_func::classname->method. Please feel free to discuss this on the xdebug-dev@lists.xdebug.org mailinglist as well. |
|
Reminder sent to quotemstr The patch in the comment got garbled, feel free to send patches to xdebug-dev@lists.xdebug.org. Also, I think it might be better to handle call_user in the same way as include... the name of the class/method can be added to the call_user function's name, such as call_user_func::classname->method. Please feel free to discuss this on the xdebug-dev@lists.xdebug.org mailinglist as well. |
|
Reminder sent to quotemstr The patch in the comment got garbled, feel free to send patches to xdebug-dev@lists.xdebug.org. Also, I think it might be better to handle call_user in the same way as include... the name of the class/method can be added to the call_user function's name, such as call_user_func::classname->method. Please feel free to discuss this on the xdebug-dev@lists.xdebug.org mailinglist as well. |
|
The patch got garbled, and there was not feedback provided. |
Date Modified | Username | Field | Change |
---|---|---|---|
2006-10-27 22:25 | quotemstr | New Issue | |
2006-10-27 22:30 | quotemstr | Note Added: 0000485 | |
2006-10-30 11:17 | derick | Note Added: 0000486 | |
2006-10-30 11:17 | derick | Status | new => feedback |
2006-11-21 20:02 | derick | Note Added: 0000493 | |
2006-12-12 13:59 | derick | Note Added: 0000517 | |
2007-01-14 19:01 | derick | Note Added: 0000544 | |
2009-12-27 16:56 | derick | Note Added: 0001212 | |
2009-12-27 16:56 | derick | Status | feedback => resolved |
2009-12-27 16:56 | derick | Resolution | open => unable to reproduce |
2009-12-27 16:56 | derick | Assigned To | => derick |
2020-03-12 16:55 | derick | Severity | major => feature |
2020-03-12 17:37 | derick | Category | Feature/Change request => Profiling |