mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
wifi-diag: Parse sub-type for trigger frames.
And add in BSS color graphs. Report ack-but-not-captured in the rx pkt type histograms. Signed-off-by: Ben Greear <greearb@candelatech.com>
This commit is contained in:
@@ -41,6 +41,8 @@ sub new {
|
||||
ssi_sig_found => 0,
|
||||
ba_bitmap => "0000000000000000", # empty bitmap
|
||||
ba_starting_seq => 0, # needs to be initialized
|
||||
bss_color => 0,
|
||||
bss_color_known => 0,
|
||||
};
|
||||
|
||||
bless($self, $class);
|
||||
@@ -104,6 +106,12 @@ sub append {
|
||||
elsif ($ln =~ /^.* = This is the last subframe of this A-MPDU: True/) {
|
||||
$self->{is_last_ampdu} = 1;
|
||||
}
|
||||
elsif ($ln =~ /^.* = BSS Color known: Known/) {
|
||||
$self->{bss_color_known} = 1;
|
||||
}
|
||||
elsif ($ln =~ /^.* = BSS Color: (\S+)/) {
|
||||
$self->{bss_color} = hex($1);
|
||||
}
|
||||
elsif ($ln =~ /^.* = Priority: (.*) \(.*/) {
|
||||
$self->{priority} = " $1";
|
||||
}
|
||||
@@ -130,6 +138,10 @@ sub append {
|
||||
elsif ($ln =~ /^\s*Type\/Subtype: (.*)/) {
|
||||
$self->{type_subtype} = $1;
|
||||
}
|
||||
elsif ($ln =~ /.* = (Trigger Type: .*)/) {
|
||||
# Differentiate some special subtypes.
|
||||
$self->{type_subtype} = $1;
|
||||
}
|
||||
elsif ($ln =~ /.* = Starting Sequence Number: (\d+)/) {
|
||||
$self->{ba_starting_seq} = $1;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ my $glb_fh_mcs_tx;
|
||||
my $glb_fh_mcs_rx;
|
||||
my $glb_fh_rtx_tx;
|
||||
my $glb_fh_rtx_rx;
|
||||
my $glb_fh_color_tx;
|
||||
my $glb_fh_color_rx;
|
||||
|
||||
my $tx_no_ack_found_big = 0;
|
||||
my $rx_no_ack_found_big = 0;
|
||||
@@ -109,6 +111,8 @@ my $glb_mcs_tx_fname = $::report_prefix . "glb-mcs-tx-rpt.txt";
|
||||
my $glb_mcs_rx_fname = $::report_prefix . "glb-mcs-rx-rpt.txt";
|
||||
my $glb_rtx_tx_fname = $::report_prefix . "glb-rtx-tx-rpt.txt";
|
||||
my $glb_rtx_rx_fname = $::report_prefix . "glb-rtx-rx-rpt.txt";
|
||||
my $glb_color_rx_fname = $::report_prefix . "glb-color-rx-rpt.txt";
|
||||
my $glb_color_tx_fname = $::report_prefix . "glb-color-tx-rpt.txt";
|
||||
|
||||
if ($gen_report) {
|
||||
$report_html .= genGlobalReports();
|
||||
@@ -125,6 +129,8 @@ open($glb_fh_mcs_tx, ">", $glb_mcs_tx_fname) or die("Can't open $glb_mcs_tx_fnam
|
||||
open($glb_fh_mcs_rx, ">", $glb_mcs_rx_fname) or die("Can't open $glb_mcs_rx_fname for writing: $!\n");
|
||||
open($glb_fh_rtx_tx, ">", $glb_rtx_tx_fname) or die("Can't open $glb_rtx_tx_fname for writing: $!\n");
|
||||
open($glb_fh_rtx_rx, ">", $glb_rtx_rx_fname) or die("Can't open $glb_rtx_rx_fname for writing: $!\n");
|
||||
open($glb_fh_color_rx, ">", $glb_color_rx_fname) or die("Can't open $glb_color_rx_fname for writing: $!\n");
|
||||
open($glb_fh_color_tx, ">", $glb_color_tx_fname) or die("Can't open $glb_color_tx_fname for writing: $!\n");
|
||||
|
||||
my $hdr = "#timestamp\ttid\ttime_diff\tperiod_tot_pkts_ps\t" .
|
||||
"period_rx_pkts_ps\tperiod_rx_retrans_pkts_ps\tperiod_rx_amsdu_pkts_ps\tperiod_rx_retrans_amsdu_pkts_ps\tperiod_dummy_rx_pkts_ps\t" .
|
||||
@@ -409,8 +415,11 @@ sub htmlMcsHistogram {
|
||||
$html .= "<h4>RX Packet Type histogram</h4>\n
|
||||
<table $html_table_border><tr><th>Type</th><th>Packets</th><th>Percentage</th></tr>";
|
||||
foreach my $name (sort keys %glb_pkt_type_rx_hash) {
|
||||
$html .= sprintf(qq(<tr><td>%s</td><td class="ar">%s</td><td class="ar">%f</td></tr>\n), $name, $glb_pkt_type_rx_hash{$name}, ($glb_pkt_type_rx_hash{$name} * 100.0) / $rx_pkts);
|
||||
$html .= sprintf(qq(<tr><td>%s</td><td class="ar">%s</td><td class="ar">%f</td></tr>\n),
|
||||
$name, $glb_pkt_type_rx_hash{$name}, ($glb_pkt_type_rx_hash{$name} * 100.0) / ($rx_pkts + $dummy_rx_pkts));
|
||||
}
|
||||
$html .= sprintf(qq(<tr><td>ACK but not Captured</td><td class="ar">%d</td><td class="ar">%f</td></tr>\n),
|
||||
$dummy_rx_pkts, ($dummy_rx_pkts * 100.0) / ($rx_pkts + $dummy_rx_pkts));
|
||||
$html .= "</table><P>\n";
|
||||
|
||||
if ($ampdu_chain_tx_count) {
|
||||
@@ -460,6 +469,9 @@ sub genGlobalReports {
|
||||
$html .= doTimeGraph("TX-retrans-amsdu-pps", "TX Retrans AMSDU per sec", "1:13", $glb_mcs_ps_fname, "glb-mcs-tx-rtx-amsdu-ps.png");
|
||||
$html .= doTimeGraph("TX-dummy pps", "TX Dummy Packets per sec", "1:14", $glb_mcs_ps_fname, "glb-mcs-tx-dummy-pps.png");
|
||||
|
||||
$html .= doTimeGraph("BSS Color", "RX BSS Color over time", "1:2", $glb_color_rx_fname, "glb-color-rx.png");
|
||||
$html .= doTimeGraph("BSS Color", "TX BSS Color over time", "1:2", $glb_color_tx_fname, "glb-color-tx.png");
|
||||
|
||||
# Local peer sending BA back to DUT
|
||||
$html .= "\n\n<P>Block-Acks sent from all local endpoints to DUT.<P>\n";
|
||||
$html .= doTimeGraph("BA Latency", "TX Block-Ack latency from last known frame", "1:6", $glb_ba_tx_fname, "glb-ba-tx-latency.png");
|
||||
@@ -725,6 +737,10 @@ sub processPkt {
|
||||
}
|
||||
my $ln = "" . $pkt->timestamp() . "\t" . $pkt->datarate() . "\n";
|
||||
print $glb_fh_mcs_rx $ln;
|
||||
if ($pkt->{bss_color_known}) {
|
||||
$ln = "" . $pkt->timestamp() . "\t" . $pkt->{bss_color} . "\n";
|
||||
print $glb_fh_color_rx $ln;
|
||||
}
|
||||
if ($pkt->retrans()) {
|
||||
$ln = "" . $pkt->timestamp() . "\t" . $pkt->retrans() . "\n";
|
||||
print $glb_fh_rtx_rx $ln;
|
||||
@@ -773,6 +789,10 @@ sub processPkt {
|
||||
}
|
||||
my $ln = "" . $pkt->timestamp() . "\t" . $pkt->datarate() . "\n";
|
||||
print $glb_fh_mcs_tx $ln;
|
||||
if ($pkt->{bss_color_known}) {
|
||||
$ln = "" . $pkt->timestamp() . "\t" . $pkt->{bss_color} . "\n";
|
||||
print $glb_fh_color_tx $ln;
|
||||
}
|
||||
if ($pkt->retrans()) {
|
||||
$ln = "" . $pkt->timestamp() . "\t" . $pkt->retrans() . "\n";
|
||||
print $glb_fh_rtx_tx $ln;
|
||||
|
||||
Reference in New Issue
Block a user