Bug 458256. Use LoadLibraryW instead of LoadLibrary (patch by DougT). r+sr=vlad
[wine-gecko.git] / tools / performance / layout / Footer.pl
blob89e9cfb62dd9f4c3fdf8e8ea57b0fcfc66daf998
1 ##########################################################################################
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
14 # License.
16 # The Original Code is mozilla.org code.
18 # The Initial Developer of the Original Code is
19 # Netscape Communications Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 1998
21 # the Initial Developer. All Rights Reserved.
23 # Contributor(s):
24 # 2/10/00 attinasi
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
41 #------------------------------------------------------------------------------
42 sub debug_print {
43 foreach $str (@_){
44 # print( $str );
48 #------------------------------------------------------------------------------
49 @ARGV;
50 $buildRoot = $ARGV[0];
51 #$buildIDFile = '< '.$buildRoot.'\bin\chrome\locales\en-US\navigator\locale\navigator.dtd';
52 $PullID = $ARGV[1];
54 #------------------------------------------------------------------------------
55 # Variables for the values in the AVERAGES.TXT file
56 # NOTE this is the order they appear in the file
57 $Num_Entries = 0;
58 $Avg_Parse_Time = 0;
59 $Avg_Parse_Time_Percentage = 0;
60 $Avg_Content_Time = 0;
61 $Avg_Content_Time_Percentage = 0;
62 $Avg_Frame_Time = 0;
63 $Avg_Frame_Time_Percentage = 0;
64 $Avg_Style_Time = 0;
65 $Avg_Style_Time_Percentage = 0;
66 $Avg_Reflow_Time = 0;
67 $Avg_Reflow_Time_Percentage = 0;
68 $Avg_TotalLayout_Time = 0;
69 $Avg_TotalLayout_Time_Percentage = 0;
70 $Avg_TotalPageLoad_Time = 0;
71 $count = 0;
72 @List;
73 @temp;
75 #------------------------------------------------------------------------------
76 # Get the BuildID
77 #open (XUL_FILE, $buildIDFile) or die "Unable to open BuildID file $buildIDFile (footer.pl)";
78 #$BuildNo = "";
79 #$LineList;
80 #while (<XUL_FILE>)
82 # $ThisLine = $_;
83 # chop ($ThisLine);
84 # if (/Build ID/){
85 # @LineList = split (/\"/, $ThisLine);
86 # $BuildNo = $LineList[1];
87 # }
89 #$BuildNo =~ s/"//g;
90 #$BuildNo =~ s/[>]//g;
91 #close (XUL_FILE);
92 #debug_print ($BuildNo);
94 #------------------------------------------------------------------------------
95 # Process the averages file: get the number of entries
96 # and divide out the accumulated values
98 open (AVERAGE, "< Average.txt") or die "Unable to open average.txt (Footer.pl)";
99 while (<AVERAGE>)
101 $ThisLine = $_;
102 chop ($ThisLine);
104 if( /Num Entries:/ ){
105 @list = split( / /, $ThisLine );
106 $Num_Entries = $list[2];
107 debug_print( "Num Entries in Footer: $Num_Entries\n" );
108 } else {
109 if( $Num_Entries != 0 ){
110 @temp = split (/ /, $ThisLine);
111 $List[$count] = $temp[2];
112 $List[$count] = $List[$count] / $Num_Entries;
113 debug_print( "Averaged entry: $temp[2] / $Num_Entries = $List[$count]\n" );
114 $count ++;
115 } else {
116 print( "Number of entries is 0: this is either a bad file or the universe has imploded\n" );
117 die;
121 close (AVERAGE);
123 #------------------------------------------------------------------------------
124 # Now put the values to the table
126 open (TABLE_FILE, ">>table.html") or die "Cannot open the file table.html";
128 print (TABLE_FILE "<tr>");
129 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
130 print (TABLE_FILE "<center><b><font size =+1>Average</font></b></center>");
131 print (TABLE_FILE "</td>");
133 $Avg_Parse_Time = @List [0];
134 debug_print ("$Avg_Parse_Time\n");
135 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
136 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Parse_Time);
137 print (TABLE_FILE "</td>");
139 $Avg_Parse_Time_Percentage = @List [1];
140 debug_print ("$Avg_Parse_Time_Percentage\n");
141 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
142 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Parse_Time_Percentage);
143 print (TABLE_FILE "</td>");
145 $Avg_Content_Time = @List [2];
146 debug_print ("$Avg_Content_Time\n");
147 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
148 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Content_Time);
149 print (TABLE_FILE "</td>");
151 $Avg_Content_Time_Percentage = @List [3];
152 debug_print ("$Avg_Content_Time_Percentage\n");
153 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
154 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Content_Time_Percentage);
155 print (TABLE_FILE "</td>");
157 $Avg_Frame_Time = @List [4];
158 debug_print ("$Avg_Frame_Time\n");
159 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
160 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Frame_Time);
161 print (TABLE_FILE "</td>");
163 $Avg_Frame_Time_Percentage = @List [5];
164 debug_print ("$Avg_Frame_Time_Percentage\n");
165 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
166 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Frame_Time_Percentage);
167 print (TABLE_FILE "</td>");
169 $Avg_Style_Time = @List [6];
170 debug_print ("$Avg_Style_Time\n");
171 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
172 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Style_Time);
173 print (TABLE_FILE "</td>");
175 $Avg_Style_Time_Percentage = @List [7];
176 debug_print ("$Avg_Style_Time_Percentage\n");
177 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
178 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Style_Time_Percentage);
179 print (TABLE_FILE "</td>");
181 $Avg_Reflow_Time = @List [8];
182 debug_print ("$Avg_Reflow_Time\n");
183 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
184 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Reflow_Time);
185 print (TABLE_FILE "</td>");
187 $Avg_Reflow_Time_Percentage = @List [9];
188 debug_print ("$Avg_Reflow_Time_Percentage\n");
189 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
190 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_Reflow_Time_Percentage);
191 print (TABLE_FILE "</td>");
193 $Avg_TotalLayout_Time = @List [10];
194 debug_print ("$Avg_TotalLayout_Time\n");
195 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
196 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_TotalLayout_Time);
197 print (TABLE_FILE "</td>");
199 $Avg_TotalLayout_Time_Percentage = @List [11];
200 debug_print ("$Avg_TotalLayout_Time_Percentage\n");
201 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
202 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_TotalLayout_Time_Percentage);
203 print (TABLE_FILE "</td>");
205 $Avg_TotalPageLoad_Time = @List [12];
206 debug_print ("$Avg_TotalPageLoad_Time\n");
207 print (TABLE_FILE "<td BGCOLOR='#CCFFFF'>");
208 printf (TABLE_FILE "<center>%4.2f</center></B></FONT>",$Avg_TotalPageLoad_Time);
209 print (TABLE_FILE "</td>");
211 print (TABLE_FILE "</tr>");
212 print (TABLE_FILE "</table>");
213 print (TABLE_FILE "</html>");
215 close (TABLE_FILE);
217 #------------------------------------------------------------------------------
218 # Now create the History file entries
219 # FORMAT: "pullID, buildID, ParseTime, ParsePer, ContentTime, ContentPer, FrameTime, FramePer,
220 # StyleTime, StylePer, ReflowTime, ReflowPer, LayoutTime, LayoutPer, TotalTime"
222 open (HISTORY, ">> History.txt" ) or die "History file could not be opened: no history will be written\n";
223 print(HISTORY "$PullID,$BuildNo,$Avg_Parse_Time,$Avg_Parse_Time_Percentage,$Avg_Content_Time,$Avg_Content_Time_Percentage,");
224 print(HISTORY "$Avg_Frame_Time,$Avg_Frame_Time_Percentage,$Avg_Style_Time,$Avg_Style_Time_Percentage,$Avg_Reflow_Time,$Avg_Reflow_Time_Percentage,");
225 print(HISTORY "$Avg_TotalLayout_Time,$Avg_TotalLayout_Time_Percentage,$Avg_TotalPageLoad_Time\n");
226 close(HISTORY);