3 # Program: NightlyTest.pl
5 # Synopsis: Perform a series of tests which are designed to be run nightly.
6 # This is used to keep track of the status of the LLVM tree, tracking
7 # regressions and performance changes. This generates one web page a
8 # day which can be used to access this information.
10 # Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR]
12 # OPTIONS may include one or more of the following:
13 # -nocheckout Do not create, checkout, update, or configure
15 # -noremove Do not remove the BUILDDIR after it has been built.
16 # -nofeaturetests Do not run the feature tests.
17 # -noregressiontests Do not run the regression tests.
18 # -notest Do not even attempt to run the test programs. Implies
20 # -norunningtests Do not run the Olden benchmark suite with
21 # LARGE_PROBLEM_SIZE enabled.
22 # -parallel Run two parallel jobs with GNU Make.
23 # -enable-linscan Enable linearscan tests
24 # -disable-codegen Disable LLC and JIT tests in the nightly tester.
25 # -verbose Turn on some debug output
26 # -debug Print information useful only to maintainers of this script.
28 # CVSROOT is the CVS repository from which the tree will be checked out,
29 # specified either in the full :method:user@host:/dir syntax, or
30 # just /dir if using a local repo.
31 # BUILDDIR is the directory where sources for this test run will be checked out
32 # AND objects for this test run will be built. This directory MUST NOT
33 # exist before the script is run; it will be created by the cvs checkout
34 # process and erased (unless -noremove is specified; see above.)
35 # WEBDIR is the directory into which the test results web page will be written,
36 # AND in which the "index.html" is assumed to be a symlink to the most recent
37 # copy of the results. This directory MUST exist before the script is run.
39 use POSIX qw(strftime);
41 my $HOME = $ENV{'HOME'};
42 my $CVSRootDir = $ENV{'CVSROOT'};
43 $CVSRootDir = "/home/vadve/shared/PublicCVS"
45 my $BuildDir = $ENV{'BUILDDIR'};
46 $BuildDir = "$HOME/buildtest"
48 my $WebDir = $ENV{'WEBDIR'};
49 $WebDir = "$HOME/cvs/testresults-X86"
52 # Calculate the date prefix...
54 my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
55 my $DateString = strftime "%B %d, %Y", localtime;
59 if (open (FILE, $_[0])) {
64 print "Could not open file '$_[0]' for reading!";
69 sub WriteFile { # (filename, contents)
70 open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!";
75 sub GetRegex { # (Regex with ()'s, value)
83 sub AddPreTag { # Add pre tags around nonempty list, or convert to "none"
85 if (length) { return "<ul><pre>$_</pre></ul>"; } else { "<b>none</b><br>"; }
91 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
96 # DiffFiles - Diff the current version of the file against the last version of
97 # the file, reporting things added and removed. This is used to report, for
98 # example, added and removed warnings. This returns a pair (added, removed)
102 my @Others = GetDir $Suffix;
103 if (@Others == 0) { # No other files? We added all entries...
104 return (`cat $WebDir/$DATE$Suffix`, "");
106 # Diff the files now...
107 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
108 my $Added = join "\n", grep /^</, @Diffs;
109 my $Removed = join "\n", grep /^>/, @Diffs;
111 $Removed =~ s/^> //gm;
112 return ($Added, $Removed);
115 # FormatTime - Convert a time from 1m23.45 into 83.45
118 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
119 $Time = sprintf("%7.4f", $1*60.0+$2);
125 # Command line argument settings...
129 my $NOREGRESSIONS = 0;
131 my $NORUNNINGTESTS = 0;
133 my $PROGTESTOPTS = "";
136 my $CONFIGUREARGS = "--enable-jit";
139 while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
141 last if /^--$/; # Stop processing arguments on --
143 # List command line options here...
144 if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
145 if (/^-noremove$/) { $NOREMOVE = 1; next; }
146 if (/^-nofeaturetests$/) { $NOFEATURES = 1; next; }
147 if (/^-noregressiontests$/){ $NOREGRESSIONS = 1; next; }
148 if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
149 if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
150 if (/^-parallel$/) { $MAKEOPTS = "-j2 -l3.0"; next; }
151 if (/^-enable-linscan$/) { $PROGTESTOPTS .= " ENABLE_LINEARSCAN=1"; next; }
152 if (/^-disable-codegen$/){ $PROGTESTOPTS .= " DISABLE_JIT=1 DISABLE_LLC=1";
153 $CONFIGUREARGS="--disable-jit --disable-llc_diffs";
155 if (/^-verbose$/) { $VERBOSE = 1; next; }
156 if (/^-debug$/) { $DEBUG = 1; next; }
158 print "Unknown option: $_ : ignoring!\n";
161 if ($ENV{'LLVMGCCDIR'}) {
162 $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
165 die "Must specify 0 or 3 options!" if (@ARGV != 0 and @ARGV != 3);
168 $CVSRootDir = $ARGV[0];
169 $BuildDir = $ARGV[1];
174 my $Template = "$BuildDir/llvm/utils/NightlyTestTemplate.html";
175 my $Prefix = "$WebDir/$DATE";
178 print "INITIALIZED\n";
179 print "CVS Root = $CVSRootDir\n";
180 print "BuildDir = $BuildDir\n";
181 print "WebDir = $WebDir\n";
182 print "Prefix = $Prefix\n";
187 # Create the CVS repository directory
192 system "rm -rf $BuildDir";
194 die "CVS checkout directory $BuildDir already exists!";
197 mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
199 chdir $BuildDir or die "Could not change to CVS checkout directory $BuildDir!";
203 # Check out the llvm tree, saving CVS messages to the cvs log...
206 $CVSOPT = "-z3" if $CVSRootDir =~ /^:ext:/; # Use compression if going over ssh.
208 if ( $VERBOSE ) { print "CHECKOUT STAGE\n"; }
209 system "(time -p cvs $CVSOPT -d $CVSRootDir co llvm) > $Prefix-CVS-Log.txt 2>&1";
212 chdir "llvm" or die "Could not change into llvm directory!";
215 if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
216 system "cvs update -P -d > /dev/null 2>&1" ;
219 # Read in the HTML template file...
220 my $TemplateContents = ReadFile $Template;
224 # Get some static statistics about the current state of CVS
226 my $CVSCheckoutTime = GetRegex "([0-9.]+)", `grep '^real' $Prefix-CVS-Log.txt`;
227 my $NumFilesInCVS = `egrep '^U' $Prefix-CVS-Log.txt | wc -l` + 0;
228 my $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $Prefix-CVS-Log.txt | wc -l` + 0;
229 $LOC = GetRegex "([0-9]+) +total", `wc -l \`utils/getsrcs.sh\` | grep total`;
232 # Build the entire tree, saving build messages to the build log
235 if ( $VERBOSE ) { print "CONFIGURE STAGE\n"; }
236 system "(time -p ./configure $CONFIGUREARGS --enable-spec --with-objroot=.) > $Prefix-Build-Log.txt 2>&1";
238 if ( $VERBOSE ) { print "BUILD STAGE\n"; }
239 # Build the entire tree, capturing the output into $Prefix-Build-Log.txt
240 system "(time -p gmake $MAKEOPTS) >> $Prefix-Build-Log.txt 2>&1";
245 my ($Regex, $Num, $Regex2, $File) = @_;
246 my @Items = split "\n", `grep '$Regex' $File`;
247 return GetRegex $Regex2, $Items[$Num];
251 # Get some statistics about the build...
253 my @Linked = split '\n', `grep Linking $Prefix-Build-Log.txt`;
254 my $NumExecutables = scalar(grep(/executable/, @Linked));
255 my $NumLibraries = scalar(grep(!/executable/, @Linked));
256 my $NumObjects = `grep '^Compiling' $Prefix-Build-Log.txt | wc -l` + 0;
258 my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$Prefix-Build-Log.txt";
259 my $ConfigTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$Prefix-Build-Log.txt";
260 my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
261 my $ConfigWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$Prefix-Build-Log.txt";
263 my $BuildTimeU = GetRegexNum "^user", 1, "([0-9.]+)", "$Prefix-Build-Log.txt";
264 my $BuildTimeS = GetRegexNum "^sys", 1, "([0-9.]+)", "$Prefix-Build-Log.txt";
265 my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
266 my $BuildWallTime = GetRegexNum "^real", 1, "([0-9.]+)","$Prefix-Build-Log.txt";
269 if (`grep '^gmake[^:]*: .*Error' $Prefix-Build-Log.txt | wc -l` + 0 ||
270 `grep '^gmake: \*\*\*.*Stop.' $Prefix-Build-Log.txt | wc -l`+0) {
271 $BuildError = "<h3><font color='red'>Build error: compilation " .
272 "<a href=\"$DATE-Build-Log.txt\">aborted</a></font></h3>";
273 print "BUILD ERROR\n";
276 sub GetQMTestResults { # (filename)
280 $/ = "\n"; #Make sure we're going line at a time.
281 if (open SRCHFILE, $filename) {
282 # Skip stuff before ---TEST RESULTS
283 while ( <SRCHFILE> ) {
284 if ( m/^--- TEST RESULTS/ ) { last; }
286 # Process test results
287 push(@lines,"<h3>TEST RESULTS</h3><ol><li>\n");
289 my $should_break = 1;
290 while ( <SRCHFILE> ) {
291 if ( length($_) > 1 ) {
293 if ( ! m/: PASS[ ]*$/ &&
294 ! m/^ qmtest.target:/ &&
297 if ( m/: XFAIL/ || m/: XPASS/ || m/: FAIL/ ) {
301 push(@lines,"<b>$_</b><br/>\n");
303 push(@lines,"</li><li><b>$_</b><br/>\n");
305 } elsif ( m/^--- STATISTICS/ ) {
306 if ( $first_list ) { push(@lines,"<b>PERFECT!</b>"); }
307 push(@lines,"</li></ol><h3>STATISTICS</h3><pre>\n");
309 } elsif ( m/^--- TESTS WITH/ ) {
312 push(@lines,"</pre><h3>TESTS WITH UNEXPECTED RESULTS</h3><ol><li>\n");
313 } elsif ( m/^real / ) {
316 if ( $should_break ) {
317 push(@lines,"$_<br/>\n");
327 my $content = join("",@lines);
328 return "$content</pre>\n";
331 # Get results of feature tests.
332 my $FeatureTestResults; # String containing the results of the feature tests
333 my $FeatureTime; # System+CPU Time for feature tests
334 my $FeatureWallTime; # Wall Clock Time for feature tests
336 if ( $VERBOSE ) { print "FEATURE TEST STAGE\n"; }
337 my $feature_output = "$Prefix-FeatureTests-Log.txt";
339 # Run the feature tests so we can summarize the results
340 system "(time -p gmake -C test Feature.t) > $feature_output 2>&1";
342 # Extract test results
343 $FeatureTestResults = GetQMTestResults("$feature_output");
345 # Extract time of feature tests
346 my $FeatureTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$feature_output";
347 my $FeatureTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$feature_output";
348 $FeatureTime = $FeatureTimeU+$FeatureTimeS; # FeatureTime = User+System
349 $FeatureWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$feature_output";
350 # Run the regression tests so we can summarize the results
352 $FeatureTestResults = "Skipped by user choice.";
353 $FeatureTime = "0.0";
354 $FeatureWallTime = "0.0";
357 if (!$NOREGRESSIONS) {
358 if ( $VERBOSE ) { print "REGRESSION TEST STAGE\n"; }
359 my $regression_output = "$Prefix-RegressionTests-Log.txt";
361 # Run the regression tests so we can summarize the results
362 system "(time -p gmake -C test Regression.t) > $regression_output 2>&1";
364 # Extract test results
365 $RegressionTestResults = GetQMTestResults("$regression_output");
367 # Extract time of regressions tests
368 my $RegressionTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$regression_output";
369 my $RegressionTimeS = GetRegexNum "^sys", 0, "([0-9.]+)", "$regression_output";
370 $RegressionTime = $RegressionTimeU+$RegressionTimeS; # RegressionTime = User+System
371 $RegressionWallTime = GetRegexNum "^real", 0,"([0-9.]+)","$regression_output";
373 $RegressionTestResults = "Skipped by user choice.";
374 $RegressionTime = "0.0";
375 $RegressionWallTime = "0.0";
379 print $FeatureTestResults;
380 print $RegressionTestResults;
383 if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
385 # Get warnings from the build
387 my @Warn = split "\n", `egrep 'warning:|Entering dir' $Prefix-Build-Log.txt`;
391 foreach $Warning (@Warn) {
392 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
393 $CurDir = $1; # Keep track of directory warning is in...
394 if ($CurDir =~ m#$BuildDir/llvm/(.*)#) { # Remove buildir prefix if included
398 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
401 my $WarningsFile = join "\n", @Warnings;
402 my $WarningsList = AddPreTag $WarningsFile;
403 $WarningsFile =~ s/:[0-9]+:/::/g;
405 # Emit the warnings file, so we can diff...
406 WriteFile "$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
407 my ($WarningsAdded, $WarningsRemoved) = DiffFiles "-Warnings.txt";
409 # Output something to stdout if something has changed
410 print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
411 print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
413 $WarningsAdded = AddPreTag $WarningsAdded;
414 $WarningsRemoved = AddPreTag $WarningsRemoved;
417 # Get some statistics about CVS commits over the current day...
419 if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
420 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
421 #print join "\n", @CVSHistory; print "\n";
423 # Extract some information from the CVS history... use a hash so no duplicate
425 my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
427 my $DateRE = "[-:0-9 ]+\\+[0-9]+";
429 # Loop over every record from the CVS history, filling in the hashes.
430 foreach $File (@CVSHistory) {
431 my ($Type, $Date, $UID, $Rev, $Filename);
432 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
433 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
434 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
435 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
436 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
437 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
439 print "UNMATCHABLE: $File\n";
441 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
443 if ($Filename =~ /^llvm/) {
444 if ($Type eq 'M') { # Modified
445 $ModifiedFiles{$Filename} = 1;
446 $UsersCommitted{$UID} = 1;
447 } elsif ($Type eq 'A') { # Added
448 $AddedFiles{$Filename} = 1;
449 $UsersCommitted{$UID} = 1;
450 } elsif ($Type eq 'R') { # Removed
451 $RemovedFiles{$Filename} = 1;
452 $UsersCommitted{$UID} = 1;
454 $UsersUpdated{$UID} = 1;
459 my $UserCommitList = join "\n", keys %UsersCommitted;
460 my $UserUpdateList = join "\n", keys %UsersUpdated;
461 my $AddedFilesList = AddPreTag join "\n", sort keys %AddedFiles;
462 my $ModifiedFilesList = AddPreTag join "\n", sort keys %ModifiedFiles;
463 my $RemovedFilesList = AddPreTag join "\n", sort keys %RemovedFiles;
466 my $SingleSourceProgramsTable;
467 my $MultiSourceProgramsTable;
468 my $ExternalProgramsTable;
474 chdir "test/Programs/$SubDir" or
475 die "Could not change into test/Programs/$SubDir testdir!";
477 # Run the programs tests... creating a report.nightly.html file
479 system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.html "
480 . "TEST=nightly > $Prefix-$SubDir-ProgramTest.txt 2>&1";
482 system "gunzip $Prefix-$SubDir-ProgramTest.txt.gz";
486 if (`grep '^gmake[^:]: .*Error' $Prefix-$SubDir-ProgramTest.txt | wc -l` + 0){
488 $ProgramsTable = "<font color=white><h2>Error running tests!</h2></font>";
489 print "ERROR TESTING\n";
490 } elsif (`grep '^gmake[^:]: .*No rule to make target' $Prefix-$SubDir-ProgramTest.txt | wc -l` + 0) {
493 "<font color=white><h2>Makefile error running tests!</h2></font>";
494 print "ERROR TESTING\n";
497 $ProgramsTable = ReadFile "report.nightly.html";
500 # Create a list of the tests which were run...
502 system "egrep 'TEST-(PASS|FAIL)' < $Prefix-$SubDir-ProgramTest.txt "
503 . "| sort > $Prefix-$SubDir-Tests.txt";
506 # Compress the test output
507 system "gzip -f $Prefix-$SubDir-ProgramTest.txt";
508 chdir "../../.." or die "Cannot return to parent directory!";
509 return $ProgramsTable;
512 # If we build the tree successfully, run the nightly programs tests...
513 if ($BuildError eq "") {
515 print "SingleSource TEST STAGE\n";
517 $SingleSourceProgramsTable = TestDirectory("SingleSource");
519 print "MultiSource TEST STAGE\n";
521 $MultiSourceProgramsTable = TestDirectory("MultiSource");
523 print "External TEST STAGE\n";
525 $ExternalProgramsTable = TestDirectory("External");
526 system "cat $Prefix-SingleSource-Tests.txt $Prefix-MultiSource-Tests.txt ".
527 " $Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
531 print "TEST INFORMATION COLLECTION STAGE\n";
533 my ($TestsAdded, $TestsRemoved, $TestsFixed, $TestsBroken) = ("","","","");
536 $TestsAdded = "<b>error testing</b><br>";
537 $TestsRemoved = "<b>error testing</b><br>";
538 $TestsFixed = "<b>error testing</b><br>";
539 $TestsBroken = "<b>error testing</b><br>";
541 my ($RTestsAdded, $RTestsRemoved) = DiffFiles "-Tests.txt";
543 my @RawTestsAddedArray = split '\n', $RTestsAdded;
544 my @RawTestsRemovedArray = split '\n', $RTestsRemoved;
546 my %OldTests = map {GetRegex('TEST-....: (.+)', $_)=>$_}
547 @RawTestsRemovedArray;
548 my %NewTests = map {GetRegex('TEST-....: (.+)', $_)=>$_}
551 foreach $Test (keys %NewTests) {
552 if (!exists $OldTests{$Test}) { # TestAdded if in New but not old
553 $TestsAdded = "$TestsAdded$Test\n";
555 if ($OldTests{$Test} =~ /TEST-PASS/) { # Was the old one a pass?
556 $TestsBroken = "$TestsBroken$Test\n"; # New one must be a failure
558 $TestsFixed = "$TestsFixed$Test\n"; # No, new one is a pass.
562 foreach $Test (keys %OldTests) { # TestRemoved if in Old but not New
563 $TestsRemoved = "$TestsRemoved$Test\n" if (!exists $NewTests{$Test});
566 print "\nTESTS ADDED: \n\n$TestsAdded\n\n" if (length $TestsAdded);
567 print "\nTESTS REMOVED:\n\n$TestsRemoved\n\n" if (length $TestsRemoved);
568 print "\nTESTS FIXED: \n\n$TestsFixed\n\n" if (length $TestsFixed);
569 print "\nTESTS BROKEN: \n\n$TestsBroken\n\n" if (length $TestsBroken);
571 $TestsAdded = AddPreTag $TestsAdded;
572 $TestsRemoved = AddPreTag $TestsRemoved;
573 $TestsFixed = AddPreTag $TestsFixed;
574 $TestsBroken = AddPreTag $TestsBroken;
578 # If we built the tree successfully, runs of the Olden suite with
579 # LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
580 if ($BuildError eq "") {
581 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
582 $MachCodeSize) = ("","","","","","","");
583 if (!$NORUNNINGTESTS) {
584 chdir "test/Programs/MultiSource/Benchmarks/Olden" or die "Olden tests moved?";
586 # Clean out previous results...
587 system "gmake $MAKEOPTS clean > /dev/null 2>&1";
589 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE enabled!
590 system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.raw.out TEST=nightly " .
591 " LARGE_PROBLEM_SIZE=1 > /dev/null 2>&1";
592 system "cp report.nightly.raw.out $Prefix-Olden-tests.txt";
594 system "gunzip $Prefix-Olden-tests.txt.gz";
597 # Now we know we have $Prefix-Olden-tests.txt as the raw output file. Split
598 # it up into records and read the useful information.
599 my @Records = split />>> ========= /, ReadFile "$Prefix-Olden-tests.txt";
600 shift @Records; # Delete the first (garbage) record
602 # Loop over all of the records, summarizing them into rows for the running
604 my $WallTimeRE = "[A-Za-z0-9.: ]+\\(([0-9.]+) wall clock";
605 foreach $Rec (@Records) {
606 my $rNATTime = GetRegex 'TEST-RESULT-nat-time: real\s*([.0-9m]+)', $Rec;
607 my $rCBETime = GetRegex 'TEST-RESULT-cbe-time: real\s*([.0-9m]+)', $Rec;
608 my $rLLCTime = GetRegex 'TEST-RESULT-llc-time: real\s*([.0-9m]+)', $Rec;
609 my $rJITTime = GetRegex 'TEST-RESULT-jit-time: real\s*([.0-9m]+)', $Rec;
610 my $rOptTime = GetRegex "TEST-RESULT-compile: $WallTimeRE", $Rec;
611 my $rBytecodeSize = GetRegex 'TEST-RESULT-compile: *([0-9]+)', $Rec;
612 my $rMachCodeSize = GetRegex 'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code', $Rec;
614 $NATTime .= " " . FormatTime($rNATTime);
615 $CBETime .= " " . FormatTime($rCBETime);
616 $LLCTime .= " " . FormatTime($rLLCTime);
617 $JITTime .= " " . FormatTime($rJITTime);
618 $OptTime .= " $rOptTime";
619 $BytecodeSize .= " $rBytecodeSize";
620 $MachCodeSize .= " $rMachCodeSize";
623 # Now that we have all of the numbers we want, add them to the running totals
625 AddRecord($NATTime, "running_Olden_nat_time.txt");
626 AddRecord($CBETime, "running_Olden_cbe_time.txt");
627 AddRecord($LLCTime, "running_Olden_llc_time.txt");
628 AddRecord($JITTime, "running_Olden_jit_time.txt");
629 AddRecord($OptTime, "running_Olden_opt_time.txt");
630 AddRecord($BytecodeSize, "running_Olden_bytecode.txt");
631 AddRecord($MachCodeSize, "running_Olden_machcode.txt");
633 system "gzip -f $Prefix-Olden-tests.txt";
640 # Get a list of the previous days that we can link to...
642 my @PrevDays = map {s/.html//; $_} GetDir ".html";
644 splice @PrevDays, 20; # Trim down list to something reasonable...
646 my $PrevDaysList = # Format list for sidebar
647 join "\n ", map { "<a href=\"$_.html\">$_</a><br>" } @PrevDays;
650 # Start outputing files into the web directory
652 chdir $WebDir or die "Could not change into web directory!";
654 # Add information to the files which accumulate information for graphs...
655 AddRecord($LOC, "running_loc.txt");
656 AddRecord($BuildTime, "running_build_time.txt");
659 print "GRAPH GENERATION STAGE\n";
662 # Rebuild the graphs now...
664 $GNUPLOT = "/usr/dcs/software/supported/bin/gnuplot";
665 $GNUPLOT = "gnuplot" if ! -x $GNUPLOT;
666 $PlotScriptFilename = "$BuildDir/llvm/utils/NightlyTest.gnuplot";
667 system ($GNUPLOT, $PlotScriptFilename);
670 # Remove the cvs tree...
672 system "rm -rf $BuildDir" if (!$NOCHECKOUT and !$NOREMOVE);
675 # Print out information...
678 print "DateString: $DateString\n";
679 print "CVS Checkout: $CVSCheckoutTime seconds\n";
680 print "Files/Dirs/LOC in CVS: $NumFilesInCVS/$NumDirsInCVS/$LOC\n";
681 print "Build Time: $BuildTime seconds\n";
682 print "Feature Test Time: $FeatureTime seconds\n";
683 print "Regression Test Time: $RegressionTime seconds\n";
684 print "Libraries/Executables/Objects built: $NumLibraries/$NumExecutables/$NumObjects\n";
686 print "WARNINGS:\n $WarningsList\n";
688 print "Users committed: $UserCommitList\n";
689 print "Added Files: \n $AddedFilesList\n";
690 print "Modified Files: \n $ModifiedFilesList\n";
691 print "Removed Files: \n $RemovedFilesList\n";
693 print "Previous Days =\n $PrevDaysList\n";
698 # Output the files...
702 print "OUTPUT STAGE\n";
706 eval "\$Output = <<ENDOFFILE;$TemplateContents\nENDOFFILE\n";
707 WriteFile "$DATE.html", $Output;
709 # Change the index.html symlink...
710 system "ln -sf $DATE.html index.html";
713 my ($Val, $Filename) = @_;
715 if (open FILE, "$WebDir/$Filename") {
716 @Records = grep !/$DATE/, split "\n", <FILE>;
719 push @Records, "$DATE: $Val";
720 WriteFile "$WebDir/$Filename", (join "\n", @Records) . "\n";