From cd555777471288b1b6c9818e83a7dc811a327918 Mon Sep 17 00:00:00 2001 From: "attinasi%netscape.com" Date: Wed, 23 Feb 2000 17:58:22 +0000 Subject: [PATCH] Updated scripts to handle Clock-time and to deal with running Mozilla or Viewer --- tools/performance/layout/Averagetable2.pl | 44 +++++++++++++++++---- tools/performance/layout/Header.pl | 7 +++- tools/performance/layout/genfromlogs.pl | 11 ++++-- tools/performance/layout/perf.pl | 48 +++++++++++++++++------ tools/performance/layout/uncombine.pl | 4 +- 5 files changed, 89 insertions(+), 25 deletions(-) diff --git a/tools/performance/layout/Averagetable2.pl b/tools/performance/layout/Averagetable2.pl index 53684146169d..98fe67a8595b 100644 --- a/tools/performance/layout/Averagetable2.pl +++ b/tools/performance/layout/Averagetable2.pl @@ -24,7 +24,7 @@ #------------------------------------------------------------------------------ sub debug_print { foreach $str (@_){ -# print( $str ); + print( $str ); } } #------------------------------------------------------------------------------ @@ -36,8 +36,9 @@ $logFile = $ARGV[1]; $NumOfSites = $ARGV[2]; $buildIDFile = $ARGV[3]; $LinkURL = $ARGV[4]; +$useClockTime = $ARGV[5]; $buildIDFile = '< '.$buildIDFile.'\bin\chrome\navigator\locale\en-US\navigator.dtd'; -debug_print( "Arguments:[ $UrlName | $logFile | $NumOfSites | $buildIDFile | $LinkURL ]\n"); +debug_print( "Arguments:[ $UrlName | $logFile | $NumOfSites | $buildIDFile | $LinkURL | $useClockTime]\n"); #------------------------------------------------------------------------------ # Open the ID file and get the build ID @@ -256,7 +257,12 @@ while () if (/Content/){ if ($IsValidURL == 1){ @List = split (/ /, $ThisLine); - $Content_Time = $List[9]; + if($useClockTime){ + @clockTimeList = split(/:/, $List[6]); + $Content_Time = $clockTimeList[2]; + } else { + $Content_Time = $List[9]; + } $Content_Flag = 1; debug_print( "Content Time: $Content_Time\n" ); } @@ -264,7 +270,12 @@ while () if (/Reflow/){ if ($IsValidURL == 1){ @List = split (/ /, $ThisLine); - $Reflow_Time = $List[8]; + if($useClockTime){ + @clockTimeList = split(/:/, $List[5]); + $Reflow_Time = $clockTimeList[2]; + } else { + $Reflow_Time = $List[8]; + } $Reflow_Flag = 1; debug_print( "Reflow Time: $Reflow_Time\n" ); } @@ -272,14 +283,24 @@ while () if (/Frame construction plus/){ if ($IsValidURL == 1){ @List = split (/ /, $ThisLine); - $FrameAndStyle_Time = $List[12]; + if($useClockTime){ + @clockTimeList = split(/:/, $List[9]); + $FrameAndStyle_Time = $clockTimeList[2]; + } else { + $FrameAndStyle_Time = $List[12]; + } debug_print( "Frame and Style Time: $FrameAndStyle_Time\n" ); } } if (/Style/){ if ($IsValidURL == 1){ @List = split (/ /, $ThisLine); - $Style_Time = $List[9]; + if($useClockTime){ + @clockTimeList = split(/:/, $List[6]); + $Style_Time = $clockTimeList[2]; + } else { + $Style_Time = $List[9]; + } $Style_Flag = 1; debug_print( "Style Time: $Style_Time\n" ); } @@ -287,7 +308,12 @@ while () if (/Parse/){ if ($IsValidURL == 1){ @List = split (/ /, $ThisLine); - $Parse_Time = $List[8]; + if($useClockTime){ + @clockTimeList = split(/:/, $List[5]); + $Parse_Time = $clockTimeList[2]; + } else { + $Parse_Time = $List[8]; + } $Parse_Flag = 1; debug_print( "Parse Time: $Parse_Time\n" ); } @@ -316,6 +342,10 @@ while () # Calculate the significant time values #------------------------------------------------------------------------------ $Frame_Time = $FrameAndStyle_Time - $Style_Time; +if($Frame_Time < 0.0){ + print( "\n***** ERROR: negative FrameTime *****\n"); + $Frame_Time = 0; +} $TotalLayout_Time = $Content_Time + $Reflow_Time + $Frame_Time + $Style_Time + $Parse_Time; $Avg_Time = $Avg_Time + $TotalLayoutTime + $TotalPageLoad_Time; diff --git a/tools/performance/layout/Header.pl b/tools/performance/layout/Header.pl index ddee6f252c4e..5f1506dc22ab 100644 --- a/tools/performance/layout/Header.pl +++ b/tools/performance/layout/Header.pl @@ -38,6 +38,7 @@ sub debug_print { $buildIDFile = $ARGV[0]; $buildIDFile = '< '.$buildIDFile.'\bin\chrome\navigator\locale\en-US\navigator.dtd'; $pullDate = $ARGV[1]; +$useClockTime = $ARGV[2]; open (XUL_FILE, $buildIDFile) or die "Unable to open BuildID file $buildIDFile (header.pl)"; $BuildNo = ""; @@ -88,7 +89,11 @@ print (TABLE_FILE "
"); print (TABLE_FILE "
\n"); print (TABLE_FILE "$machineStats\n"); print (TABLE_FILE "
"); -print (TABLE_FILE "Time is reported in Seconds of CPU time"); +if($useClockTime){ + print (TABLE_FILE "Time is reported in Seconds of Clock time"); +} else { + print (TABLE_FILE "Time is reported in Seconds of CPU time"); +} print (TABLE_FILE "
\n"); print (TABLE_FILE "
\n\n"); diff --git a/tools/performance/layout/genfromlogs.pl b/tools/performance/layout/genfromlogs.pl index 2d3ece498927..06ebd7872764 100644 --- a/tools/performance/layout/genfromlogs.pl +++ b/tools/performance/layout/genfromlogs.pl @@ -26,14 +26,17 @@ $milestone = $ARGV[0]; print ($milestone); $bldRoot = $ARGV[1]; -print("BuildRoot: $bldRoot\n"); +print(" BuildRoot: $bldRoot\n"); $cnt = 0; # Backup the history file system( ("copy", "history.txt", "history.bak" ) ); +# Delete the average.txt file so we don;t get old values in the averages +system( ("del", "average.txt") ); + # Run the Header script -system( ("perl", "header.pl", "$bldRoot", "$milestone" ) ); +system( ("perl", "header.pl", "$bldRoot", "$milestone", "$ARGV[2]" ) ); # # now run the average2 script for each file in the logs directory @@ -46,11 +49,11 @@ while( ){ @nameParts = split( /-/, $line ); @nameNoDir = split( /\\/, $nameParts[0] ); print( "Name: $nameNoDir[1]\n" ); - system( ("perl", "Averagetable2.pl", "$nameNoDir[1]", "$line", "$cnt", "$bldRoot", "$nameNoDir[1]" ) ); + system( ("perl", "Averagetable2.pl", "$nameNoDir[1]", "$line", "$cnt", "$bldRoot", "$nameNoDir[1]", "$ARGV[2]" ) ); } } # Run the Footer script system( ("perl", "footer.pl", "$bldRoot", "$milestone" ) ); -print("Processed $cnt logs\n"); \ No newline at end of file +print("Processed $cnt logs\n"); diff --git a/tools/performance/layout/perf.pl b/tools/performance/layout/perf.pl index 4f2d49f4cca0..014f0da55755 100644 --- a/tools/performance/layout/perf.pl +++ b/tools/performance/layout/perf.pl @@ -28,33 +28,54 @@ # 5) Run the script history.pl to generate the history chart # 6) Move the files to a directory just for them... +$UseViewer = 1; # set to 0 to use Mozilla +$UseClockTime=0; # if third argument is 'clock' this gets set to 1 # Get and check the arguments @ARGV; $ID = $ARGV[0]; $bldRoot = $ARGV[1]; -$profID = $ARGV[2]; +$clockTimeArg = $ARGV[2]; +$profID = $ARGV[3]; $arg=0; $cmdLineArg[$arg++] = "-f "; $cmdLineArg[$arg++] = "S:\\mozilla\\tools\\performance\\layout\\40-url.txt "; -#$cmdLineArg[$arg++] = "-ftimeout "; -#$cmdLineArg[$arg++] = "15 "; -#$cmdLineArg[$arg++] = "-P "; -#$cmdLineArg[$arg++] = "$profID "; +if($UseViewer==0){ + $cmdLineArg[$arg++] = "-ftimeout "; + $cmdLineArg[$arg++] = "10 "; + $cmdLineArg[$arg++] = "-P "; + $cmdLineArg[$arg++] = "$profID "; +} -if(!$ID || !$bldRoot || !$profID){ - die "ID, Build Root and Profile Name must be provided. \n - Example: 'perl perf.pl Daily_021400 s:\\moz\\daily\\0214 Attinasi' \n"; +if(!$UseViewer){ + if(!$ID || !$bldRoot || !$profID || !$clockTimeArg){ + die "ID, Build Root, Profile Name, and clock OR CPU must be provided. \n - Example: 'perl perf.pl Daily_021400 s:\\moz\\daily\\0214 clock|cpu Attinasi' \n"; + } +} else { + if(!$ID || !$bldRoot || !$clockTimeArg){ + die "ID, Build Root, Profile Name, and clock OR CPU must be provided. \n - Example: 'perl perf.pl Daily_021400 s:\\moz\\daily\\0214 clock|CPU' \n"; + } } # build up a full path and argument strings for the invocation $mozPath; $logName; -#$mozPath=$bldRoot."\\bin\\Mozilla.exe"; -$mozPath=$bldRoot."\\bin\\Viewer.exe"; +if($UseViewer==0){ + $mozPath=$bldRoot."\\bin\\Mozilla.exe"; +} else { + $mozPath=$bldRoot."\\bin\\Viewer.exe"; +} $logName="Logs\\".$ID."-combined.dat"; -e $mozPath or die "$mozPath could not be found\n"; +if($clockTimeArg=="clock"){ + $UseClockTime=1; + print( "Charting Clock time...\n"); +} else { + print( "Charting CPU time...\n"); +} + # run it $commandLine = $mozPath." ".$cmdLineArg[0].$cmdLineArg[1].$cmdLineArg[2].$cmdLineArg[3].$cmdLineArg[4].$cmdLineArg[5]."> $logName"; print("Running $commandLine\n"); @@ -65,8 +86,13 @@ print("Breaking result into log files...\n"); system( ("perl", "uncombine.pl", "$logName") ) == 0 or die "Error uncombining the output\n"; # generate the chart from the logs -print("Generating performance table...\n"); -system( ("perl", "genfromlogs.pl", "$ID", "$bldRoot") ) == 0 or die "Error generating the chart from the logs\n"; +if($UseClockTime==1){ + print("Generating performance table... (ClockTime)\n"); + system( ("perl", "genfromlogs.pl", "$ID", "$bldRoot", "clock") ) == 0 or die "Error generating the clock-time chart from the logs\n"; +} else { + print("Generating performance table...(CPUTime)\n"); + system( ("perl", "genfromlogs.pl", "$ID", "$bldRoot") ) == 0 or die "Error generating the cpu-time chart from the logs\n"; +} # rename the output system( ("copy", "table.html", "Tables\\$ID\.html") ) == 0 or die "Error copying table.html to Tables\\$ID\.html\n"; diff --git a/tools/performance/layout/uncombine.pl b/tools/performance/layout/uncombine.pl index efa7f452f278..2cbd36ed8432 100644 --- a/tools/performance/layout/uncombine.pl +++ b/tools/performance/layout/uncombine.pl @@ -87,8 +87,8 @@ while(){ #print( " - WebShellID: $shellID\n"); @urlParts = split(/\//, $url); if($fileURL > 0){ - $urlName = $urlParts[8]; ### SENSITIVE to installation path - ### eg. 'file:///S|/Mozilla/Tools/PerfTools/WebSites/amazon/index.html' + $urlName = $urlParts[9]; ### SENSITIVE to installation path + ### eg. 'file:///S|/Mozilla/Tools/performance/layout/WebSites/amazon/index.html' } else { $urlName = $urlParts[2]; ### http://all.of.this.is.the.url.name/index.html }