|
@@ -1617,6 +1617,8 @@ static ssize_t wil_write_suspend_stats(struct file *file,
|
|
struct wil6210_priv *wil = file->private_data;
|
|
struct wil6210_priv *wil = file->private_data;
|
|
|
|
|
|
memset(&wil->suspend_stats, 0, sizeof(wil->suspend_stats));
|
|
memset(&wil->suspend_stats, 0, sizeof(wil->suspend_stats));
|
|
|
|
+ wil->suspend_stats.min_suspend_time = ULONG_MAX;
|
|
|
|
+ wil->suspend_stats.collection_start = ktime_get();
|
|
|
|
|
|
return len;
|
|
return len;
|
|
}
|
|
}
|
|
@@ -1628,18 +1630,27 @@ static ssize_t wil_read_suspend_stats(struct file *file,
|
|
struct wil6210_priv *wil = file->private_data;
|
|
struct wil6210_priv *wil = file->private_data;
|
|
static char text[400];
|
|
static char text[400];
|
|
int n;
|
|
int n;
|
|
|
|
+ unsigned long long stats_collection_time =
|
|
|
|
+ ktime_to_us(ktime_sub(ktime_get(),
|
|
|
|
+ wil->suspend_stats.collection_start));
|
|
|
|
|
|
n = snprintf(text, sizeof(text),
|
|
n = snprintf(text, sizeof(text),
|
|
"Suspend statistics:\n"
|
|
"Suspend statistics:\n"
|
|
"successful suspends:%ld failed suspends:%ld\n"
|
|
"successful suspends:%ld failed suspends:%ld\n"
|
|
"successful resumes:%ld failed resumes:%ld\n"
|
|
"successful resumes:%ld failed resumes:%ld\n"
|
|
- "rejected by host:%ld rejected by device:%ld\n",
|
|
|
|
|
|
+ "rejected by host:%ld rejected by device:%ld\n"
|
|
|
|
+ "total suspend time:%lld min suspend time:%lld\n"
|
|
|
|
+ "max suspend time:%lld stats collection time: %lld\n",
|
|
wil->suspend_stats.successful_suspends,
|
|
wil->suspend_stats.successful_suspends,
|
|
wil->suspend_stats.failed_suspends,
|
|
wil->suspend_stats.failed_suspends,
|
|
wil->suspend_stats.successful_resumes,
|
|
wil->suspend_stats.successful_resumes,
|
|
wil->suspend_stats.failed_resumes,
|
|
wil->suspend_stats.failed_resumes,
|
|
wil->suspend_stats.rejected_by_host,
|
|
wil->suspend_stats.rejected_by_host,
|
|
- wil->suspend_stats.rejected_by_device);
|
|
|
|
|
|
+ wil->suspend_stats.rejected_by_device,
|
|
|
|
+ wil->suspend_stats.total_suspend_time,
|
|
|
|
+ wil->suspend_stats.min_suspend_time,
|
|
|
|
+ wil->suspend_stats.max_suspend_time,
|
|
|
|
+ stats_collection_time);
|
|
|
|
|
|
n = min_t(int, n, sizeof(text));
|
|
n = min_t(int, n, sizeof(text));
|
|
|
|
|
|
@@ -1795,6 +1806,8 @@ int wil6210_debugfs_init(struct wil6210_priv *wil)
|
|
|
|
|
|
wil6210_debugfs_create_ITR_CNT(wil, dbg);
|
|
wil6210_debugfs_create_ITR_CNT(wil, dbg);
|
|
|
|
|
|
|
|
+ wil->suspend_stats.collection_start = ktime_get();
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|