wil6210: Tx performance monitoring
For performance monitoring, trace time intervals when Tx vring is idle/not idle. Use CPU cycle counter for this, because jiffies is too rough, and other precise time measurement methods involve overhead while get_cycles() should be fast. This used to provide some estimation for percentage when Tx vring was idle, i.e. when hardware is under-utilized. Estimation is not precise because of many reasons - CPU frequency scaling, grt_cycles() may be per core etc. But still, it is good estimation Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
67c3e1b41e
commit
7c0acf868d
@@ -69,6 +69,8 @@ static int wil_vring_debugfs_show(struct seq_file *s, void *data)
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(wil->vring_tx); i++) {
|
||||
struct vring *vring = &(wil->vring_tx[i]);
|
||||
struct vring_tx_data *txdata = &wil->vring_tx_data[i];
|
||||
|
||||
if (vring->va) {
|
||||
int cid = wil->vring2cid_tid[i][0];
|
||||
int tid = wil->vring2cid_tid[i][1];
|
||||
@@ -78,10 +80,20 @@ static int wil_vring_debugfs_show(struct seq_file *s, void *data)
|
||||
% vring->size;
|
||||
int avail = vring->size - used - 1;
|
||||
char name[10];
|
||||
/* performance monitoring */
|
||||
cycles_t now = get_cycles();
|
||||
cycles_t idle = txdata->idle;
|
||||
cycles_t total = now - txdata->begin;
|
||||
|
||||
txdata->begin = now;
|
||||
txdata->idle = 0ULL;
|
||||
|
||||
snprintf(name, sizeof(name), "tx_%2d", i);
|
||||
|
||||
seq_printf(s, "\n%pM CID %d TID %d [%3d|%3d]\n",
|
||||
wil->sta[cid].addr, cid, tid, used, avail);
|
||||
seq_printf(s, "\n%pM CID %d TID %d [%3d|%3d] idle %3d%%\n",
|
||||
wil->sta[cid].addr, cid, tid, used, avail,
|
||||
(int)((idle*100)/total));
|
||||
|
||||
wil_print_vring(s, wil, name, vring, '_', 'H');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user