Changeset 27191
- Timestamp:
- Mar 4, 2010, 2:37:57 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/tools/errors.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/errors.pl
r27154 r27191 50 50 } elsif ($stage eq "stack") { 51 51 $sql = "SELECT stack_id, 'stack', hostname, path_base FROM stackRun JOIN stackSumSkyfile USING(stack_id) WHERE fault != 0"; 52 } else { 52 } elsif ($stage eq "warp") { 53 $sql = "SELECT warp_id, skycell_id, hostname, path_base FROM warpRun JOIN warpSkyfile USING(warp_id) WHERE fault != 0"; 54 }else { 53 55 die "Unsupported stage: $stage\n"; 54 56 } … … 70 72 my %unable_access; 71 73 my %statistics_file; 74 my %transparencies; 75 my %couldnt_open_file; 76 my %failed_read; 72 77 my %unknown; 73 78 my %bad; … … 93 98 } 94 99 95 my $file; 100 my $file; # Log file 96 101 open $file, $log; 97 my $found = 0; # Found something interesting 98 while (<$file>) { 99 if (/Assertion .* failed/ or /Assertion failed in/) { 102 my @log = <$file>; # Contents of log file 103 close $file; 104 my $line; # Line from file 105 my $found; # Found something? 106 while (($line = pop @log)) { 107 if ($line =~ /Assertion .* failed/ or $line =~ /Assertion failed in/) { 100 108 $assertion{$name} = $log; 101 109 $found = 1; 102 110 last; 103 111 } 104 if ( /Cannot find file (\S+)/) {112 if ($line =~ /Cannot find file (\S+)/) { 105 113 $cannot_find_file{$name} = $1; 106 114 $found = 1; 107 115 last; 108 116 } 109 if ( /Unable to access file (\S+)/) {117 if ($line =~ /Unable to access file (\S+)/) { 110 118 $unable_access{$name} = $1; 111 119 $found = 1; 112 120 last; 113 121 } 114 if ( /failed to determine real name from template for (\S+)/) {122 if ($line =~ /failed to determine real name from template for (\S+)/) { 115 123 $failed_real_name{$name} = $1; 116 124 $found = 1; 117 125 last; 118 126 } 119 if ( /failed to close (\S+)/) {127 if ($line =~ /failed to close (\S+)/) { 120 128 $failed_close{$name} = $1; 121 129 $found = 1; 122 130 last; 123 131 } 124 if ( /Unable to open statistics file/) {132 if ($line =~ /Unable to open statistics file/) { 125 133 $statistics_file{$name} = $log; 126 134 $found = 1; 127 135 last; 128 136 } 129 } 130 close $file; 137 if ($line =~ /Unable to perform statistics on transparencies./) { 138 $transparencies{$name} = $log; 139 $found = 1; 140 last; 141 } 142 if ($line =~ /Could not open file,(\S+)/) { 143 $couldnt_open_file{$name} = $1; 144 $found = 1; 145 last; 146 } 147 if ($line =~ /failed to read (\S+)/) { 148 $failed_read{$name} = $1; 149 $found = 1; 150 last; 151 } 152 } 131 153 $unknown{$name} = $log unless $found; 132 154 } … … 136 158 print "\n"; 137 159 138 print "Assertion failures: " . ( scalar keys %assertion ) . "\n"; 139 foreach my $name (keys %assertion) { 140 print "$name: $assertion{$name}\n"; 141 } 142 print "\n"; 143 144 print "'Cannot find file' errors: " . ( scalar keys %cannot_find_file ) . "\n"; 145 foreach my $name (keys %cannot_find_file) { 146 print "$name: $cannot_find_file{$name}\n"; 147 } 148 print "\n"; 149 150 print "'Unable to access file' errors: " . ( scalar keys %unable_access ) . "\n"; 151 foreach my $name (keys %unable_access) { 152 print "$name: $unable_access{$name}\n"; 153 } 154 print "\n"; 155 156 print "'Failed to determine real name' errors: " . ( scalar keys %failed_real_name ) . "\n"; 157 foreach my $name (keys %failed_real_name) { 158 print "$name: $failed_real_name{$name}\n"; 159 } 160 print "\n"; 161 162 print "'Failed to close' errors: " . ( scalar keys %failed_close ) . "\n"; 163 foreach my $name (keys %failed_close) { 164 print "$name: $failed_close{$name}\n"; 165 } 166 print "\n"; 167 168 print "Unknown errors: " . ( scalar keys %unknown ) . "\n"; 169 foreach my $name (keys %unknown) { 170 print "$name: $unknown{$name}\n"; 171 } 172 print "\n"; 173 174 print "Bad logs: " . ( scalar keys %bad ) . "\n"; 175 foreach my $name (keys %bad) { 176 print "$name: $bad{$name}\n"; 177 } 178 print "\n"; 160 if (scalar keys %assertion) { 161 print "Assertion failures: " . ( scalar keys %assertion ) . "\n"; 162 foreach my $name (keys %assertion) { 163 print "$name: $assertion{$name}\n"; 164 } 165 print "\n"; 166 } 167 168 if (scalar keys %cannot_find_file) { 169 print "'Cannot find file' errors: " . ( scalar keys %cannot_find_file ) . "\n"; 170 foreach my $name (keys %cannot_find_file) { 171 print "$name: $cannot_find_file{$name}\n"; 172 } 173 print "\n"; 174 } 175 176 if (scalar keys %unable_access) { 177 print "'Unable to access file' errors: " . ( scalar keys %unable_access ) . "\n"; 178 foreach my $name (keys %unable_access) { 179 print "$name: $unable_access{$name}\n"; 180 } 181 print "\n"; 182 } 183 184 if (scalar keys %failed_real_name) { 185 print "'Failed to determine real name' errors: " . ( scalar keys %failed_real_name ) . "\n"; 186 foreach my $name (keys %failed_real_name) { 187 print "$name: $failed_real_name{$name}\n"; 188 } 189 print "\n"; 190 } 191 192 if (scalar keys %failed_close) { 193 print "'Failed to close' errors: " . ( scalar keys %failed_close ) . "\n"; 194 foreach my $name (keys %failed_close) { 195 print "$name: $failed_close{$name}\n"; 196 } 197 print "\n"; 198 } 199 200 if (scalar keys %transparencies) { 201 print "'Unable to perform statistics on transparencies' errors: " . ( scalar keys %transparencies ) . "\n"; 202 foreach my $name (keys %transparencies) { 203 print "$name: $transparencies{$name}\n"; 204 } 205 print "\n"; 206 } 207 208 if (scalar keys %couldnt_open_file) { 209 print "'Could not open file' errors: " . ( scalar keys %couldnt_open_file ) . "\n"; 210 foreach my $name (keys %couldnt_open_file) { 211 print "$name: $couldnt_open_file{$name}\n"; 212 } 213 print "\n"; 214 } 215 216 if (scalar keys %failed_read) { 217 print "'failed to read' errors: " . ( scalar keys %failed_read ) . "\n"; 218 foreach my $name (keys %failed_read) { 219 print "$name: $failed_read{$name}\n"; 220 } 221 print "\n"; 222 } 223 224 if (scalar keys %unknown) { 225 print "Unknown errors: " . ( scalar keys %unknown ) . "\n"; 226 foreach my $name (keys %unknown) { 227 print "$name: $unknown{$name}\n"; 228 } 229 print "\n"; 230 } 231 232 if (scalar keys %bad) { 233 print "Bad logs: " . ( scalar keys %bad ) . "\n"; 234 foreach my $name (keys %bad) { 235 print "$name: $bad{$name}\n"; 236 } 237 print "\n"; 238 }
Note:
See TracChangeset
for help on using the changeset viewer.
