]> git.cworth.org Git - fips/blobdiff - metrics.h
Add a pointer to metrics_info_t from metrics_t
[fips] / metrics.h
index 8bae21f36a5c570f9b1bc0100910c36de002c60c..230d668422cc702ee61b8c0da6fe0096e19bf4ce 100644 (file)
--- a/metrics.h
+++ b/metrics.h
@@ -22,6 +22,8 @@
 #ifndef METRICS_H
 #define METRICS_H
 
+#include "metrics-info.h"
+
 typedef enum
 {
        METRICS_OP_ACCUM,
@@ -50,6 +52,29 @@ typedef enum
        METRICS_OP_SHADER
 } metrics_op_t;
 
+typedef struct metrics metrics_t;
+
+/* Create a new metrics_t object for tracking metrics, given the
+ * pre-initialized metrics_info_t* describing available counters. */
+metrics_t *
+metrics_create (metrics_info_t *info);
+
+/* Free all internal resources of a metrics_t
+ *
+ * All outstanding metrics counters are discarded.
+ *
+ * The metrics_t object remains valid and may be used again.
+ */
+void
+metrics_fini (metrics_t *metrics);
+
+/* Destroy a metrics_t object.
+ *
+ * After this call, the metrics_t* value is and must not be used
+ * further. */
+void
+metrics_destroy (metrics_t *metrics);
+
 /* Start accumulating GPU time.
  *
  * The time accumulated will be accounted against the