From 2a716b133db829e5c240983a79c86b5dea07a46a Mon Sep 17 00:00:00 2001 From: n1481 Date: Fri, 2 Dec 2011 08:25:11 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=83=83=E3=82=AF=E3=82=A2=E3=83=83?= =?UTF-8?q?=E3=83=97=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=81=AE=E4=BD=8D=E7=BD=AE=E3=81=8C=E3=82=BA=E3=83=AC=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=8C=E3=81=82=E3=82=8B=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=81=20=E9=9D=9E?= =?UTF-8?q?=E6=AD=A3=E8=A6=8F=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AB?= =?UTF-8?q?=E3=82=88=E3=82=8B=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=82=92?= =?UTF-8?q?=E6=A4=9C=E5=87=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=80=81=20=E6=9C=80=E5=BE=8C=E3=81=AE?= =?UTF-8?q?=E6=AD=A3=E8=A6=8FROM=E3=83=AA=E3=83=BC=E3=83=89=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=AD=E3=82=B0=E3=81=AE=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E3=81=8C=E3=82=BA=E3=83=AC=E3=82=8B=E3=81=93=E3=81=A8=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@578 7061adef-622a-194b-ae81-725974e89856 --- .../AccessLogConverter/read_command_text.pl | 40 +++++++++++++++---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/build/tools/AccessLogConverter/read_command_text.pl b/build/tools/AccessLogConverter/read_command_text.pl index c2b832e..ca016a8 100755 --- a/build/tools/AccessLogConverter/read_command_text.pl +++ b/build/tools/AccessLogConverter/read_command_text.pl @@ -14,11 +14,22 @@ my $addr = 0; my $bkup = 0; +my $line = 0; +my $readcount = 0; + while () { my @data = split /\t/; + $line++; # pre-read if ( $step == 0 ) { - $step = 1 if ( $data[2] == 1 && $data[3] == 1 ); + if ( $data[2] == 1 && $data[3] == 1 ) + { + $step = 1; + if ( $bkup == 1 ) { + print "<>\n" ; + $bkup = 0; + } + } # backup access if ( $data[2] == 1 && $data[3] == 0 ) { @@ -27,10 +38,18 @@ while () { } # read elsif ( $step == 1 ) { - if ( $data[4] =~ /B7/ ) { + if ( hex($data[4]) == 0xB7 ) { $step++; $addr = 0; # initialize + $readcount++; +# printf "READ COMMAND 0x%02x\n", hex($data[4]); } else { + if( hex($data[4]) != 0xB8 ) { # IDƒŠ[ƒh + printf "<>\n", hex($data[4]); + printf "Read: 0x%08x-0x%08x (%6d bytes)\n", $start, $start+$size-1, $size if ($start); + $start = 0; + $size = 0; + } $step = 0; # restart } } @@ -38,17 +57,22 @@ while () { elsif ( $step == 2 || $step == 3 || $step == 4 || $step == 5 ) { $addr = $addr*256 + hex($data[4]); if ( $step == 5 ) { - if ( $start + $size == $addr && $bkup == 0 ) { + if ( $start + $size == $addr) { $size += 512; } else { printf "Read: 0x%08x-0x%08x (%6d bytes)\n", $start, $start+$size-1, $size if ($start); $start = $addr; $size = 512; - if ( $bkup == 1 ) { - print "<>\n" ; - $bkup = 0; - } } +# $step = 0; # restart + } else { +# $step++; + } + $step++; + } + # dummy access + elsif ( $step == 6 || $step == 7 || $step == 8) { + if ( $step == 8 ) { $step = 0; # restart } else { $step++; @@ -59,7 +83,7 @@ close IN; if ($start) { printf "Read: 0x%08x-0x%08x (%6d bytes)\n", $start, $start+$size-1, $size -} else { +} elsif ($readcount == 0) { printf "Never read.\n"; } if ( $bkup == 1 ) {