wifi-diag: More whitespace changes.

No functional change.
This commit is contained in:
Ben Greear
2018-11-26 09:28:07 -08:00
parent bf519f57d9
commit bd1798505b

View File

@@ -318,14 +318,12 @@ sub htmlMcsHistogram {
if ($rx_pkts) { if ($rx_pkts) {
$html .= "RX Retransmit percentage: $rx_retrans_pkts/$rx_pkts == " . ($rx_retrans_pkts * 100.0) / $rx_pkts . "<br>\n"; $html .= "RX Retransmit percentage: $rx_retrans_pkts/$rx_pkts == " . ($rx_retrans_pkts * 100.0) / $rx_pkts . "<br>\n";
} } else {
else {
$html .= "RX Retransmit percentage: $rx_retrans_pkts/$rx_pkts == 0<br>\n"; $html .= "RX Retransmit percentage: $rx_retrans_pkts/$rx_pkts == 0<br>\n";
} }
if ($tx_pkts) { if ($tx_pkts) {
$html .= "TX Retransmit percentage: $tx_retrans_pkts/$tx_pkts == " . ($tx_retrans_pkts * 100.0) / $tx_pkts . "<br>\n"; $html .= "TX Retransmit percentage: $tx_retrans_pkts/$tx_pkts == " . ($tx_retrans_pkts * 100.0) / $tx_pkts . "<br>\n";
} } else {
else {
$html .= "TX Retransmit percentage: $tx_retrans_pkts/$tx_pkts == 0<br>\n"; $html .= "TX Retransmit percentage: $tx_retrans_pkts/$tx_pkts == 0<br>\n";
} }
@@ -485,16 +483,13 @@ sub processPkt {
if ($last_pkt->acked_by() != -1) { if ($last_pkt->acked_by() != -1) {
print "WARNING: ack frame: " . $pkt->frame_num() . " acking frame: " . print "WARNING: ack frame: " . $pkt->frame_num() . " acking frame: " .
$last_pkt->frame_num() . " already acked by frame: " . $last_pkt->acked_by() . "\n"; $last_pkt->frame_num() . " already acked by frame: " . $last_pkt->acked_by() . "\n";
} } elsif ($last_pkt->block_acked_by() != -1) {
elsif ($last_pkt->block_acked_by() != -1) {
print "WARNING: ack frame: " . $pkt->frame_num() . " acking frame: " . print "WARNING: ack frame: " . $pkt->frame_num() . " acking frame: " .
$last_pkt->frame_num() . " already block-acked by frame: " . $last_pkt->block_acked_by() . "\n"; $last_pkt->frame_num() . " already block-acked by frame: " . $last_pkt->block_acked_by() . "\n";
} } else {
else {
$last_pkt->set_acked_by($pkt->frame_num()); $last_pkt->set_acked_by($pkt->frame_num());
} }
} } else {
else {
print "ERROR: Frame " . $pkt->frame_num() . " is ACK for unknown packet.\n"; print "ERROR: Frame " . $pkt->frame_num() . " is ACK for unknown packet.\n";
$last_pkt = $pkt; $last_pkt = $pkt;
return; return;
@@ -522,20 +517,17 @@ sub processPkt {
my $peer_conn; my $peer_conn;
if (exists $peer_conns{$hash}) { if (exists $peer_conns{$hash}) {
$peer_conn = $peer_conns{$hash}; $peer_conn = $peer_conns{$hash};
} } else {
else {
if (exists $peer_conns{$hash2}) { if (exists $peer_conns{$hash2}) {
$peer_conn = $peer_conns{$hash2}; $peer_conn = $peer_conns{$hash2};
} } else {
else {
if ($dut eq $pkt->receiver()) { if ($dut eq $pkt->receiver()) {
$peer_conn = PeerConn->new(glb_fh_ba_tx => $glb_fh_ba_tx, $peer_conn = PeerConn->new(glb_fh_ba_tx => $glb_fh_ba_tx,
glb_fh_ba_rx => $glb_fh_ba_rx, glb_fh_ba_rx => $glb_fh_ba_rx,
report_prefix => $report_prefix, report_prefix => $report_prefix,
local_addr => $pkt->transmitter(), local_addr => $pkt->transmitter(),
peer_addr => $pkt->receiver()); peer_addr => $pkt->receiver());
} } else {
else {
$peer_conn = PeerConn->new(glb_fh_ba_tx => $glb_fh_ba_tx, $peer_conn = PeerConn->new(glb_fh_ba_tx => $glb_fh_ba_tx,
glb_fh_ba_rx => $glb_fh_ba_rx, glb_fh_ba_rx => $glb_fh_ba_rx,
report_prefix => $report_prefix, report_prefix => $report_prefix,
@@ -573,8 +565,7 @@ sub processPkt {
print "INFO: TX BA to RX AMPDU gap: $diff between frames: " . $last_ba_tx_pkt->frame_num() . " and: " . $pkt->frame_num() . "\n"; print "INFO: TX BA to RX AMPDU gap: $diff between frames: " . $last_ba_tx_pkt->frame_num() . " and: " . $pkt->frame_num() . "\n";
} }
$last_ba_tx_pkt->{frame_num} = -1; $last_ba_tx_pkt->{frame_num} = -1;
} } elsif ((!$pkt->{is_rx}) && ($last_ba_rx_pkt->frame_num() != -1)) {
elsif ((!$pkt->{is_rx}) && ($last_ba_rx_pkt->frame_num() != -1)) {
my $diff = $pkt->timestamp() - $last_ba_rx_pkt->timestamp(); my $diff = $pkt->timestamp() - $last_ba_rx_pkt->timestamp();
$ba_ampdu_gap_tx += $diff; $ba_ampdu_gap_tx += $diff;
$ba_ampdu_gap_tx_count++; $ba_ampdu_gap_tx_count++;
@@ -594,8 +585,7 @@ sub processPkt {
# Looks like we have a wrap. # Looks like we have a wrap.
$this_ampdu_pkt_count = 4096 - $first_ampdu_pkt->seqno(); $this_ampdu_pkt_count = 4096 - $first_ampdu_pkt->seqno();
$this_ampdu_pkt_count += $pkt->seqno(); $this_ampdu_pkt_count += $pkt->seqno();
} } else {
else {
$this_ampdu_pkt_count = $pkt->seqno() - $first_ampdu_pkt->seqno(); $this_ampdu_pkt_count = $pkt->seqno() - $first_ampdu_pkt->seqno();
$this_ampdu_pkt_count++; # range is inclusive $this_ampdu_pkt_count++; # range is inclusive
} }
@@ -606,20 +596,17 @@ sub processPkt {
. " chain-time: $ampdu_chain_time, chain-count: $this_ampdu_pkt_count.\n"; . " chain-time: $ampdu_chain_time, chain-count: $this_ampdu_pkt_count.\n";
$first_ampdu_pkt->{seqno} = -1; # Initialize to invalid again. $first_ampdu_pkt->{seqno} = -1; # Initialize to invalid again.
} }
} } else {
else {
# We must have not captured the last one, so skip accounting this one. # We must have not captured the last one, so skip accounting this one.
$first_ampdu_pkt->{seqno} = -1; # Initialize to invalid again. $first_ampdu_pkt->{seqno} = -1; # Initialize to invalid again.
} }
} } else {
else {
if (! $pkt->{is_last_ampdu}) { if (! $pkt->{is_last_ampdu}) {
$this_ampdu_pkt_count = 1; $this_ampdu_pkt_count = 1;
$first_ampdu_pkt = $pkt; $first_ampdu_pkt = $pkt;
} }
} }
} } else {
else {
# Not an ampdu frame # Not an ampdu frame
# One way or another, we are done with ampdu frame sequence, zero this out # One way or another, we are done with ampdu frame sequence, zero this out
# in case we didn't sniff the last one. # in case we didn't sniff the last one.
@@ -630,18 +617,15 @@ sub processPkt {
if ($pkt->{is_rx}) { if ($pkt->{is_rx}) {
if ($last_ba_rx_pkt->{frame_num} == -1) { if ($last_ba_rx_pkt->{frame_num} == -1) {
$last_ba_rx_pkt = $pkt; $last_ba_rx_pkt = $pkt;
} } else {
else {
print "NOTE: Multiple RX block-acks seen without ampdu between them, first BA frame: " . $last_ba_rx_pkt->frame_num() print "NOTE: Multiple RX block-acks seen without ampdu between them, first BA frame: " . $last_ba_rx_pkt->frame_num()
. " this BA frame num: " . $pkt->frame_num() . "\n"; . " this BA frame num: " . $pkt->frame_num() . "\n";
$dup_ba_rx++; $dup_ba_rx++;
} }
} } else {
else {
if ($last_ba_tx_pkt->{frame_num} == -1) { if ($last_ba_tx_pkt->{frame_num} == -1) {
$last_ba_tx_pkt = $pkt; $last_ba_tx_pkt = $pkt;
} } else {
else {
print "NOTE: Multiple TX block-acks seen without ampdu between them, first BA frame: " . $last_ba_rx_pkt->frame_num() print "NOTE: Multiple TX block-acks seen without ampdu between them, first BA frame: " . $last_ba_rx_pkt->frame_num()
. " this BA frame num: " . $pkt->frame_num() . "\n"; . " this BA frame num: " . $pkt->frame_num() . "\n";
$dup_ba_tx++; $dup_ba_tx++;
@@ -665,23 +649,20 @@ sub processPkt {
if (exists $glb_ampdu_pkt_count_rx_hash{$this_ampdu_pkt_count}) { if (exists $glb_ampdu_pkt_count_rx_hash{$this_ampdu_pkt_count}) {
$glb_ampdu_pkt_count_rx_hash{$this_ampdu_pkt_count}++; $glb_ampdu_pkt_count_rx_hash{$this_ampdu_pkt_count}++;
} } else {
else {
$glb_ampdu_pkt_count_rx_hash{$this_ampdu_pkt_count} = 1; $glb_ampdu_pkt_count_rx_hash{$this_ampdu_pkt_count} = 1;
} }
} }
if (exists $glb_mcs_rx_hash{$dr}) { if (exists $glb_mcs_rx_hash{$dr}) {
$glb_mcs_rx_hash{$dr}++; $glb_mcs_rx_hash{$dr}++;
} } else {
else {
$glb_mcs_rx_hash{$dr} = 1; $glb_mcs_rx_hash{$dr} = 1;
} }
$dr = $pkt->type_subtype() . $pkt->{priority}; $dr = $pkt->type_subtype() . $pkt->{priority};
if (exists $glb_pkt_type_rx_hash{$dr}) { if (exists $glb_pkt_type_rx_hash{$dr}) {
$glb_pkt_type_rx_hash{$dr}++; $glb_pkt_type_rx_hash{$dr}++;
} } else {
else {
$glb_pkt_type_rx_hash{$dr} = 1; $glb_pkt_type_rx_hash{$dr} = 1;
} }
$rx_pkts++; $rx_pkts++;
@@ -696,8 +677,7 @@ sub processPkt {
$ln = "" . $pkt->timestamp() . "\t" . $pkt->retrans() . "\n"; $ln = "" . $pkt->timestamp() . "\t" . $pkt->retrans() . "\n";
print $glb_fh_rtx_rx $ln; print $glb_fh_rtx_rx $ln;
} }
} } else {
else {
if ($delta != -1) { if ($delta != -1) {
$delta_time_tx_count++; $delta_time_tx_count++;
$delta_time_tx += $delta; $delta_time_tx += $delta;
@@ -710,23 +690,20 @@ sub processPkt {
if (exists $glb_ampdu_pkt_count_tx_hash{$this_ampdu_pkt_count}) { if (exists $glb_ampdu_pkt_count_tx_hash{$this_ampdu_pkt_count}) {
$glb_ampdu_pkt_count_tx_hash{$this_ampdu_pkt_count}++; $glb_ampdu_pkt_count_tx_hash{$this_ampdu_pkt_count}++;
} } else {
else {
$glb_ampdu_pkt_count_tx_hash{$this_ampdu_pkt_count} = 1; $glb_ampdu_pkt_count_tx_hash{$this_ampdu_pkt_count} = 1;
} }
} }
if (exists $glb_mcs_tx_hash{$dr}) { if (exists $glb_mcs_tx_hash{$dr}) {
$glb_mcs_tx_hash{$dr}++; $glb_mcs_tx_hash{$dr}++;
} } else {
else {
$glb_mcs_tx_hash{$dr} = 1; $glb_mcs_tx_hash{$dr} = 1;
} }
$dr = $pkt->type_subtype() . $pkt->{priority}; $dr = $pkt->type_subtype() . $pkt->{priority};
if (exists $glb_pkt_type_tx_hash{$dr}) { if (exists $glb_pkt_type_tx_hash{$dr}) {
$glb_pkt_type_tx_hash{$dr}++; $glb_pkt_type_tx_hash{$dr}++;
} } else {
else {
$glb_pkt_type_tx_hash{$dr} = 1; $glb_pkt_type_tx_hash{$dr} = 1;
} }
$tx_pkts++; $tx_pkts++;