infra: report peak IO latencies

This commit is contained in:
Thomas Schoebel-Theuer 2015-02-10 11:44:11 +01:00
parent c35065fe97
commit 7ced30b24c
2 changed files with 5 additions and 0 deletions

View File

@ -158,6 +158,7 @@ struct threshold {
int thr_factor; // in %
int thr_plus; // in us
// statistical
int thr_max; // in ms
int thr_triggered;
int thr_true_hit;
};
@ -165,7 +166,10 @@ struct threshold {
extern inline
void threshold_check(struct threshold *thr, long long latency)
{
int ms = latency >> 6; // ignore small rounding error
while (thr) {
if (ms > thr->thr_max)
thr->thr_max = ms;
if (thr->thr_limit &&
latency > (long long)thr->thr_limit * 1000) {
thr->thr_triggered++;

View File

@ -220,6 +220,7 @@ EXPORT_SYMBOL_GPL(mars_max_loadavg);
INT_ENTRY(PREFIX "_threshold_us", (VAR)->thr_limit, 0600), \
INT_ENTRY(PREFIX "_factor_percent", (VAR)->thr_factor, 0600), \
INT_ENTRY(PREFIX "_plus_us", (VAR)->thr_plus, 0600), \
INT_ENTRY(PREFIX "_max_ms", (VAR)->thr_max, 0600), \
INT_ENTRY(PREFIX "_triggered", (VAR)->thr_triggered,0400), \
INT_ENTRY(PREFIX "_true_hit", (VAR)->thr_true_hit, 0400) \