summaryrefslogtreecommitdiff
path: root/lib/igt_stats.c
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2015-06-27 15:32:23 +0100
committerDamien Lespiau <damien.lespiau@intel.com>2015-06-27 16:04:08 +0100
commit3839bacde884a0d8ce55956b3221175a0078844b (patch)
treedae92f15e95c285ad3bcd38342c3149afd8af7b2 /lib/igt_stats.c
parent2fe286985f825128142f56df5dc806a78338b308 (diff)
stats: Add a bulk version of _push()
In case we want to push a bunch of values in one go. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib/igt_stats.c')
-rw-r--r--lib/igt_stats.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/igt_stats.c b/lib/igt_stats.c
index 26e4fbf9..5c1f23ff 100644
--- a/lib/igt_stats.c
+++ b/lib/igt_stats.c
@@ -166,6 +166,23 @@ void igt_stats_push(igt_stats_t *stats, uint64_t value)
}
/**
+ * igt_stats_push_array:
+ * @stats: An #igt_stats_t instance
+ * @values: (array length=n_values): A pointer to an array of data points
+ * @n_values: The number of data points to add
+ *
+ * Adds an array of values to the @stats dataset.
+ */
+void igt_stats_push_array(igt_stats_t *stats,
+ const uint64_t *values, unsigned int n_values)
+{
+ unsigned int i;
+
+ for (i = 0; i < n_values; i++)
+ igt_stats_push(stats, values[i]);
+}
+
+/**
* igt_stats_get_min:
* @stats: An #igt_stats_t instance
*