Tidy up the output quite substantially, making it fit well within

80 columns.

This makes it much easier to use in a shell script, to display a "top"
style output with live rate control data.
This commit is contained in:
Adrian Chadd 2012-09-07 06:02:40 +00:00
parent cbbbd0fa7f
commit 3ed3dcb676
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240184

View File

@ -123,21 +123,21 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_rateioctl_rt *rt,
sn->packets_since_sample[y],
sn->sample_tt[y]);
}
printf(" TX Rate TXTOTAL:TXOK EWMA T/ F"
" avg last xmit\n");
for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) {
if ((mask & 1) == 0)
continue;
for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) {
if (sn->stats[y][rix].total_packets == 0)
continue;
printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) "
"(EWMA %3d.%1d%%) T %8ju F %4d avg %5u last %u\n",
printf("[%2u %s:%4u] %8ju:%-8ju "
"(%3d.%1d%%) %8ju/%4d %5ums %u\n",
dot11rate(rt, rix),
dot11str(rt, rix),
bin_to_size(y),
(uintmax_t) sn->stats[y][rix].total_packets,
(uintmax_t) sn->stats[y][rix].packets_acked,
(int) ((sn->stats[y][rix].packets_acked * 100ULL) /
sn->stats[y][rix].total_packets),
sn->stats[y][rix].ewma_pct / 10,
sn->stats[y][rix].ewma_pct % 10,
(uintmax_t) sn->stats[y][rix].tries,