[xdebug-dev] Bug 0000216: call_user_* makes profiling much less useful

From: <noreply[@]lists.xdebug.org>
Date: Fri, 27 Oct 2006 23:25:49 +0200

The following NEW bug has been ADDED.
======================================================================
http://bugs.xdebug.org/bug_view_page.php?bug_id=0000216
======================================================================
Reporter: quotemstr
Handler:
======================================================================
Project: Xdebug
Bug ID: 216
Category: Feature/Change request
Reproducibility: always
Severity: major
Priority: normal
Status: new
Operating System: RHEL4
PHP Version: 5.1.6
Xdebug Version: 2.0.0rc2-dev
======================================================================
Date Submitted: 2006-10-27 23:25 CEST
Last Modified: 2006-10-27 23:25 CEST
======================================================================
Summary: call_user_* makes profiling much less useful
Description:
The problem arises from PHP using call_user_* 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 call_user_* node.

Let's say A is the set of functions that call through call_user_*, and B
is the set of functions called. Every A will be shown as calling
call_user_*, 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.
======================================================================

Bug History
Date Modified Username Field Change
======================================================================
2006-10-27 23:25quotemstr New Bug
2006-10-27 23:25quotemstr Bug Monitored: quotemstr
======================================================================
Received on Fri Oct 27 2006 - 23:25:51 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST