relayd tracefile array: add tracefile_array_reset
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 9 Dec 2019 14:56:27 +0000 (09:56 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Dec 2019 22:24:18 +0000 (17:24 -0500)
Required by clear feature.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I58893eb3fffbec5d39e7bf11a6d118fe23ec4496
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/tracefile-array.c
src/bin/lttng-relayd/tracefile-array.h

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)
 {
index 04d9123d03fc3caa9a3257dd654a11e45d7a94ba..53b32d9f5167bddbef5e5ef0e244069c08b23a8e 100644 (file)
@@ -65,6 +65,7 @@ void tracefile_array_destroy(struct tracefile_array *tfa);
 
 void tracefile_array_file_rotate(struct tracefile_array *tfa, enum tracefile_rotate_type type);
 void tracefile_array_commit_seq(struct tracefile_array *tfa);
+void tracefile_array_reset(struct tracefile_array *tfa);
 
 uint64_t tracefile_array_get_read_file_index_head(struct tracefile_array *tfa);
 /* May return -1ULL in the case where we have not received any indexes yet. */
This page took 0.037386 seconds and 5 git commands to generate.