modseq_check.pl
757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl
#
@check_sequence = (
"io_mon.*removed",
"0x00000032",
"io_mon.*inserted",
"io_mon.*removed",
"0x00000034",
"io_mon.*inserted"
);
$indx = 0;
open(logfile, "@ARGV[0]") || die "Cannot open log file @ARGV[0].\n";
while (($indx <= $#check_sequence) && ($line = <logfile>)) {
if (($line =~ /@ARGV[1]/) && ($line =~ /cbus/)) {
$checkline = 1;
}
elsif ($checkline == 1){
if (@check_sequence[$indx] =~ /0x/
&& $line =~ /@check_sequence[$indx]/) {
$indx += 1;
}
$checkline = 0;
}
if (@check_sequence[$indx] =~ /io_mon/
&& $line =~ /@check_sequence[$indx]/) {
$indx += 1;
}
}
close(logfile);
if ($indx == ($#check_sequence + 1)) {
exit(0);
}
exit(1);