[xdebug-general] Re: Nonsensical profile?

From: Derick Rethans <derick[@]xdebug.org>
Date: Sun, 3 Sep 2006 14:05:51 +0200 (CEST)

On Sun, 3 Sep 2006, Marcus Bointon wrote:

> I have a little example script for illustrating kCacheGrind's displays, but
> it's producing some very odd results. I'm running xdebug2 CVS with PHP 5.1.6
> on OS X.

[snip script]

> I would expect {main} to have about 0 self time, and each of sleep1-sleep8 to
> take up approximately 8/15, 4/15/ 2/15 and 1/15 of the remaining time. The
> callee map should look roughly like this:

[snip diagram]

> What I'm actually getting is {main} self taking 48%, sleep1 taking around 21%,
> and sleep2 11%, sleep4 and sleep8 taking about 9% each, and all much smaller
> than sleep1! In all of the functions, the internal calls to php:sleep take the
> same amount of time!! Graph is roughly like this:

[snip diagram]

> What's going on? That makes no sense to me. Does sleep stop the timers or
> something odd like that? I'm pretty sure I had this giving expected results
> before.

I have been experimenting with switching to "getrusage" to obtain timing
information. The Unix system call getrusage returns the time spend in a
program actually executing. sleep() doesn't really take time processor
wise so it wouldn't show up in the profiles. As there are some other
slight problems with using getrusage() I now reverted this behavior. In
CVS you can now find this commit that should give you more expected
results.

regards,
Derick

-- 
Xdebug | http://xdebug.org | xdebug-general@lists.xdebug.org
Received on Sun Sep 03 2006 - 14:06:46 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST