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 # -release Build an LLVM Release version
24 # -pedantic Enable additional GCC warnings to detect possible errors.
25 # -enable-linscan Enable linearscan tests
26 # -disable-codegen Disable LLC and JIT tests in the nightly tester.
27 # -verbose Turn on some debug output
28 # -debug Print information useful only to maintainers of this script.
30 # CVSROOT is the CVS repository from which the tree will be checked out,
31 # specified either in the full :method:user@host:/dir syntax, or
32 # just /dir if using a local repo.
33 # BUILDDIR is the directory where sources for this test run will be checked out
34 # AND objects for this test run will be built. This directory MUST NOT
35 # exist before the script is run; it will be created by the cvs checkout
36 # process and erased (unless -noremove is specified; see above.)
37 # WEBDIR is the directory into which the test results web page will be written,
38 # AND in which the "index.html" is assumed to be a symlink to the most recent
39 # copy of the results. This directory MUST exist before the script is run.
41 use POSIX
qw(strftime);
43 my $HOME = $ENV{'HOME'};
44 my $CVSRootDir = $ENV{'CVSROOT'};
45 $CVSRootDir = "/home/vadve/shared/PublicCVS"
47 my $BuildDir = $ENV{'BUILDDIR'};
48 $BuildDir = "$HOME/buildtest"
50 my $WebDir = $ENV{'WEBDIR'};
51 $WebDir = "$HOME/cvs/testresults-X86"
54 # Calculate the date prefix...
56 my $DATE = sprintf "%4d-%02d-%02d", $TIME[5]+1900, $TIME[4]+1, $TIME[3];
57 my $DateString = strftime
"%B %d, %Y", localtime;
61 if (open (FILE
, $_[0])) {
66 print "Could not open file '$_[0]' for reading!";
71 sub WriteFile
{ # (filename, contents)
72 open (FILE
, ">$_[0]") or die "Could not open file '$_[0]' for writing!";
77 sub GetRegex
{ # (Regex with ()'s, value)
85 sub AddPreTag
{ # Add pre tags around nonempty list, or convert to "none"
87 if (length) { return "<ul><pre>$_</pre></ul>"; } else { "<b>none</b><br>"; }
93 my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH
;
98 # DiffFiles - Diff the current version of the file against the last version of
99 # the file, reporting things added and removed. This is used to report, for
100 # example, added and removed warnings. This returns a pair (added, removed)
104 my @Others = GetDir
$Suffix;
105 if (@Others == 0) { # No other files? We added all entries...
106 return (`cat $WebDir/$DATE$Suffix`, "");
108 # Diff the files now...
109 my @Diffs = split "\n", `diff $WebDir/$DATE$Suffix $WebDir/$Others[0]`;
110 my $Added = join "\n", grep /^</, @Diffs;
111 my $Removed = join "\n", grep /^>/, @Diffs;
113 $Removed =~ s/^> //gm;
114 return ($Added, $Removed);
117 # FormatTime - Convert a time from 1m23.45 into 83.45
120 if ($Time =~ m/([0-9]+)m([0-9.]+)/) {
121 $Time = sprintf("%7.4f", $1*60.0+$2);
127 # Command line argument settings...
131 my $NOREGRESSIONS = 0;
133 my $NORUNNINGTESTS = 0;
135 my $PROGTESTOPTS = "";
138 my $CONFIGUREARGS = "--enable-jit";
141 while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
143 last if /^--$/; # Stop processing arguments on --
145 # List command line options here...
146 if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
147 if (/^-noremove$/) { $NOREMOVE = 1; next; }
148 if (/^-nofeaturetests$/) { $NOFEATURES = 1; next; }
149 if (/^-noregressiontests$/){ $NOREGRESSIONS = 1; next; }
150 if (/^-notest$/) { $NOTEST = 1; $NORUNNINGTESTS = 1; next; }
151 if (/^-norunningtests$/) { $NORUNNINGTESTS = 1; next; }
152 if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j2 -l3.0"; next; }
153 if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1"; next; }
155 $MAKEOPTS = "$MAKEOPTS CompileOptimizeOpts='-O3 -DNDEBUG -finline-functions -Wpointer-arith -Wcast-align -Wno-deprecated -Wold-style-cast -Wabi -Woverloaded-virtual -Weffc++ -ffor-scope'";
158 if (/^-enable-linscan$/) { $PROGTESTOPTS .= " ENABLE_LINEARSCAN=1"; next; }
159 if (/^-disable-codegen$/){ $PROGTESTOPTS .= " DISABLE_JIT=1 DISABLE_LLC=1";
160 $CONFIGUREARGS="--disable-jit --disable-llc_diffs";
162 if (/^-verbose$/) { $VERBOSE = 1; next; }
163 if (/^-debug$/) { $DEBUG = 1; next; }
165 print "Unknown option: $_ : ignoring!\n";
168 if ($ENV{'LLVMGCCDIR'}) {
169 $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
172 die "Must specify 0 or 3 options!" if (@ARGV != 0 and @ARGV != 3);
175 $CVSRootDir = $ARGV[0];
176 $BuildDir = $ARGV[1];
181 my $Template = "$BuildDir/llvm/utils/NightlyTestTemplate.html";
182 my $Prefix = "$WebDir/$DATE";
185 print "INITIALIZED\n";
186 print "CVS Root = $CVSRootDir\n";
187 print "BuildDir = $BuildDir\n";
188 print "WebDir = $WebDir\n";
189 print "Prefix = $Prefix\n";
194 # Create the CVS repository directory
199 system "rm -rf $BuildDir";
201 die "CVS checkout directory $BuildDir already exists!";
204 mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
206 chdir $BuildDir or die "Could not change to CVS checkout directory $BuildDir!";
210 # Check out the llvm tree, saving CVS messages to the cvs log...
213 $CVSOPT = "-z3" if $CVSRootDir =~ /^:ext:/; # Use compression if going over ssh.
215 if ( $VERBOSE ) { print "CHECKOUT STAGE\n"; }
216 system "(time -p cvs $CVSOPT -d $CVSRootDir co llvm) > $Prefix-CVS-Log.txt 2>&1";
219 chdir "llvm" or die "Could not change into llvm directory!";
222 if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
223 system "cvs update -P -d > /dev/null 2>&1" ;
226 # Read in the HTML template file...
227 my $TemplateContents = ReadFile
$Template;
231 # Get some static statistics about the current state of CVS
233 my $CVSCheckoutTime = GetRegex
"([0-9.]+)", `grep '^real' $Prefix-CVS-Log.txt`;
234 my $NumFilesInCVS = `egrep '^U' $Prefix-CVS-Log.txt | wc -l` + 0;
235 my $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $Prefix-CVS-Log.txt | wc -l` + 0;
236 $LOC = GetRegex
"([0-9]+) +total", `wc -l \`utils
/getsrcs
.sh\
` | grep total`;
239 # Build the entire tree, saving build messages to the build log
242 if ( $VERBOSE ) { print "CONFIGURE STAGE\n"; }
243 system "(time -p ./configure $CONFIGUREARGS --enable-spec --with-objroot=.) > $Prefix-Build-Log.txt 2>&1";
245 if ( $VERBOSE ) { print "BUILD STAGE\n"; }
246 # Build the entire tree, capturing the output into $Prefix-Build-Log.txt
247 system "(time -p gmake $MAKEOPTS) >> $Prefix-Build-Log.txt 2>&1";
252 my ($Regex, $Num, $Regex2, $File) = @_;
253 my @Items = split "\n", `grep '$Regex' $File`;
254 return GetRegex
$Regex2, $Items[$Num];
258 # Get some statistics about the build...
260 my @Linked = split '\n', `grep Linking $Prefix-Build-Log.txt`;
261 my $NumExecutables = scalar(grep(/executable/, @Linked));
262 my $NumLibraries = scalar(grep(!/executable/, @Linked));
263 my $NumObjects = `grep '^Compiling' $Prefix-Build-Log.txt | wc -l` + 0;
265 my $ConfigTimeU = GetRegexNum
"^user", 0, "([0-9.]+)", "$Prefix-Build-Log.txt";
266 my $ConfigTimeS = GetRegexNum
"^sys", 0, "([0-9.]+)", "$Prefix-Build-Log.txt";
267 my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
268 my $ConfigWallTime = GetRegexNum
"^real", 0,"([0-9.]+)","$Prefix-Build-Log.txt";
270 my $BuildTimeU = GetRegexNum
"^user", 1, "([0-9.]+)", "$Prefix-Build-Log.txt";
271 my $BuildTimeS = GetRegexNum
"^sys", 1, "([0-9.]+)", "$Prefix-Build-Log.txt";
272 my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
273 my $BuildWallTime = GetRegexNum
"^real", 1, "([0-9.]+)","$Prefix-Build-Log.txt";
276 if (`grep '^gmake[^:]*: .*Error' $Prefix-Build-Log.txt | wc -l` + 0 ||
277 `grep '^gmake: \*\*\*.*Stop.' $Prefix-Build-Log.txt | wc -l`+0) {
278 $BuildError = "<h3><font color='red'>Build error: compilation " .
279 "<a href=\"$DATE-Build-Log.txt\">aborted</a></font></h3>";
280 print "BUILD ERROR\n";
283 sub GetQMTestResults
{ # (filename)
287 $/ = "\n"; #Make sure we're going line at a time.
288 if (open SRCHFILE
, $filename) {
289 # Skip stuff before ---TEST RESULTS
290 while ( <SRCHFILE
> ) {
291 if ( m/^--- TEST RESULTS/ ) { last; }
293 # Process test results
294 push(@lines,"<h3>TEST RESULTS</h3><ol><li>\n");
296 my $should_break = 1;
298 while ( <SRCHFILE
> ) {
299 if ( length($_) > 1 ) {
301 if ( ! m/: PASS[ ]*$/ &&
302 ! m/^ qmtest.target:/ &&
307 } elsif ( m/: XPASS/ || m/: FAIL/ ) {
312 push(@lines,"<b>$_</b><br/>\n");
314 push(@lines,"</li><li><b>$_</b><br/>\n");
316 } elsif ( m/^--- STATISTICS/ ) {
317 if ( $first_list ) { push(@lines,"<b>PERFECT!</b>"); }
318 push(@lines,"</li></ol><h3>STATISTICS</h3><pre>\n");
321 } elsif ( m/^--- TESTS WITH/ ) {
325 push(@lines,"</pre><h3>TESTS WITH UNEXPECTED RESULTS</h3><ol><li>\n");
326 } elsif ( m/^real / ) {
329 if ( $should_break ) {
330 push(@lines,"$_<br/>\n");
340 my $content = join("",@lines);
341 return "$content</li></ol>\n";
344 # Get results of feature tests.
345 my $FeatureTestResults; # String containing the results of the feature tests
346 my $FeatureTime; # System+CPU Time for feature tests
347 my $FeatureWallTime; # Wall Clock Time for feature tests
349 if ( $VERBOSE ) { print "FEATURE TEST STAGE\n"; }
350 my $feature_output = "$Prefix-FeatureTests-Log.txt";
352 # Run the feature tests so we can summarize the results
353 system "(time -p gmake -C test Feature.t) > $feature_output 2>&1";
355 # Extract test results
356 $FeatureTestResults = GetQMTestResults
("$feature_output");
358 # Extract time of feature tests
359 my $FeatureTimeU = GetRegexNum
"^user", 0, "([0-9.]+)", "$feature_output";
360 my $FeatureTimeS = GetRegexNum
"^sys", 0, "([0-9.]+)", "$feature_output";
361 $FeatureTime = $FeatureTimeU+$FeatureTimeS; # FeatureTime = User+System
362 $FeatureWallTime = GetRegexNum
"^real", 0,"([0-9.]+)","$feature_output";
363 # Run the regression tests so we can summarize the results
365 $FeatureTestResults = "Skipped by user choice.";
366 $FeatureTime = "0.0";
367 $FeatureWallTime = "0.0";
370 if (!$NOREGRESSIONS) {
371 if ( $VERBOSE ) { print "REGRESSION TEST STAGE\n"; }
372 my $regression_output = "$Prefix-RegressionTests-Log.txt";
374 # Run the regression tests so we can summarize the results
375 system "(time -p gmake -C test Regression.t) > $regression_output 2>&1";
377 # Extract test results
378 $RegressionTestResults = GetQMTestResults
("$regression_output");
380 # Extract time of regressions tests
381 my $RegressionTimeU = GetRegexNum
"^user", 0, "([0-9.]+)", "$regression_output";
382 my $RegressionTimeS = GetRegexNum
"^sys", 0, "([0-9.]+)", "$regression_output";
383 $RegressionTime = $RegressionTimeU+$RegressionTimeS; # RegressionTime = User+System
384 $RegressionWallTime = GetRegexNum
"^real", 0,"([0-9.]+)","$regression_output";
386 $RegressionTestResults = "Skipped by user choice.";
387 $RegressionTime = "0.0";
388 $RegressionWallTime = "0.0";
392 print $FeatureTestResults;
393 print $RegressionTestResults;
396 if ( $VERBOSE ) { print "BUILD INFORMATION COLLECTION STAGE\n"; }
398 # Get warnings from the build
400 my @Warn = split "\n", `egrep 'warning:|Entering dir' $Prefix-Build-Log.txt`;
404 foreach $Warning (@Warn) {
405 if ($Warning =~ m/Entering directory \`([^\`]+)\'/) {
406 $CurDir = $1; # Keep track of directory warning is in...
407 if ($CurDir =~ m
#$BuildDir/llvm/(.*)#) { # Remove buildir prefix if included
411 push @Warnings, "$CurDir/$Warning"; # Add directory to warning...
414 my $WarningsFile = join "\n", @Warnings;
415 my $WarningsList = AddPreTag
$WarningsFile;
416 $WarningsFile =~ s/:[0-9]+:/::/g;
418 # Emit the warnings file, so we can diff...
419 WriteFile
"$WebDir/$DATE-Warnings.txt", $WarningsFile . "\n";
420 my ($WarningsAdded, $WarningsRemoved) = DiffFiles
"-Warnings.txt";
422 # Output something to stdout if something has changed
423 print "ADDED WARNINGS:\n$WarningsAdded\n\n" if (length $WarningsAdded);
424 print "REMOVED WARNINGS:\n$WarningsRemoved\n\n" if (length $WarningsRemoved);
426 $WarningsAdded = AddPreTag
$WarningsAdded;
427 $WarningsRemoved = AddPreTag
$WarningsRemoved;
430 # Get some statistics about CVS commits over the current day...
432 if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
433 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
434 #print join "\n", @CVSHistory; print "\n";
436 # Extract some information from the CVS history... use a hash so no duplicate
438 my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
440 my $DateRE = '[-/:0-9 ]+\+[0-9]+';
442 # Loop over every record from the CVS history, filling in the hashes.
443 foreach $File (@CVSHistory) {
444 my ($Type, $Date, $UID, $Rev, $Filename);
445 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
446 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
447 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
448 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
449 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
450 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
452 print "UNMATCHABLE: $File\n";
455 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
457 if ($Filename =~ /^llvm/) {
458 if ($Type eq 'M') { # Modified
459 $ModifiedFiles{$Filename} = 1;
460 $UsersCommitted{$UID} = 1;
461 } elsif ($Type eq 'A') { # Added
462 $AddedFiles{$Filename} = 1;
463 $UsersCommitted{$UID} = 1;
464 } elsif ($Type eq 'R') { # Removed
465 $RemovedFiles{$Filename} = 1;
466 $UsersCommitted{$UID} = 1;
468 $UsersUpdated{$UID} = 1;
473 my $UserCommitList = join "\n", keys %UsersCommitted;
474 my $UserUpdateList = join "\n", keys %UsersUpdated;
475 my $AddedFilesList = AddPreTag
join "\n", sort keys %AddedFiles;
476 my $ModifiedFilesList = AddPreTag
join "\n", sort keys %ModifiedFiles;
477 my $RemovedFilesList = AddPreTag
join "\n", sort keys %RemovedFiles;
480 my $SingleSourceProgramsTable;
481 my $MultiSourceProgramsTable;
482 my $ExternalProgramsTable;
488 chdir "test/Programs/$SubDir" or
489 die "Could not change into test/Programs/$SubDir testdir!";
491 # Run the programs tests... creating a report.nightly.html file
493 system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.html "
494 . "TEST=nightly > $Prefix-$SubDir-ProgramTest.txt 2>&1";
496 system "gunzip $Prefix-$SubDir-ProgramTest.txt.gz";
500 if (`grep '^gmake[^:]: .*Error' $Prefix-$SubDir-ProgramTest.txt | wc -l` + 0){
502 $ProgramsTable = "<font color=white><h2>Error running tests!</h2></font>";
503 print "ERROR TESTING\n";
504 } elsif (`grep '^gmake[^:]: .*No rule to make target' $Prefix-$SubDir-ProgramTest.txt | wc -l` + 0) {
507 "<font color=white><h2>Makefile error running tests!</h2></font>";
508 print "ERROR TESTING\n";
511 $ProgramsTable = ReadFile
"report.nightly.html";
514 # Create a list of the tests which were run...
516 system "egrep 'TEST-(PASS|FAIL)' < $Prefix-$SubDir-ProgramTest.txt "
517 . "| sort > $Prefix-$SubDir-Tests.txt";
520 # Compress the test output
521 system "gzip -f $Prefix-$SubDir-ProgramTest.txt";
522 chdir "../../.." or die "Cannot return to parent directory!";
523 return $ProgramsTable;
526 # If we build the tree successfully, run the nightly programs tests...
527 if ($BuildError eq "") {
529 print "SingleSource TEST STAGE\n";
531 $SingleSourceProgramsTable = TestDirectory
("SingleSource");
533 print "MultiSource TEST STAGE\n";
535 $MultiSourceProgramsTable = TestDirectory
("MultiSource");
537 print "External TEST STAGE\n";
539 $ExternalProgramsTable = TestDirectory
("External");
540 system "cat $Prefix-SingleSource-Tests.txt $Prefix-MultiSource-Tests.txt ".
541 " $Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
545 print "TEST INFORMATION COLLECTION STAGE\n";
547 my ($TestsAdded, $TestsRemoved, $TestsFixed, $TestsBroken) = ("","","","");
550 $TestsAdded = "<b>error testing</b><br>";
551 $TestsRemoved = "<b>error testing</b><br>";
552 $TestsFixed = "<b>error testing</b><br>";
553 $TestsBroken = "<b>error testing</b><br>";
555 my ($RTestsAdded, $RTestsRemoved) = DiffFiles
"-Tests.txt";
557 my @RawTestsAddedArray = split '\n', $RTestsAdded;
558 my @RawTestsRemovedArray = split '\n', $RTestsRemoved;
560 my %OldTests = map {GetRegex
('TEST-....: (.+)', $_)=>$_}
561 @RawTestsRemovedArray;
562 my %NewTests = map {GetRegex
('TEST-....: (.+)', $_)=>$_}
565 foreach $Test (keys %NewTests) {
566 if (!exists $OldTests{$Test}) { # TestAdded if in New but not old
567 $TestsAdded = "$TestsAdded$Test\n";
569 if ($OldTests{$Test} =~ /TEST-PASS/) { # Was the old one a pass?
570 $TestsBroken = "$TestsBroken$Test\n"; # New one must be a failure
572 $TestsFixed = "$TestsFixed$Test\n"; # No, new one is a pass.
576 foreach $Test (keys %OldTests) { # TestRemoved if in Old but not New
577 $TestsRemoved = "$TestsRemoved$Test\n" if (!exists $NewTests{$Test});
580 print "\nTESTS ADDED: \n\n$TestsAdded\n\n" if (length $TestsAdded);
581 print "\nTESTS REMOVED:\n\n$TestsRemoved\n\n" if (length $TestsRemoved);
582 print "\nTESTS FIXED: \n\n$TestsFixed\n\n" if (length $TestsFixed);
583 print "\nTESTS BROKEN: \n\n$TestsBroken\n\n" if (length $TestsBroken);
585 $TestsAdded = AddPreTag
$TestsAdded;
586 $TestsRemoved = AddPreTag
$TestsRemoved;
587 $TestsFixed = AddPreTag
$TestsFixed;
588 $TestsBroken = AddPreTag
$TestsBroken;
592 # If we built the tree successfully, runs of the Olden suite with
593 # LARGE_PROBLEM_SIZE on so that we can get some "running" statistics.
594 if ($BuildError eq "") {
595 my ($NATTime, $CBETime, $LLCTime, $JITTime, $OptTime, $BytecodeSize,
596 $MachCodeSize) = ("","","","","","","");
597 if (!$NORUNNINGTESTS) {
598 chdir "test/Programs/MultiSource/Benchmarks/Olden" or die "Olden tests moved?";
600 # Clean out previous results...
601 system "gmake $MAKEOPTS clean > /dev/null 2>&1";
603 # Run the nightly test in this directory, with LARGE_PROBLEM_SIZE enabled!
604 system "gmake -k $MAKEOPTS $PROGTESTOPTS report.nightly.raw.out TEST=nightly " .
605 " LARGE_PROBLEM_SIZE=1 > /dev/null 2>&1";
606 system "cp report.nightly.raw.out $Prefix-Olden-tests.txt";
608 system "gunzip $Prefix-Olden-tests.txt.gz";
611 # Now we know we have $Prefix-Olden-tests.txt as the raw output file. Split
612 # it up into records and read the useful information.
613 my @Records = split />>> ========= /, ReadFile
"$Prefix-Olden-tests.txt";
614 shift @Records; # Delete the first (garbage) record
616 # Loop over all of the records, summarizing them into rows for the running
618 my $WallTimeRE = "[A-Za-z0-9.: ]+\\(([0-9.]+) wall clock";
619 foreach $Rec (@Records) {
620 my $rNATTime = GetRegex
'TEST-RESULT-nat-time: real\s*([.0-9m]+)', $Rec;
621 my $rCBETime = GetRegex
'TEST-RESULT-cbe-time: real\s*([.0-9m]+)', $Rec;
622 my $rLLCTime = GetRegex
'TEST-RESULT-llc-time: real\s*([.0-9m]+)', $Rec;
623 my $rJITTime = GetRegex
'TEST-RESULT-jit-time: real\s*([.0-9m]+)', $Rec;
624 my $rOptTime = GetRegex
"TEST-RESULT-compile: $WallTimeRE", $Rec;
625 my $rBytecodeSize = GetRegex
'TEST-RESULT-compile: *([0-9]+)', $Rec;
626 my $rMachCodeSize = GetRegex
'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code', $Rec;
628 $NATTime .= " " . FormatTime
($rNATTime);
629 $CBETime .= " " . FormatTime
($rCBETime);
630 $LLCTime .= " " . FormatTime
($rLLCTime);
631 $JITTime .= " " . FormatTime
($rJITTime);
632 $OptTime .= " $rOptTime";
633 $BytecodeSize .= " $rBytecodeSize";
634 $MachCodeSize .= " $rMachCodeSize";
637 # Now that we have all of the numbers we want, add them to the running totals
639 AddRecord
($NATTime, "running_Olden_nat_time.txt");
640 AddRecord
($CBETime, "running_Olden_cbe_time.txt");
641 AddRecord
($LLCTime, "running_Olden_llc_time.txt");
642 AddRecord
($JITTime, "running_Olden_jit_time.txt");
643 AddRecord
($OptTime, "running_Olden_opt_time.txt");
644 AddRecord
($BytecodeSize, "running_Olden_bytecode.txt");
645 AddRecord
($MachCodeSize, "running_Olden_machcode.txt");
647 system "gzip -f $Prefix-Olden-tests.txt";
654 # Get a list of the previous days that we can link to...
656 my @PrevDays = map {s/.html//; $_} GetDir
".html";
658 if ((scalar @PrevDays) > 20) {
659 splice @PrevDays, 20; # Trim down list to something reasonable...
662 my $PrevDaysList = # Format list for sidebar
663 join "\n ", map { "<a href=\"$_.html\">$_</a><br>" } @PrevDays;
666 # Start outputing files into the web directory
668 chdir $WebDir or die "Could not change into web directory!";
670 # Add information to the files which accumulate information for graphs...
671 AddRecord
($LOC, "running_loc.txt");
672 AddRecord
($BuildTime, "running_build_time.txt");
675 print "GRAPH GENERATION STAGE\n";
678 # Rebuild the graphs now...
680 $GNUPLOT = "/usr/dcs/software/supported/bin/gnuplot";
681 $GNUPLOT = "gnuplot" if ! -x
$GNUPLOT;
682 $PlotScriptFilename = "$BuildDir/llvm/utils/NightlyTest.gnuplot";
683 system ($GNUPLOT, $PlotScriptFilename);
686 # Remove the cvs tree...
688 system "rm -rf $BuildDir" if (!$NOCHECKOUT and !$NOREMOVE);
691 # Print out information...
694 print "DateString: $DateString\n";
695 print "CVS Checkout: $CVSCheckoutTime seconds\n";
696 print "Files/Dirs/LOC in CVS: $NumFilesInCVS/$NumDirsInCVS/$LOC\n";
697 print "Build Time: $BuildTime seconds\n";
698 print "Feature Test Time: $FeatureTime seconds\n";
699 print "Regression Test Time: $RegressionTime seconds\n";
700 print "Libraries/Executables/Objects built: $NumLibraries/$NumExecutables/$NumObjects\n";
702 print "WARNINGS:\n $WarningsList\n";
704 print "Users committed: $UserCommitList\n";
705 print "Added Files: \n $AddedFilesList\n";
706 print "Modified Files: \n $ModifiedFilesList\n";
707 print "Removed Files: \n $RemovedFilesList\n";
709 print "Previous Days =\n $PrevDaysList\n";
714 # Output the files...
718 print "OUTPUT STAGE\n";
722 eval "\$Output = <<ENDOFFILE;$TemplateContents\nENDOFFILE\n";
723 WriteFile
"$DATE.html", $Output;
725 # Change the index.html symlink...
726 system "ln -sf $DATE.html index.html";
729 my ($Val, $Filename) = @_;
731 if (open FILE
, "$WebDir/$Filename") {
732 @Records = grep !/$DATE/, split "\n", <FILE
>;
735 push @Records, "$DATE: $Val";
736 WriteFile
"$WebDir/$Filename", (join "\n", @Records) . "\n";