Author: Gawain
#!/bin/perl
$arg_num = @ARGV;
if($arg_num != 1) {
die("Open file failed.\n");
}
if(!open(input_fp, $ARGV[0]) ) {
die("Open file $ARGV[0] failed.\n");
}
while( $line = <input_fp> ) {
if( $line =~ "-> ASGN_PEND_2PHASE"
|| $line =~ "-> ASGN_PEND_1PHASE") {
$num_ul_tbfs ++;
if( $num_ul_tbfs > $max_ul_tbfs ) {
$max_ul_tbfs = $num_ul_tbfs;
}
if($num_ul_tbfs == 19) {
print "##19: $line";
}
} elsif ($line =~ "-> IDLE" && $num_ul_tbfs>0) {
$num_ul_tbfs --;
if($num_ul_tbfs == 0) {
print "##0: $line";
}
}
}
print "num_ul_tbfs=$num_ul_tbfs, max_ul_tbfs=$max_ul_tbfs\n";