cvs: pecl /apd pprofp

From: Date: Thu, 11 Mar 2004 21:30:39 +0000
Subject: cvs: pecl /apd pprofp
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-1071@lists.php.net to get a copy of this message
gschlossnagle Thu Mar 11 16:30:39 2004 EDT Modified files: /pecl/apd pprofp Log: move rasmus's changes in from pecl_4_3 http://cvs.php.net/diff.php/pecl/apd/pprofp?r1=1.13&r2=1.14&ty=u Index: pecl/apd/pprofp diff -u pecl/apd/pprofp:1.13 pecl/apd/pprofp:1.14 --- pecl/apd/pprofp:1.13 Wed Mar 10 13:35:07 2004 +++ pecl/apd/pprofp Thu Mar 11 16:30:37 2004 @@ -1,4 +1,4 @@ -#!/usr/bin/env php +#!/usr/bin/env php -dvariables_order="GPS" -dauto_prepend_file= -dauto_append_file= <?php require "Console/Getopt.php"; error_reporting(0); @@ -20,7 +20,17 @@ exit(1); } -parse_info('HEADER', $DATA, $cfg); +while(!feof($DATA)) { + $count++; + $cfg = array(); + parse_info('HEADER', $DATA, $cfg); + if(array_key_exists('hz', $cfg)) { + if($count == 1) { + print "File does not appear to be a pprof trace file\n"; + exit; + } + } +} $callstack = array(); $calls = array(); @@ -36,9 +46,14 @@ $rtimes = array(); $stimes = array(); $utimes = array(); +$rtotal = 0; $stotal = 0; +$utotal = 0; $last_memory = 0; +$symbol_hash = array(); +$symbol_type = array(); + while($line = fgets($DATA)) { $line = rtrim($line); if(preg_match("/^END_TRACE/", $line)){ @@ -142,6 +157,9 @@ if(array_key_exists('u', $opt)) { $sort = 'by_utime'; } if(array_key_exists('U', $opt)) { $sort = 'by_c_utime'; } if(array_key_exists('Z', $opt)) { $sort = 'by_c_time'; } +if( !count($symbol_hash)) { + continue; +} printf(" Trace for %s

« previous php.pecl.cvs (#1071) next »