}
}
close DATAFILE;
- &check_data_file ( $datafile );
+ &check_data_file ( $datafile );
}
if ( !$ARGV[0] ) {
LABEL: while ( <PFILE> ) {
chomp;
@line = split( /\s+/ );
- if ($line[27] && $count != 0) {
+ # Remove the 'K' after rsz
+ $frsz = substr($line[3], 0, -1);
+ if ($line[28] && $count != 0) {
print "invalid file format\n";
- exit 1;
+ exit 1;
}
if ($count == 0) {
@GraphTitle = @line;
next LABEL;
}
}
- if (!$rsz && $line[3]) {
- $rsz = $line[3];
+ if (!$rsz && $frsz) {
+ $rsz = $frsz
}
- if ($rsz != $line[3]) {
+ if ($rsz != $frsz) {
if($readop) {
&write_dat_file("rd");
&write_scr_file("rd");
&write_dat_file("wr");
&write_scr_file("wr");
}
- $rsz = $line[3];
+ $rsz = substr($line[3],0,-1);;
$regions = "";
$threads = "";
}
- #print "rg$line[5] th$line[7] w$line[9] r$line[$rindex]\n";
- $rindex = 18;
+ $rindex = 20;
+ print "DEBUG rg$line[7] th$line[9] w$line[11] r$line[$rindex]\n";
if ($line[18]) {
- if ($line[10] eq "failed") {
- $rindex = 12;
+ if ($line[12] eq "failed") {
+ $rindex = 12;
}
- if ($line[8] eq "write" && $line[17] eq "read") {
+ if ($line[10] eq "write" && $line[19] eq "read") {
$wrrd = 1;
}
- if ($line[8] eq "read" && $line[17] eq "write") {
+ if ($line[10] eq "read" && $line[19] eq "write") {
$rdwr = 1;
}
} else {
- if ($line[8] eq "write" && $line[9]) {
+ if ($line[10] eq "write" && $line[11]) {
$writeop = 1;
}
- if ($line[8] eq "read" && $line[9]) {
+ if ($line[10] eq "read" && $line[11]) {
$readop = 1;
}
-
}
if ($wrrd || $rdwr) {
- $out{$line[7]}{$line[5]} = $line[9];
+ $out{$line[9]}{$line[7]} = $line[11];
if ($line[$rindex+1]) {
- if (!($line[$rindex+1] eq "failed")) {
- goto LABEL2;
+ if (!($line[$rindex+1] eq "failed")) {
+ goto LABEL2;
}
} else {
-LABEL2: if ($line[5] <= 1 ) {
- $out{$line[7]}{$line[5] - 1} = $line[$rindex];
+LABEL2: if ($line[7] <= 1 ) {
+ $out{$line[9]}{$line[7] - 1} = $line[$rindex];
} else {
- $out{$line[7]}{$line[5] + 1} = $line[$rindex];
+ $out{$line[9]}{$line[7] + 1} = $line[$rindex];
}
}
}
if ($writeop) {
- $out{$line[7]}{$line[5]} = $line[9];
+ $out{$line[9]}{$line[7]} = $line[11];
}
if ($readop) {
- $out{$line[7]}{$line[5]} = $line[9];
+ $out{$line[9]}{$line[7]} = $line[11];
}
- $regions .= " $line[5]" unless $regions =~ $line[5];
- $threads .= " $line[7]" unless $threads =~ $line[7];
+ $regions .= " $line[7]" unless $regions =~ $line[7];
+ $threads .= " $line[9]" unless $threads =~ $line[9];
$count++;
}
close PFILE;