relayd tracefile array: add tracefile_array_reset
[lttng-tools.git] / src / bin / lttng-relayd / tracefile-array.c
index 3d62317ac76d7a6fbe2d731a9991aa788181db78..a52ccd550823fdeeeaf9f892cbd7e09a74d0959e 100644 (file)
@@ -62,6 +62,22 @@ void tracefile_array_destroy(struct tracefile_array *tfa)
        free(tfa);
 }
 
+void tracefile_array_reset(struct tracefile_array *tfa)
+{
+       size_t count, i;
+
+       count = tfa->count;
+       for (i = 0; i < count; i++) {
+               tfa->tf[i].seq_head = -1ULL;
+               tfa->tf[i].seq_tail = -1ULL;
+       }
+       tfa->seq_head = -1ULL;
+       tfa->seq_tail = -1ULL;
+       tfa->file_head_read = 0;
+       tfa->file_head_write = 0;
+       tfa->file_tail = 0;
+}
+
 void tracefile_array_file_rotate(struct tracefile_array *tfa,
                enum tracefile_rotate_type type)
 {
This page took 0.023836 seconds and 5 git commands to generate.