2006-09-30 00:33:28 +02:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
my %count = ();
|
|
|
|
my $more = 0;
|
|
|
|
my $last = "";
|
|
|
|
|
|
|
|
while (<>) {
|
|
|
|
if ($more) {
|
2006-09-30 00:33:31 +02:00
|
|
|
if (/LD_BUG/) {
|
|
|
|
$more = 0;
|
|
|
|
next;
|
|
|
|
}
|
|
|
|
if (/\"((?:[^\"\\]+|\\.*)+)\"(.*)/) {
|
2006-09-30 00:33:28 +02:00
|
|
|
$last .= $1;
|
|
|
|
if ($2 !~ /[,\)]/) {
|
|
|
|
$more = 1;
|
|
|
|
} else {
|
2006-09-30 00:33:31 +02:00
|
|
|
$count{lc $last}++;
|
2006-09-30 00:33:28 +02:00
|
|
|
$more = 0;
|
|
|
|
}
|
|
|
|
} elsif (/[,\)]/) {
|
2006-09-30 00:33:31 +02:00
|
|
|
$count{lc $last}++;
|
2006-09-30 00:33:28 +02:00
|
|
|
$more = 0;
|
|
|
|
} elsif ($more == 2) {
|
|
|
|
print "SKIPPED more\n";
|
|
|
|
}
|
2006-09-30 00:33:31 +02:00
|
|
|
} elsif (/log_(?:warn|err|notice)\(\s*(LD_[A-Z_]*)\s*,\s*\"((?:[^\"\\]+|\\.)*)\"(.*)/) {
|
|
|
|
next if ($1 eq 'LD_BUG');
|
|
|
|
my $s = $2;
|
|
|
|
if ($3 =~ /[,\)]/ ) {
|
|
|
|
$count{lc $s}++;
|
2006-09-30 00:33:28 +02:00
|
|
|
} else {
|
|
|
|
$more = 1;
|
|
|
|
$last = $s;
|
|
|
|
}
|
2006-09-30 00:33:31 +02:00
|
|
|
} elsif (/log_(?:warn|err|notice)\(\s*((?:LD_[A-Z_]*)?)(.*)/) {
|
|
|
|
next if ($1 eq 'LD_BUG');
|
|
|
|
my $extra = $2;
|
2006-09-30 00:33:28 +02:00
|
|
|
chomp $extra;
|
|
|
|
$last = "";
|
|
|
|
$more = 2 if ($extra eq '');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
while ((my $phrase, my $count) = each %count) {
|
|
|
|
if ($count > 1) {
|
|
|
|
print "$count\t$phrase\n";
|
|
|
|
}
|
|
|
|
}
|