Commit e161f7f6 authored by Thomas Huehn's avatar Thomas Huehn Committed by Johannes Berg

mac80211: enhance readability of Minstrels rc_stats output

This patch restructures the rc_stats debugfs table of Minstrel in
order to achieve better human readability. A new layout of the
statistics and a new header is added. In addition to the old layout
there are two new columns of information added:
idx	- representing the rate index of each rate in mac80211 which
	  can be used to set specific rates as fixed rate via debugfs
airtime - the tx-time in micro seconds that a 1200 Byte packet
	  takes to be transmitted over the air at the given rate

The old layout of rc_stats:

    rate      tpt  eprob *prob ret  *ok(*cum)        ok(      cum)
 DP 1          0.9  93.5 100.0   1    0(   0)         2(        2)
    2          0.4  40.0 100.0   0    0(   0)         4(        10)
    5.5        0.0   0.0   0.0   0    0(   0)         0(        0)
...

is changed into this new layout:

best   _______rate_____    __statistics__    ________last_______    ______sum-of________
rate  [name idx tx-time]  [ ø(tp) ø(prob)]  [prob.|retry|suc|att]  [#success | #attempts]
 DP   1     0     9738      0.9    93.5     100.0   1     1 1             2   2
      2     1     4922      0.4    40.0     100.0   1     0 0             4   10
      5.5   2     1858      0.0     0.0       0.0   2     0 0             0   0
...
Signed-off-by: default avatarThomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: default avatarStefan Venz <ikstream86@gmail.com>
Acked-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c37722bd
...@@ -68,8 +68,12 @@ minstrel_stats_open(struct inode *inode, struct file *file) ...@@ -68,8 +68,12 @@ minstrel_stats_open(struct inode *inode, struct file *file)
file->private_data = ms; file->private_data = ms;
p = ms->buf; p = ms->buf;
p += sprintf(p, "rate tpt eprob *prob" p += sprintf(p, "\n");
" *ok(*cum) ok( cum)\n"); p += sprintf(p, "best _______rate_____ __statistics__ "
"________last_______ ______sum-of________\n");
p += sprintf(p, "rate [name idx airtime] [ ø(tp) ø(prob)] "
"[prob.|retry|suc|att] [#success | #attempts]\n");
for (i = 0; i < mi->n_rates; i++) { for (i = 0; i < mi->n_rates; i++) {
struct minstrel_rate *mr = &mi->r[i]; struct minstrel_rate *mr = &mi->r[i];
struct minstrel_rate_stats *mrs = &mi->r[i].stats; struct minstrel_rate_stats *mrs = &mi->r[i].stats;
...@@ -79,18 +83,22 @@ minstrel_stats_open(struct inode *inode, struct file *file) ...@@ -79,18 +83,22 @@ minstrel_stats_open(struct inode *inode, struct file *file)
*(p++) = (i == mi->max_tp_rate[2]) ? 'C' : ' '; *(p++) = (i == mi->max_tp_rate[2]) ? 'C' : ' ';
*(p++) = (i == mi->max_tp_rate[3]) ? 'D' : ' '; *(p++) = (i == mi->max_tp_rate[3]) ? 'D' : ' ';
*(p++) = (i == mi->max_prob_rate) ? 'P' : ' '; *(p++) = (i == mi->max_prob_rate) ? 'P' : ' ';
p += sprintf(p, "%3u%s", mr->bitrate / 2,
p += sprintf(p, " %3u%s ", mr->bitrate / 2,
(mr->bitrate & 1 ? ".5" : " ")); (mr->bitrate & 1 ? ".5" : " "));
p += sprintf(p, "%3u ", i);
p += sprintf(p, "%6u ", mr->perfect_tx_time);
tp = MINSTREL_TRUNC(mrs->cur_tp / 10); tp = MINSTREL_TRUNC(mrs->cur_tp / 10);
prob = MINSTREL_TRUNC(mrs->cur_prob * 1000); prob = MINSTREL_TRUNC(mrs->cur_prob * 1000);
eprob = MINSTREL_TRUNC(mrs->probability * 1000); eprob = MINSTREL_TRUNC(mrs->probability * 1000);
p += sprintf(p, " %4u.%1u %3u.%1u %3u.%1u" p += sprintf(p, " %4u.%1u %3u.%1u %3u.%1u %3u"
" %4u(%4u) %9llu(%9llu)\n", " %3u %-3u %9llu %-9llu\n",
tp / 10, tp % 10, tp / 10, tp % 10,
eprob / 10, eprob % 10, eprob / 10, eprob % 10,
prob / 10, prob % 10, prob / 10, prob % 10,
mrs->retry_count,
mrs->last_success, mrs->last_success,
mrs->last_attempts, mrs->last_attempts,
(unsigned long long)mrs->succ_hist, (unsigned long long)mrs->succ_hist,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment