Index: trunk/core/kernel/utility/debugger.php =================================================================== diff -u -N -r8586 -r8605 --- trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 8586) +++ trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 8605) @@ -21,6 +21,8 @@ var $ProfilerTotals = Array(); var $ProfilerTotalCount = Array(); + var $ProfilePoints = Array(); + /** * Prevent recursion when processing debug_backtrace() function results * @@ -893,6 +895,31 @@ return 0; } + function ProfilePoint($title, $level=1) + { + $trace_results = debug_backtrace(); + $level = min($level,count($trace_results)-1); + + do { + $point = $trace_results[$level]; + $location = $point['file'].':'.$point['line']; + $level++; + $has_more = isset($trace_results[$level]); + } while ($has_more && $point['function'] == $trace_results[$level]['function'] ); + + if ($location == ':') { + echo ''; + } + + if (!isset($this->ProfilePoints[$title])) { + $this->ProfilePoints[$title] = array(); + } + if (!isset($this->ProfilePoints[$title][$location])) { + $this->ProfilePoints[$title][$location] = 0; + } + $this->ProfilePoints[$title][$location]++; + } + /** * Generates report * @@ -927,6 +954,20 @@ $this->appendHTML($top_line); $this->moveToBegin(1); + if (count($this->ProfilePoints)>0) { + foreach($this->ProfilePoints as $point => $locations) { + arsort($this->ProfilePoints[$point]); + } + + $this->appendHTML($this->highlightString($this->print_r($this->ProfilePoints, true))); + /*foreach ($this->ProfilePoints as $point => $locations) { + foreach ($locations as $location => $occurences) { + + + } + }*/ + } + if ($this->constOn('DBG_SQL_PROFILE') && isset($this->ProfilerTotals['sql'])) { // sql query profiling was enabled -> show totals $this->appendHTML('SQL Total time: '.$this->ProfilerTotals['sql'].' Number of queries: '.$this->ProfilerTotalCount['sql']);