src.ctf.fs: remove unused ctf_fs_ds_file::self_msg_iter field
[babeltrace.git] / src / plugins / ctf / fs-src / data-stream-file.hpp
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2016 Philippe Proulx <pproulx@efficios.com>
5 */
6
7 #ifndef CTF_FS_DS_FILE_H
8 #define CTF_FS_DS_FILE_H
9
10 #include <stdio.h>
11 #include <stdbool.h>
12 #include <glib.h>
13 #include "common/macros.h"
14 #include <babeltrace2/babeltrace.h>
15
16 #include "../common/msg-iter/msg-iter.hpp"
17 #include "lttng-index.hpp"
18
19 struct ctf_fs_component;
20 struct ctf_fs_file;
21 struct ctf_fs_trace;
22 struct ctf_fs_ds_file;
23 struct ctf_fs_ds_file_group;
24 struct ctf_fs_ds_group_medops_data;
25
26 struct ctf_fs_ds_file_info
27 {
28 /* Owned by this. */
29 GString *path;
30
31 /* Guaranteed to be set, as opposed to the index. */
32 int64_t begin_ns;
33 };
34
35 struct ctf_fs_metadata;
36
37 struct ctf_fs_ds_file
38 {
39 bt_logging_level log_level;
40
41 /* Weak */
42 bt_self_component *self_comp;
43
44 /* Weak */
45 struct ctf_fs_metadata *metadata;
46
47 /* Owned by this */
48 struct ctf_fs_file *file;
49
50 /* Owned by this */
51 bt_stream *stream;
52
53 void *mmap_addr;
54
55 /*
56 * Max length of chunk to mmap() when updating the current mapping.
57 * This value must be page-aligned.
58 */
59 size_t mmap_max_len;
60
61 /* Length of the current mapping. Never exceeds the file's length. */
62 size_t mmap_len;
63
64 /* Offset in the file where the current mapping starts. */
65 off_t mmap_offset_in_file;
66
67 /*
68 * Offset, in the current mapping, of the address to return on the next
69 * request.
70 */
71 off_t request_offset_in_mapping;
72 };
73
74 BT_HIDDEN
75 struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace, bt_stream *stream,
76 const char *path, bt_logging_level log_level);
77
78 BT_HIDDEN
79 void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
80
81 BT_HIDDEN
82 struct ctf_fs_ds_index *ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
83 struct ctf_fs_ds_file_info *ds_file_info,
84 struct ctf_msg_iter *msg_iter);
85
86 BT_HIDDEN
87 struct ctf_fs_ds_index *ctf_fs_ds_index_create(bt_logging_level log_level,
88 bt_self_component *self_comp);
89
90 BT_HIDDEN
91 void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index);
92
93 /*
94 * Medium operations to iterate on a single ctf_fs_ds_file.
95 *
96 * The data pointer when using this must be a pointer to the ctf_fs_ds_file.
97 */
98 extern struct ctf_msg_iter_medium_ops ctf_fs_ds_file_medops;
99
100 /*
101 * Medium operations to iterate on the packet of a ctf_fs_ds_group.
102 *
103 * The iteration is done based on the index of the group.
104 *
105 * The data pointer when using these medops must be a pointer to a ctf_fs_ds
106 * group_medops_data structure.
107 */
108 BT_HIDDEN
109 extern struct ctf_msg_iter_medium_ops ctf_fs_ds_group_medops;
110
111 BT_HIDDEN
112 enum ctf_msg_iter_medium_status ctf_fs_ds_group_medops_data_create(
113 struct ctf_fs_ds_file_group *ds_file_group, bt_self_message_iterator *self_msg_iter,
114 bt_logging_level log_level, struct ctf_fs_ds_group_medops_data **out);
115
116 BT_HIDDEN
117 void ctf_fs_ds_group_medops_data_reset(struct ctf_fs_ds_group_medops_data *data);
118
119 BT_HIDDEN
120 void ctf_fs_ds_group_medops_data_destroy(struct ctf_fs_ds_group_medops_data *data);
121
122 #endif /* CTF_FS_DS_FILE_H */
This page took 0.030804 seconds and 4 git commands to generate.