From 6cd15fb930793f441eaa829bd087ac34e644e492 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 9 Mar 2016 22:39:16 +0000 Subject: benchmarks: Add gem_syslatency Instead of measuring the wakeup latency of a GEM client, we turn the tables here and ask what is the wakeup latency of a normal process competing with GEM. In particular, a realtime process that expects deterministic latency. Signed-off-by: Chris Wilson --- lib/igt_stats.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/igt_stats.h') diff --git a/lib/igt_stats.h b/lib/igt_stats.h index 105f3fb2..32f376cc 100644 --- a/lib/igt_stats.h +++ b/lib/igt_stats.h @@ -27,6 +27,7 @@ #include #include +#include /** * igt_stats_t: @@ -81,20 +82,26 @@ double igt_stats_get_variance(igt_stats_t *stats); double igt_stats_get_std_deviation(igt_stats_t *stats); struct igt_mean { - double mean, sq; + double mean, sq, min, max; unsigned long count; }; static inline void igt_mean_init(struct igt_mean *m) { memset(m, 0, sizeof(*m)); + m->max = -HUGE_VAL; + m->min = HUGE_VAL; } static inline void igt_mean_add(struct igt_mean *m, double v) { double delta = v - m->mean; - m->mean += delta / m->count++; + m->mean += delta / ++m->count; m->sq += delta * (v - m->mean); + if (v < m->min) + m->min = v; + if (v > m->max) + m->max = v; } static inline double igt_mean_get(struct igt_mean *m) -- cgit v1.2.3