2007-11-28 17:56:37 +01:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
while(<>) {
|
2008-01-08 09:07:23 +01:00
|
|
|
if(/^(\d+) (\d+) (\d+) \d+ \d+ \d+ \d+ \d+ \d+ (\d+) \d+ \d+ (\d+) (\d+) (\d+) (\d+) (\d+) \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ (\d+)/) {
|
|
|
|
$t = $1 - $10 / 4096;
|
|
|
|
|
|
|
|
$node{$2}{$t} = $_;
|
|
|
|
$lpm{$2}{$t} = $5;
|
|
|
|
$cpu{$2}{$t} = $6;
|
|
|
|
$rx{$2}{$t} = $7;
|
|
|
|
$tx{$2}{$t} = $8;
|
|
|
|
$rled{$2}{$t} = $9;
|
2007-11-28 17:56:37 +01:00
|
|
|
|
2008-01-08 09:07:23 +01:00
|
|
|
$totallpm{$2} = $5;
|
|
|
|
$totalcpu{$2} = $6;
|
|
|
|
$totalrx{$2} = $7;
|
|
|
|
$totaltx{$2} = $8;
|
|
|
|
$totalrled{$2} = $9;
|
|
|
|
|
|
|
|
$div = $t - $lasttime{$2};
|
|
|
|
if($lasttime{$2} > 0 && $div != 0 && $lastseqno{$2} != $3) {
|
|
|
|
$lpmpower{$2}{$t} = ($lpm{$2}{$t} - $lpm{$2}{$lasttime{$2}}) / $div;
|
|
|
|
$cpupower{$2}{$t} = ($cpu{$2}{$t} - $cpu{$2}{$lasttime{$2}}) / $div;
|
|
|
|
$rxpower{$2}{$t} = ($rx{$2}{$t} - $rx{$2}{$lasttime{$2}}) / $div;
|
|
|
|
$txpower{$2}{$t} = ($tx{$2}{$t} - $tx{$2}{$lasttime{$2}}) / $div;
|
|
|
|
$rledpower{$2}{$t} = ($rled{$2}{$t} - $rled{$2}{$lasttime{$2}}) / $div;
|
|
|
|
}
|
|
|
|
|
|
|
|
$lasttime{$2} = $t;
|
|
|
|
|
2007-11-28 17:56:37 +01:00
|
|
|
if($lastparent{$2} != $4) {
|
2008-01-08 09:07:23 +01:00
|
|
|
$parent{$2}{$t} = $4;
|
2007-11-28 17:56:37 +01:00
|
|
|
}
|
|
|
|
$lastparent{$2} = $4;
|
|
|
|
|
|
|
|
if($lastseqno{$2} == $3) {
|
2008-01-08 09:07:23 +01:00
|
|
|
$dup{$2}{$t} = 1;
|
|
|
|
}
|
|
|
|
if($lastseqno{$2} > $3 && $lastseqno{$2} > $3 + 256) {
|
|
|
|
print "Reordering at seqno $3 for node $2\n";
|
2007-11-28 17:56:37 +01:00
|
|
|
}
|
2008-01-08 09:07:23 +01:00
|
|
|
|
2007-11-28 17:56:37 +01:00
|
|
|
if(defined $lastseqno{$2} &&
|
|
|
|
$3 != ($lastseqno{$2} + 1 % 256)) {
|
2008-01-08 09:07:23 +01:00
|
|
|
$lost{$2}{$t} = 1;
|
2007-11-28 17:56:37 +01:00
|
|
|
}
|
|
|
|
$lastseqno{$2} = $3;
|
|
|
|
if($firsttime{$2} == 0) {
|
2008-01-08 09:07:23 +01:00
|
|
|
$firsttime{$2} = $t;
|
2007-11-28 17:56:37 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
open(F, "> power");
|
|
|
|
close(F);
|
|
|
|
|
|
|
|
foreach $n (sort {$a <=> $b} keys %node) {
|
|
|
|
# print "$n ";
|
|
|
|
open(F, "> data-$n");
|
|
|
|
foreach $k (sort keys %{$node{$n}}) {
|
|
|
|
print F $node{$n}{$k};
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
open(F, "> dup-data-$n");
|
|
|
|
foreach $k (sort keys %{$node{$n}}) {
|
|
|
|
if($dup{$n}{$k} == 1) {
|
|
|
|
print F "$k $dup{$n}{$k}\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
open(F, "> lost-data-$n");
|
|
|
|
foreach $k (sort keys %{$node{$n}}) {
|
|
|
|
if($lost{$n}{$k} == 1) {
|
|
|
|
print F "$k $lost{$n}{$k}\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
open(F, "> parent-data-$n");
|
|
|
|
foreach $k (sort keys %{$node{$n}}) {
|
|
|
|
if($parent{$n}{$k} != 0) {
|
|
|
|
print F "$k $parent{$n}{$k}\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(F);
|
2008-01-08 09:07:23 +01:00
|
|
|
open(F, "> power-data-$n");
|
|
|
|
foreach $k (sort keys %{$lpmpower{$n}}) {
|
|
|
|
print F "$k $lpmpower{$n}{$k} $cpupower{$n}{$k} $rxpower{$n}{$k} $txpower{$n}{$k} $rledpower{$n}{$k}\n";
|
|
|
|
}
|
|
|
|
close(F);
|
|
|
|
open(F, ">> total-power");
|
|
|
|
print F ($lasttime{$n} - $firsttime{$n}) . " $n $totallpm{$n} $totalcpu{$n} $totalrx{$n} $totaltx{$n} $totalrled{$n}\n";
|
2007-11-28 17:56:37 +01:00
|
|
|
close(F);
|
2008-01-08 09:07:23 +01:00
|
|
|
print "\n";
|
2007-11-28 17:56:37 +01:00
|
|
|
}
|
|
|
|
|