aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_sta.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-02-25 04:03:25 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-02-28 15:31:11 -0500
commitabfbc3af57b1b92ff976ce7f1c776c169d14ed8a (patch)
tree43e22cfdcdda1c832350f031460418972f226866 /net/mac80211/debugfs_sta.c
parent31f909a2c0abfc1a1a76b2981d28ac85d33210e7 (diff)
mac80211: remove TX latency measurement code
Revert commit ad38bfc916da ("mac80211: Tx frame latency statistics") (along with some follow-up fixes). This code turned out not to be as useful in the current form as we thought, and we've internally hacked it up more, but that's not very suitable for upstream (for now), and we might just do that with tracing instead. Therefore, for now at least, remove this code. We might also need to use the skb->tstamp field for the TCP performance issue, which is more important than the debugging. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r--net/mac80211/debugfs_sta.c134
1 files changed, 0 insertions, 134 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 94c70091bbd7..252859e90e8a 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -39,13 +39,6 @@ static const struct file_operations sta_ ##name## _ops = { \
39 .llseek = generic_file_llseek, \ 39 .llseek = generic_file_llseek, \
40} 40}
41 41
42#define STA_OPS_W(name) \
43static const struct file_operations sta_ ##name## _ops = { \
44 .write = sta_##name##_write, \
45 .open = simple_open, \
46 .llseek = generic_file_llseek, \
47}
48
49#define STA_OPS_RW(name) \ 42#define STA_OPS_RW(name) \
50static const struct file_operations sta_ ##name## _ops = { \ 43static const struct file_operations sta_ ##name## _ops = { \
51 .read = sta_##name##_read, \ 44 .read = sta_##name##_read, \
@@ -398,131 +391,6 @@ static ssize_t sta_last_rx_rate_read(struct file *file, char __user *userbuf,
398} 391}
399STA_OPS(last_rx_rate); 392STA_OPS(last_rx_rate);
400 393
401static int
402sta_tx_latency_stat_header(struct ieee80211_tx_latency_bin_ranges *tx_latency,
403 char *buf, int pos, int bufsz)
404{
405 int i;
406 int range_count = tx_latency->n_ranges;
407 u32 *bin_ranges = tx_latency->ranges;
408
409 pos += scnprintf(buf + pos, bufsz - pos,
410 "Station\t\t\tTID\tMax\tAvg");
411 if (range_count) {
412 pos += scnprintf(buf + pos, bufsz - pos,
413 "\t<=%d", bin_ranges[0]);
414 for (i = 0; i < range_count - 1; i++)
415 pos += scnprintf(buf + pos, bufsz - pos, "\t%d-%d",
416 bin_ranges[i], bin_ranges[i+1]);
417 pos += scnprintf(buf + pos, bufsz - pos,
418 "\t%d<", bin_ranges[range_count - 1]);
419 }
420
421 pos += scnprintf(buf + pos, bufsz - pos, "\n");
422
423 return pos;
424}
425
426static int
427sta_tx_latency_stat_table(struct ieee80211_tx_latency_bin_ranges *tx_lat_range,
428 struct ieee80211_tx_latency_stat *tx_lat,
429 char *buf, int pos, int bufsz, int tid)
430{
431 u32 avg = 0;
432 int j;
433 int bin_count = tx_lat->bin_count;
434
435 pos += scnprintf(buf + pos, bufsz - pos, "\t\t\t%d", tid);
436 /* make sure you don't divide in 0 */
437 if (tx_lat->counter)
438 avg = tx_lat->sum / tx_lat->counter;
439
440 pos += scnprintf(buf + pos, bufsz - pos, "\t%d\t%d",
441 tx_lat->max, avg);
442
443 if (tx_lat_range->n_ranges && tx_lat->bins)
444 for (j = 0; j < bin_count; j++)
445 pos += scnprintf(buf + pos, bufsz - pos,
446 "\t%d", tx_lat->bins[j]);
447 pos += scnprintf(buf + pos, bufsz - pos, "\n");
448
449 return pos;
450}
451
452/*
453 * Output Tx latency statistics station && restart all statistics information
454 */
455static ssize_t sta_tx_latency_stat_read(struct file *file,
456 char __user *userbuf,
457 size_t count, loff_t *ppos)
458{
459 struct sta_info *sta = file->private_data;
460 struct ieee80211_local *local = sta->local;
461 struct ieee80211_tx_latency_bin_ranges *tx_latency;
462 char *buf;
463 int bufsz, ret, i;
464 int pos = 0;
465
466 bufsz = 20 * IEEE80211_NUM_TIDS *
467 sizeof(struct ieee80211_tx_latency_stat);
468 buf = kzalloc(bufsz, GFP_KERNEL);
469 if (!buf)
470 return -ENOMEM;
471
472 rcu_read_lock();
473
474 tx_latency = rcu_dereference(local->tx_latency);
475
476 if (!sta->tx_lat) {
477 pos += scnprintf(buf + pos, bufsz - pos,
478 "Tx latency statistics are not enabled\n");
479 goto unlock;
480 }
481
482 pos = sta_tx_latency_stat_header(tx_latency, buf, pos, bufsz);
483
484 pos += scnprintf(buf + pos, bufsz - pos, "%pM\n", sta->sta.addr);
485 for (i = 0; i < IEEE80211_NUM_TIDS; i++)
486 pos = sta_tx_latency_stat_table(tx_latency, &sta->tx_lat[i],
487 buf, pos, bufsz, i);
488unlock:
489 rcu_read_unlock();
490
491 ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos);
492 kfree(buf);
493
494 return ret;
495}
496STA_OPS(tx_latency_stat);
497
498static ssize_t sta_tx_latency_stat_reset_write(struct file *file,
499 const char __user *userbuf,
500 size_t count, loff_t *ppos)
501{
502 u32 *bins;
503 int bin_count;
504 struct sta_info *sta = file->private_data;
505 int i;
506
507 if (!sta->tx_lat)
508 return -EINVAL;
509
510 for (i = 0; i < IEEE80211_NUM_TIDS; i++) {
511 bins = sta->tx_lat[i].bins;
512 bin_count = sta->tx_lat[i].bin_count;
513
514 sta->tx_lat[i].max = 0;
515 sta->tx_lat[i].sum = 0;
516 sta->tx_lat[i].counter = 0;
517
518 if (bin_count)
519 memset(bins, 0, bin_count * sizeof(u32));
520 }
521
522 return count;
523}
524STA_OPS_W(tx_latency_stat_reset);
525
526#define DEBUGFS_ADD(name) \ 394#define DEBUGFS_ADD(name) \
527 debugfs_create_file(#name, 0400, \ 395 debugfs_create_file(#name, 0400, \
528 sta->debugfs.dir, sta, &sta_ ##name## _ops); 396 sta->debugfs.dir, sta, &sta_ ##name## _ops);
@@ -576,8 +444,6 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
576 DEBUGFS_ADD(last_ack_signal); 444 DEBUGFS_ADD(last_ack_signal);
577 DEBUGFS_ADD(current_tx_rate); 445 DEBUGFS_ADD(current_tx_rate);
578 DEBUGFS_ADD(last_rx_rate); 446 DEBUGFS_ADD(last_rx_rate);
579 DEBUGFS_ADD(tx_latency_stat);
580 DEBUGFS_ADD(tx_latency_stat_reset);
581 447
582 DEBUGFS_ADD_COUNTER(rx_packets, rx_packets); 448 DEBUGFS_ADD_COUNTER(rx_packets, rx_packets);
583 DEBUGFS_ADD_COUNTER(tx_packets, tx_packets); 449 DEBUGFS_ADD_COUNTER(tx_packets, tx_packets);