Commit | Line | Data |
---|---|---|
3bd1e081 | 1 | /* |
21cf9b6b | 2 | * Copyright (C) 2011 EfficiOS Inc. |
ab5be9fa | 3 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
3bd1e081 | 4 | * |
ab5be9fa | 5 | * SPDX-License-Identifier: GPL-2.0-only |
3bd1e081 | 6 | * |
3bd1e081 MD |
7 | */ |
8 | ||
9 | #ifndef _LTTNG_USTCONSUMER_H | |
10 | #define _LTTNG_USTCONSUMER_H | |
11 | ||
edf4b93e | 12 | #include <common/compat/errno.h> |
c8fea79c | 13 | #include <common/consumer/consumer.h> |
02d02e31 | 14 | #include <stdbool.h> |
10a8a223 | 15 | |
74d0b642 | 16 | #ifdef HAVE_LIBLTTNG_UST_CTL |
3bd1e081 | 17 | |
ffe60014 | 18 | int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream); |
e9404c27 JG |
19 | int lttng_ustconsumer_sample_snapshot_positions( |
20 | struct lttng_consumer_stream *stream); | |
3bd1e081 | 21 | |
3bd1e081 | 22 | int lttng_ustconsumer_get_produced_snapshot( |
ffe60014 | 23 | struct lttng_consumer_stream *stream, unsigned long *pos); |
10a50311 JD |
24 | int lttng_ustconsumer_get_consumed_snapshot( |
25 | struct lttng_consumer_stream *stream, unsigned long *pos); | |
3bd1e081 MD |
26 | |
27 | int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, | |
28 | int sock, struct pollfd *consumer_sockpoll); | |
29 | ||
30 | extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan); | |
31 | extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan); | |
b83e03c4 | 32 | extern void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan); |
e316aad5 | 33 | extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream); |
3bd1e081 MD |
34 | extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream); |
35 | ||
d41f73b7 | 36 | int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream, |
d2956687 | 37 | struct lttng_consumer_local_data *ctx); |
d41f73b7 MD |
38 | int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream); |
39 | ||
d056b477 MD |
40 | void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream); |
41 | ||
881fc67f MD |
42 | int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream, |
43 | int producer_active); | |
44 | int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, | |
45 | uint64_t *stream_id); | |
6d805429 | 46 | int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream); |
6d574024 DG |
47 | void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht); |
48 | void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata); | |
d8ef542d | 49 | void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream); |
331744e3 | 50 | int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, |
93ec662e JD |
51 | uint64_t len, uint64_t version, |
52 | struct lttng_consumer_channel *channel, int timer, int wait); | |
331744e3 | 53 | int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx, |
94d49140 | 54 | struct lttng_consumer_channel *channel, int timer, int wait); |
577eea73 JG |
55 | enum sync_metadata_status lttng_ustconsumer_sync_metadata( |
56 | struct lttng_consumer_local_data *ctx, | |
94d49140 | 57 | struct lttng_consumer_stream *metadata); |
881fc67f | 58 | int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream, |
84a182ce | 59 | int producer); |
881fc67f | 60 | int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream); |
84a182ce DG |
61 | int lttng_ustconsumer_get_current_timestamp( |
62 | struct lttng_consumer_stream *stream, uint64_t *ts); | |
fb83fe64 JD |
63 | int lttng_ustconsumer_get_sequence_number( |
64 | struct lttng_consumer_stream *stream, uint64_t *seq); | |
881fc67f | 65 | void lttng_ustconsumer_sigbus_handle(void *addr); |
f02e1e8a | 66 | |
74d0b642 | 67 | #else /* HAVE_LIBLTTNG_UST_CTL */ |
3bd1e081 MD |
68 | |
69 | static inline | |
4078b776 | 70 | ssize_t lttng_ustconsumer_on_read_subbuffer_mmap( |
3bd1e081 | 71 | struct lttng_consumer_local_data *ctx, |
1d4dfdef DG |
72 | struct lttng_consumer_stream *stream, unsigned long len, |
73 | unsigned long padding) | |
3bd1e081 MD |
74 | { |
75 | return -ENOSYS; | |
76 | } | |
77 | ||
78 | static inline | |
4078b776 | 79 | ssize_t lttng_ustconsumer_on_read_subbuffer_splice( |
3bd1e081 | 80 | struct lttng_consumer_local_data *ctx, |
1d4dfdef DG |
81 | struct lttng_consumer_stream *uststream, unsigned long len, |
82 | unsigned long padding) | |
3bd1e081 MD |
83 | { |
84 | return -ENOSYS; | |
85 | } | |
86 | ||
87 | static inline | |
ffe60014 | 88 | int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream) |
3bd1e081 MD |
89 | { |
90 | return -ENOSYS; | |
91 | } | |
92 | ||
e9404c27 JG |
93 | static inline |
94 | int lttng_ustconsumer_sample_snapshot_positions( | |
95 | struct lttng_consumer_stream *stream) | |
96 | { | |
97 | return -ENOSYS; | |
98 | } | |
99 | ||
3bd1e081 MD |
100 | static inline |
101 | int lttng_ustconsumer_get_produced_snapshot( | |
ffe60014 | 102 | struct lttng_consumer_stream *stream, unsigned long *pos) |
3bd1e081 MD |
103 | { |
104 | return -ENOSYS; | |
105 | } | |
106 | ||
e9404c27 JG |
107 | static inline |
108 | int lttng_ustconsumer_get_consumed_snapshot( | |
109 | struct lttng_consumer_stream *stream, unsigned long *pos) | |
110 | { | |
111 | return -ENOSYS; | |
112 | } | |
113 | ||
3bd1e081 MD |
114 | static inline |
115 | int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, | |
fbc72522 DG |
116 | int sock, struct pollfd *consumer_sockpoll) |
117 | { | |
118 | return -ENOSYS; | |
119 | } | |
3bd1e081 MD |
120 | |
121 | static inline | |
122 | int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan) | |
123 | { | |
124 | return -ENOSYS; | |
125 | } | |
126 | ||
127 | static inline | |
128 | void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan) | |
129 | { | |
130 | } | |
131 | ||
b83e03c4 MD |
132 | static inline |
133 | void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan) | |
134 | { | |
135 | } | |
136 | ||
3bd1e081 | 137 | static inline |
e316aad5 | 138 | int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream) |
3bd1e081 MD |
139 | { |
140 | return -ENOSYS; | |
141 | } | |
142 | ||
143 | static inline | |
144 | void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream) | |
145 | { | |
146 | } | |
147 | ||
d41f73b7 MD |
148 | static inline |
149 | int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream, | |
d2956687 | 150 | struct lttng_consumer_local_data *ctx) |
d41f73b7 MD |
151 | { |
152 | return -ENOSYS; | |
153 | } | |
154 | ||
155 | static inline | |
156 | int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream) | |
157 | { | |
158 | return -ENOSYS; | |
159 | } | |
160 | ||
d056b477 MD |
161 | static inline |
162 | void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream) | |
163 | { | |
164 | } | |
165 | ||
ca22feea | 166 | static inline |
6d805429 | 167 | int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream) |
ca22feea DG |
168 | { |
169 | return -ENOSYS; | |
170 | } | |
ffe60014 | 171 | static inline |
881fc67f | 172 | int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream, |
fc6d7a51 JD |
173 | int producer_active) |
174 | { | |
881fc67f | 175 | return -ENOSYS; |
fc6d7a51 JD |
176 | } |
177 | static inline | |
6d574024 DG |
178 | void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht) |
179 | { | |
180 | } | |
181 | static inline | |
182 | void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata) | |
d88aee68 DG |
183 | { |
184 | } | |
d8ef542d MD |
185 | static inline |
186 | void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream) | |
187 | { | |
188 | } | |
ee69440b DG |
189 | static inline |
190 | int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, | |
93ec662e JD |
191 | uint64_t len, uint64_t version, |
192 | struct lttng_consumer_channel *channel, int timer) | |
ee69440b DG |
193 | { |
194 | return -ENOSYS; | |
195 | } | |
196 | static inline | |
ee69440b | 197 | int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx, |
84a182ce | 198 | struct lttng_consumer_channel *channel, int timer, int wait) |
ee69440b DG |
199 | { |
200 | return -ENOSYS; | |
201 | } | |
94d49140 | 202 | static inline |
577eea73 | 203 | enum sync_metadata_status lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx, |
94d49140 JD |
204 | struct lttng_consumer_stream *metadata) |
205 | { | |
577eea73 | 206 | return SYNC_METADATA_STATUS_ERROR; |
94d49140 | 207 | } |
84a182ce | 208 | static inline |
881fc67f | 209 | int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream, |
84a182ce DG |
210 | int producer) |
211 | { | |
881fc67f | 212 | return -ENOSYS; |
84a182ce DG |
213 | } |
214 | static inline | |
881fc67f | 215 | int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream) |
214f70e0 | 216 | { |
881fc67f | 217 | return -ENOSYS; |
214f70e0 JR |
218 | } |
219 | static inline | |
84a182ce DG |
220 | int lttng_ustconsumer_get_current_timestamp( |
221 | struct lttng_consumer_stream *stream, uint64_t *ts) | |
222 | { | |
223 | return -ENOSYS; | |
224 | } | |
a31c9f22 | 225 | static inline |
fb83fe64 JD |
226 | int lttng_ustconsumer_get_sequence_number( |
227 | struct lttng_consumer_stream *stream, uint64_t *seq) | |
228 | { | |
229 | return -ENOSYS; | |
230 | } | |
70190e1c DG |
231 | static inline |
232 | int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, | |
233 | uint64_t *stream_id) | |
234 | { | |
235 | return -ENOSYS; | |
236 | } | |
881fc67f MD |
237 | static inline |
238 | void lttng_ustconsumer_sigbus_handle(void *addr) | |
239 | { | |
240 | } | |
74d0b642 | 241 | #endif /* HAVE_LIBLTTNG_UST_CTL */ |
3bd1e081 MD |
242 | |
243 | #endif /* _LTTNG_USTCONSUMER_H */ |