llvm.org GIT mirror llvm / 776964a
Revert this until the Date::Parse module can be installed on the nightly testers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35657 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
1 changed file(s) with 75 addition(s) and 160 deletion(s). Raw diff Collapse all Expand all
0 #!/usr/bin/perl
11 use POSIX qw(strftime);
22 use File::Copy;
3 use Date::Parse;
43 use Socket;
54
65 #
4544 # -gccpath Path to gcc/g++ used to build LLVM
4645 # -cvstag Check out a specific CVS tag to build LLVM (useful for
4746 # testing release branches)
48 # -usesvn Check code out from a subversion repository. With no
49 # argument, use the standard repository. An argument specifies
50 # the repository URL to use.
51 # -svnurl Specify the SVN URL where LLVM can be found
5247 # -target Specify the target triplet
5348 # -cflags Next argument specifies that C compilation options that
5449 # override the default.
9590 #
9691 ##############################################################
9792 my $HOME = $ENV{'HOME'};
98 my $SVNURL = $ENV{"SVNURL"};
99 $SVNURL = 'svn://anon@hlvm.org:3691/llvm.svn' unless $SVNURL;
10093 my $CVSRootDir = $ENV{'CVSROOT'};
10194 $CVSRootDir = "/home/vadve/shared/PublicCVS" unless $CVSRootDir;
10295 my $BuildDir = $ENV{'BUILDDIR'};
122115 $CONFIGUREARGS="";
123116 $nickname="";
124117 $NOTEST=0;
125 $USESVN=0;
126118 $NORUNNINGTESTS=0;
127119 $MAKECMD="make";
128120 $SUBMITSERVER = "llvm.org";
170162 else { $GCCPATH=""; }
171163 if (/^-cvstag/) { $CVSCOOPT .= " -r $ARGV[0]"; shift; next; }
172164 else { $CVSCOOPT="";}
173 if (/^-usesvn/) { $USESVN = 1; }
174 if (/^-svnurl/) { $SVNURL = $ARGV[0]; shift; next; }
175165 if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
176166 shift; next; }
177167 if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
234224 ##############################################################
235225 my $Prefix = "$WebDir/$DATE";
236226 my $BuildLog = "$Prefix-Build-Log.txt";
237 my $COLog = "$Prefix-CVS-Log.txt";
227 my $CVSLog = "$Prefix-CVS-Log.txt";
238228 my $OldenTestsLog = "$Prefix-Olden-tests.txt";
239229 my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
240230 my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
251241
252242 if ($VERBOSE) {
253243 print "INITIALIZED\n";
254 if ($USESVN) {
255 print "SVN URL = $SVNURL\n";
256 } else {
257 print "CVS Root = $CVSRootDir\n";
258 }
259 print "COLog = $COLog\n";
244 print "CVS Root = $CVSRootDir\n";
260245 print "BuildDir = $BuildDir\n";
261246 print "WebDir = $WebDir\n";
262247 print "Prefix = $Prefix\n";
248 print "CVSLog = $CVSLog\n";
263249 print "BuildLog = $BuildLog\n";
264250 }
265251
490476 print "Build directory exists! Removing it\n";
491477 }
492478 system "rm -rf $BuildDir";
493 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
479 mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
494480 } else {
495481 if ( $VERBOSE ) {
496482 print "Build directory exists!\n";
497483 }
498484 }
499485 } else {
500 mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
501 }
502 }
503 ChangeDir( $BuildDir, "checkout directory" );
504
505
506 ##############################################################
507 #
508 # Check out the llvm tree, using either SVN or CVS
509 #
510 ##############################################################
486 mkdir $BuildDir or die "Could not create CVS checkout directory $BuildDir!";
487 }
488 }
489 ChangeDir( $BuildDir, "CVS checkout directory" );
490
491
492 ##############################################################
493 #
494 # Check out the llvm tree, saving CVS messages to the cvs log...
495 #
496 ##############################################################
497 my $CVSOPT = "";
498 # Use compression if going over ssh.
499 $CVSOPT = "-z3"
500 if $CVSRootDir =~ /^:ext:/;
501 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
511502 if (!$NOCHECKOUT) {
512503 if ( $VERBOSE ) {
513504 print "CHECKOUT STAGE:\n";
514 }
515 if ($USESVN) {
516 my $SVNCMD = "$NICE svn co $SVNURL";
517 if ($VERBOSE) {
518 print "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
519 "$SVNCMD/llvm-test/trunk llvm-test ) > $COLog 2>&1\n";
520 system "( time -p $SVNCMD/llvm/trunk llvm; cd llvm/projects ; " .
521 "$SVNCMD/llvm-test/trunk llvm-test ) > $COLog 2>&1\n";
522 }
523 } else {
524 my $CVSOPT = "";
525 $CVSOPT = "-z3" # Use compression if going over ssh.
526 if $CVSRootDir =~ /^:ext:/;
527 my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
528 print "( time -p $CVSCMD llvm; cd llvm/projects ; " .
529 "$CVSCMD llvm-test ) > $COLog 2>&1";
530 system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
531 "$CVSCMD llvm-test ) > $COLog 2>&1";
532 }
533 }
534 ChangeDir( $BuildDir , "Checkout directory") ;
505 print "( time -p $CVSCMD llvm; cd llvm/projects ; $CVSCMD llvm-test ) " .
506 "> $CVSLog 2>&1\n";
507 }
508 system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
509 "$CVSCMD llvm-test ) > $CVSLog 2>&1";
510 ChangeDir( $BuildDir , "CVS Checkout directory") ;
511 }
535512 ChangeDir( "llvm" , "llvm source directory") ;
536513
537514 ##############################################################
541518 # This can probably be put on the server side
542519 #
543520 ##############################################################
544 my $CheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $COLog`;
545 my $CheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $COLog`;
546 my $CheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $COLog`;
547 my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
548
549 my $NumFilesInCVS = 0;
550 my $NumDirsInCVS = 0;
551 if ($USESVN) {
552 $NumFilesInCVS = `egrep '^A' $COLog | wc -l` + 0;
553 $NumDirsInCVS = `sed -e 's#/[^/]*$##' $COLog | sort | uniq | wc -l` + 0;
554 } else {
555 $NumFilesInCVS = `egrep '^U' $COLog | wc -l` + 0;
556 $NumDirsInCVS = `egrep '^cvs (checkout|server|update):' $COLog | wc -l` + 0;
557 }
521 my $CVSCheckoutTime_Wall = GetRegex "([0-9.]+)", `grep '^real' $CVSLog`;
522 my $CVSCheckoutTime_User = GetRegex "([0-9.]+)", `grep '^user' $CVSLog`;
523 my $CVSCheckoutTime_Sys = GetRegex "([0-9.]+)", `grep '^sys' $CVSLog`;
524 my $CVSCheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
525
526 my $NumFilesInCVS = `egrep '^U' $CVSLog | wc -l` + 0;
527 my $NumDirsInCVS =
528 `egrep '^cvs (checkout|server|update):' $CVSLog | wc -l` + 0;
558529
559530 ##############################################################
560531 #
566537
567538 my (%AddedFiles, %ModifiedFiles, %RemovedFiles, %UsersCommitted, %UsersUpdated);
568539
569 if (!$NOCVSSTATS) {
540 if(!$NOCVSSTATS){
541
570542 if ($VERBOSE) { print "CVS HISTORY ANALYSIS STAGE\n"; }
571
572 if ($USESVN) {
573 my $delimiter = "----------------------------------------------------" .
574 "--------------------\n";
575 @SVNHistory = split $delimiter, `svn log --verbose -r{$DATE}:HEAD`;
576
577 # Skip very first entry.
578 shift @SVNHistory;
579 foreach $Record (@SVNHistory) {
580 my (@Lines, @Fields);
581 my ($Rev, $Author, $StrTime, $LogLines, $Time);
582 @Lines = split "\n", $Record;
583 # print join"\n", @Lines;
584
585 ($Rev, $Author, $StrTime, $LogLines) = split ' \| ', $Lines[0];
586 $Time = str2time($StrTime);
587 if (time() - $Time > 24*3600) {
588 next;
543 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
544 #print join "\n", @CVSHistory; print "\n";
545
546 my $DateRE = '[-/:0-9 ]+\+[0-9]+';
547
548 # Loop over every record from the CVS history, filling in the hashes.
549 foreach $File (@CVSHistory) {
550 my ($Type, $Date, $UID, $Rev, $Filename);
551 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
552 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
553 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
554 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
555 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
556 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
557 } else {
558 print "UNMATCHABLE: $File\n";
559 next;
589560 }
590
591 $UsersCommitted{$Author} = 1;
592
593 #print $Rev, $Author, $Time, $LogLines, "\n";
594
595 my $i = 2;
596 while ($Lines[$i] ne '') {
597 my ($Type, $Filename, $FromFile, $FromRev);
598 #print $Lines[$i], "\n";
599
600 if ($Lines[$i] =~ / ([MAD]) ([^ ]+) \(from ([^ ]+):([^ ]+)\)/) {
601 ($Type, $Filename, $FromFile, $FromRev) = ($1, $2, $3, $4);
602 } elsif ($Lines[$i] =~ / ([MAD]) ([^ ]+)/) {
603 ($Type, $Filename, $FromFile, $FromRev) = ($1, $2, "", "");
604 } else {
605 print "UNMATCHABLE: $Lines[$i]\n";
606 }
607
608 if ($Type eq 'M') { # Modified
609 $ModifiedFiles{$Filename} = 1;
610 } elsif ($Type eq 'A') { # Added
611 if ($FromFile eq "") { # File was added
612 $AddedFiles{$Filename} = 1;
613 } else { #File was added from another file - moved or copied.
614 $MovedFiles{$Filename} = 1;
561 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
562
563 if ($Filename =~ /^llvm/) {
564 if ($Type eq 'M') { # Modified
565 $ModifiedFiles{$Filename} = 1;
566 $UsersCommitted{$UID} = 1;
567 } elsif ($Type eq 'A') { # Added
568 $AddedFiles{$Filename} = 1;
569 $UsersCommitted{$UID} = 1;
570 } elsif ($Type eq 'R') { # Removed
571 $RemovedFiles{$Filename} = 1;
572 $UsersCommitted{$UID} = 1;
573 } else {
574 $UsersUpdated{$UID} = 1;
615575 }
616 } elsif ($Type eq 'D') { # Removed
617 $RemovedFiles{$Filename} = 1;
618 } else {
619 print "INVALID TYPE: $Type";
620 }
621
622 #print $Filename, "\n";
623 #print $Type, $File, $FromFile, $FromRev, "\n";
624 ++$i;
625576 }
626 }
627 } else {
628 @CVSHistory = split "\n", `cvs history -D '1 day ago' -a -xAMROCGUW`;
629 #print join "\n", @CVSHistory; print "\n";
630
631 my $DateRE = '[-/:0-9 ]+\+[0-9]+';
632
633 # Loop over every record from the CVS history, filling in the hashes.
634 foreach $File (@CVSHistory) {
635 my ($Type, $Date, $UID, $Rev, $Filename);
636 if ($File =~ /([AMRUGC]) ($DateRE) ([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)/) {
637 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, $4, "$6/$5");
638 } elsif ($File =~ /([W]) ($DateRE) ([^ ]+)/) {
639 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "");
640 } elsif ($File =~ /([O]) ($DateRE) ([^ ]+) +([^ ]+)/) {
641 ($Type, $Date, $UID, $Rev, $Filename) = ($1, $2, $3, "", "$4/");
642 } else {
643 print "UNMATCHABLE: $File\n";
644 next;
645 }
646 # print "$File\nTy = $Type Date = '$Date' UID=$UID Rev=$Rev File = '$Filename'\n";
647
648 if ($Filename =~ /^llvm/) {
649 if ($Type eq 'M') { # Modified
650 $ModifiedFiles{$Filename} = 1;
651 $UsersCommitted{$UID} = 1;
652 } elsif ($Type eq 'A') { # Added
653 $AddedFiles{$Filename} = 1;
654 $UsersCommitted{$UID} = 1;
655 } elsif ($Type eq 'R') { # Removed
656 $RemovedFiles{$Filename} = 1;
657 $UsersCommitted{$UID} = 1;
658 } else {
659 $UsersUpdated{$UID} = 1;
660 }
661 }
662 }
663
664 my $TestError = 1;
665 } #$USESVN
577 }
578
579 my $TestError = 1;
580
666581 }#!NOCVSSTATS
667582
668583 my $CVSAddedFiles = join "\n", sort keys %AddedFiles;
1028943
1029944 my @CVS_DATA;
1030945 my $cvs_data;
1031 @CVS_DATA = ReadFile "$COLog";
946 @CVS_DATA = ReadFile "$CVSLog";
1032947 $cvs_data = join("\n", @CVS_DATA);
1033948
1034949 my @BUILD_DATA;
1074989 'nickname' => $nickname,
1075990 'dejagnutime_wall' => $DejagnuWallTime,
1076991 'dejagnutime_cpu' => $DejagnuTime,
1077 'cvscheckouttime_wall' => $CheckoutTime_Wall,
1078 'cvscheckouttime_cpu' => $CheckoutTime_CPU,
992 'cvscheckouttime_wall' => $CVSCheckoutTime_Wall,
993 'cvscheckouttime_cpu' => $CVSCheckoutTime_CPU,
1079994 'configtime_wall' => $ConfigWallTime,
1080995 'configtime_cpu'=> $ConfigTime,
1081996 'buildtime_wall' => $BuildWallTime,