diff options
Diffstat (limited to 'lib/igt_stats.h')
-rw-r--r-- | lib/igt_stats.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/igt_stats.h b/lib/igt_stats.h index 554ab158..0dc065f4 100644 --- a/lib/igt_stats.h +++ b/lib/igt_stats.h @@ -34,17 +34,27 @@ * @n_values: The number of pushed values */ typedef struct { - uint64_t *values; + union { + uint64_t *values_u64; + double *values_f; + }; unsigned int n_values; + unsigned int is_float : 1; /*< private >*/ unsigned int capacity; unsigned int is_population : 1; unsigned int mean_variance_valid : 1; unsigned int sorted_array_valid : 1; + uint64_t min, max; + double range[2]; double mean, variance; - uint64_t *sorted; + + union { + uint64_t *sorted_u64; + double *sorted_f; + }; } igt_stats_t; void igt_stats_init(igt_stats_t *stats); @@ -53,6 +63,7 @@ void igt_stats_fini(igt_stats_t *stats); bool igt_stats_is_population(igt_stats_t *stats); void igt_stats_set_population(igt_stats_t *stats, bool full_population); void igt_stats_push(igt_stats_t *stats, uint64_t value); +void igt_stats_push_float(igt_stats_t *stats, double value); void igt_stats_push_array(igt_stats_t *stats, const uint64_t *values, unsigned int n_values); uint64_t igt_stats_get_min(igt_stats_t *stats); |