From: Domas Mituzas Date: Sat, 12 Jan 2008 17:51:21 +0000 (+0000) Subject: * importing livehack for profiling errors output X-Git-Tag: 1.31.0-rc.0~50043 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=85dea78ecbf5bda88b577c154b53061a2d5afca2;p=lhc%2Fweb%2Fwiklou.git * importing livehack for profiling errors output * fixing some of CPU profile elimination errors :) --- diff --git a/includes/ProfilerSimple.php b/includes/ProfilerSimple.php index d41e0a1885..07cc149621 100644 --- a/includes/ProfilerSimple.php +++ b/includes/ProfilerSimple.php @@ -49,7 +49,7 @@ class ProfilerSimple extends Profiler { if ($wgDebugFunctionEntry) { $this->debug(str_repeat(' ', count($this->mWorkStack)).'Entering '.$functionname."\n"); } - $this->mWorkStack[] = array($functionname, count( $this->mWorkStack)); + $this->mWorkStack[] = array($functionname, count( $this->mWorkStack),microtime(true)); } function profileOut($functionname) { @@ -59,7 +59,7 @@ class ProfilerSimple extends Profiler { $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n"); } - list($ofname, /* $ocount */ ,$ortime,$octime) = array_pop($this->mWorkStack); + list($ofname, /* $ocount */ ,$ortime) = array_pop($this->mWorkStack); if (!$ofname) { $this->debug("Profiling error: $functionname\n"); @@ -68,10 +68,14 @@ class ProfilerSimple extends Profiler { $message = "Profile section ended by close(): {$ofname}"; $functionname = $ofname; $this->debug( "$message\n" ); + $this->mCollated[$message] = array( + 'real' => 0.0, 'count' => 1); } elseif ($ofname != $functionname) { $message = "Profiling error: in({$ofname}), out($functionname)"; $this->debug( "$message\n" ); + $this->mCollated[$message] = array( + 'real' => 0.0, 'count' => 1); } $entry =& $this->mCollated[$functionname]; $elapsedreal = microtime(true) - $ortime;