svn commit: r361009 - head/tools/tools/ath/athratestats

Adrian Chadd adrian at FreeBSD.org
Wed May 13 16:36:43 UTC 2020


Author: adrian
Date: Wed May 13 16:36:42 2020
New Revision: 361009
URL: https://svnweb.freebsd.org/changeset/base/361009

Log:
  [ath] Prepare for .. more sample rate control entries
  
  This is in preparation for me bumping how many size buckets are used
  for ath_rate_sample statistics.
  
  * Bump buffer size to 64k
  * Don't waste 4 lines per bucket size, condense it to two
  * Alternate colours; my logic made everything after the first two just
    be black.  Oops.

Modified:
  head/tools/tools/ath/athratestats/main.c

Modified: head/tools/tools/ath/athratestats/main.c
==============================================================================
--- head/tools/tools/ath/athratestats/main.c	Wed May 13 12:33:51 2020	(r361008)
+++ head/tools/tools/ath/athratestats/main.c	Wed May 13 16:36:42 2020	(r361009)
@@ -64,7 +64,7 @@ static int do_loop = 0;
  * This needs to be big enough to fit the two TLVs, the rate table
  * and the rate statistics table for a single node.
  */
-#define	STATS_BUF_SIZE	8192
+#define	STATS_BUF_SIZE	65536
 
 #define	PRINTMSG(...) do {			\
 	if (do_loop == 0)			\
@@ -122,24 +122,23 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r
 	    (long long) sn->ratemask);
 
 	for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) {
-		PRINTATTR_ON(COLOR_PAIR(y+4) | A_BOLD);
+		PRINTATTR_ON(COLOR_PAIR(4 + (y % 2)) | A_BOLD);
 		PRINTMSG("[%4u] cur rate %d %s since switch: "
-		    "packets %d ticks %u\n",
+		    "packets %d ticks %u ",
 		    bin_to_size(y),
 		    dot11rate(rt, sn->current_rix[y]),
 		    dot11str(rt, sn->current_rix[y]),
 		    sn->packets_since_switch[y],
 		    sn->ticks_since_switch[y]);
 
-		PRINTMSG("[%4u] last sample (%d %s) cur sample (%d %s) "
+		PRINTMSG("last sample (%d %s) cur sample (%d %s) "
 		    "packets sent %d\n",
-		    bin_to_size(y),
 		    dot11rate(rt, sn->last_sample_rix[y]),
 		    dot11str(rt, sn->last_sample_rix[y]),
 		    dot11rate(rt, sn->current_sample_rix[y]),
 		    dot11str(rt, sn->current_sample_rix[y]),
 		    sn->packets_sent[y]);
-		PRINTATTR_OFF(COLOR_PAIR(y+4) | A_BOLD);
+		PRINTATTR_OFF(COLOR_PAIR(4 + (y % 2)) | A_BOLD);
 		
 		PRINTATTR_ON(COLOR_PAIR(3) | A_BOLD);
 		PRINTMSG("[%4u] packets since sample %d sample tt %u\n",
@@ -147,7 +146,6 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r
 		    sn->packets_since_sample[y],
 		    sn->sample_tt[y]);
 		PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD);
-		PRINTMSG("\n");
 	}
 	PRINTMSG("   TX Rate     TXTOTAL:TXOK       EWMA          T/   F"
 	    "     avg last xmit\n");


More information about the svn-src-all mailing list