34 parent::profileIn( $functionname );
35 $this->trace .=
" " . sprintf(
"%6.1f", $this->
memoryDiff() ) .
36 str_repeat(
" ", count( $this->mWorkStack ) ) .
" > " . $functionname .
"\n";
40 global $wgDebugFunctionEntry;
42 if ( $wgDebugFunctionEntry ) {
43 $this->
debug( str_repeat(
' ', count( $this->mWorkStack ) - 1 ) .
'Exiting ' . $functionname .
"\n" );
46 list( $ofname, , $ortime ) = array_pop( $this->mWorkStack );
49 $this->trace .=
"Profiling error: $functionname\n";
51 if ( $functionname ==
'close' ) {
52 $message =
"Profile section ended by close(): {$ofname}";
53 $functionname = $ofname;
54 $this->trace .= $message .
"\n";
56 elseif ( $ofname != $functionname ) {
57 $this->trace .=
"Profiling error: in({$ofname}), out($functionname)";
59 $elapsedreal = $this->
getTime() - $ortime;
60 $this->trace .= sprintf(
"%03.6f %6.1f", $elapsedreal, $this->
memoryDiff() ) .
61 str_repeat(
" ", count( $this->mWorkStack ) + 1 ) .
" < " . $functionname .
"\n";
69 $this->
memory = memory_get_usage();
74 if ( PHP_SAPI ===
'cli' ) {
75 print
"<!-- \n {$this->trace} \n -->";
77 print
"<!-- \n {$this->trace} \n -->";
79 print
"\n/*\n {$this->trace}\n*/";
81 print
"\n/*\n {$this->trace}\n*/";