1 #ifndef _TRACEFILE_ARRAY_H
2 #define _TRACEFILE_ARRAY_H
5 * Copyright (C) 2015 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License, version 2 only, as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 51
18 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 /* Per-tracefile head/tail seq. */
28 uint64_t seq_head
; /* Newest seqcount. Inclusive. */
29 uint64_t seq_tail
; /* Oldest seqcount. Inclusive. */
33 * Represents an array of trace files in a stream.
35 struct tracefile_array
{
39 /* Current head/tail files. */
43 /* Overall head/tail seq for the entire array. Inclusive. */
48 struct tracefile_array
*tracefile_array_create(size_t count
);
49 void tracefile_array_destroy(struct tracefile_array
*tfa
);
51 void tracefile_array_file_rotate(struct tracefile_array
*tfa
);
52 void tracefile_array_commit_seq(struct tracefile_array
*tfa
);
54 uint64_t tracefile_array_get_file_index_head(struct tracefile_array
*tfa
);
55 /* May return -1ULL in the case where we have not received any indexes yet. */
56 uint64_t tracefile_array_get_seq_head(struct tracefile_array
*tfa
);
58 uint64_t tracefile_array_get_file_index_tail(struct tracefile_array
*tfa
);
59 /* May return -1ULL in the case where we have not received any indexes yet. */
60 uint64_t tracefile_array_get_seq_tail(struct tracefile_array
*tfa
);
62 bool tracefile_array_seq_in_file(struct tracefile_array
*tfa
,
63 uint64_t file_index
, uint64_t seq
);
65 #endif /* _STREAM_H */
This page took 0.068131 seconds and 5 git commands to generate.