Clean-up: sessiond: cmd_enable_channel_internal
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.h
CommitLineData
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 18int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream);
e9404c27
JG
19int lttng_ustconsumer_sample_snapshot_positions(
20 struct lttng_consumer_stream *stream);
3bd1e081 21
3bd1e081 22int lttng_ustconsumer_get_produced_snapshot(
ffe60014 23 struct lttng_consumer_stream *stream, unsigned long *pos);
10a50311
JD
24int lttng_ustconsumer_get_consumed_snapshot(
25 struct lttng_consumer_stream *stream, unsigned long *pos);
3bd1e081
MD
26
27int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
28 int sock, struct pollfd *consumer_sockpoll);
29
30extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan);
31extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
b83e03c4 32extern void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan);
e316aad5 33extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
3bd1e081
MD
34extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
35
d41f73b7 36int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
d2956687 37 struct lttng_consumer_local_data *ctx);
d41f73b7
MD
38int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
39
d056b477
MD
40void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
41
881fc67f
MD
42int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream,
43 int producer_active);
44int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
45 uint64_t *stream_id);
6d805429 46int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
6d574024
DG
47void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht);
48void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata);
d8ef542d 49void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream);
331744e3 50int 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 53int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
94d49140 54 struct lttng_consumer_channel *channel, int timer, int wait);
577eea73
JG
55enum sync_metadata_status lttng_ustconsumer_sync_metadata(
56 struct lttng_consumer_local_data *ctx,
94d49140 57 struct lttng_consumer_stream *metadata);
881fc67f 58int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
84a182ce 59 int producer);
881fc67f 60int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream);
84a182ce
DG
61int lttng_ustconsumer_get_current_timestamp(
62 struct lttng_consumer_stream *stream, uint64_t *ts);
fb83fe64
JD
63int lttng_ustconsumer_get_sequence_number(
64 struct lttng_consumer_stream *stream, uint64_t *seq);
881fc67f 65void lttng_ustconsumer_sigbus_handle(void *addr);
f02e1e8a 66
74d0b642 67#else /* HAVE_LIBLTTNG_UST_CTL */
3bd1e081
MD
68
69static inline
4078b776 70ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
f46376a1
MJ
71 struct lttng_consumer_local_data *ctx __attribute__((unused)),
72 struct lttng_consumer_stream *stream __attribute__((unused)),
73 unsigned long len __attribute__((unused)),
74 unsigned long padding __attribute__((unused)))
3bd1e081
MD
75{
76 return -ENOSYS;
77}
78
79static inline
4078b776 80ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
f46376a1
MJ
81 struct lttng_consumer_local_data *ctx __attribute__((unused)),
82 struct lttng_consumer_stream *uststream __attribute__((unused)),
83 unsigned long len __attribute__((unused)),
84 unsigned long padding __attribute__((unused)))
3bd1e081
MD
85{
86 return -ENOSYS;
87}
88
89static inline
f46376a1
MJ
90int lttng_ustconsumer_take_snapshot(
91 struct lttng_consumer_stream *stream __attribute__((unused)))
3bd1e081
MD
92{
93 return -ENOSYS;
94}
95
e9404c27
JG
96static inline
97int lttng_ustconsumer_sample_snapshot_positions(
f46376a1 98 struct lttng_consumer_stream *stream __attribute__((unused)))
e9404c27
JG
99{
100 return -ENOSYS;
101}
102
3bd1e081
MD
103static inline
104int lttng_ustconsumer_get_produced_snapshot(
f46376a1
MJ
105 struct lttng_consumer_stream *stream __attribute__((unused)),
106 unsigned long *pos __attribute__((unused)))
3bd1e081
MD
107{
108 return -ENOSYS;
109}
110
e9404c27
JG
111static inline
112int lttng_ustconsumer_get_consumed_snapshot(
f46376a1
MJ
113 struct lttng_consumer_stream *stream __attribute__((unused)),
114 unsigned long *pos __attribute__((unused)))
e9404c27
JG
115{
116 return -ENOSYS;
117}
118
3bd1e081 119static inline
f46376a1
MJ
120int lttng_ustconsumer_recv_cmd(
121 struct lttng_consumer_local_data *ctx __attribute__((unused)),
122 int sock __attribute__((unused)),
123 struct pollfd *consumer_sockpoll __attribute__((unused)))
fbc72522
DG
124{
125 return -ENOSYS;
126}
3bd1e081
MD
127
128static inline
f46376a1
MJ
129int lttng_ustconsumer_allocate_channel(
130 struct lttng_consumer_channel *chan __attribute__((unused)))
3bd1e081
MD
131{
132 return -ENOSYS;
133}
134
135static inline
f46376a1
MJ
136void lttng_ustconsumer_del_channel(
137 struct lttng_consumer_channel *chan __attribute__((unused)))
3bd1e081
MD
138{
139}
140
b83e03c4 141static inline
f46376a1
MJ
142void lttng_ustconsumer_free_channel(
143 struct lttng_consumer_channel *chan __attribute__((unused)))
b83e03c4
MD
144{
145}
146
3bd1e081 147static inline
f46376a1
MJ
148int lttng_ustconsumer_add_stream(
149 struct lttng_consumer_stream *stream __attribute__((unused)))
3bd1e081
MD
150{
151 return -ENOSYS;
152}
153
154static inline
f46376a1
MJ
155void lttng_ustconsumer_del_stream(
156 struct lttng_consumer_stream *stream __attribute__((unused)))
3bd1e081
MD
157{
158}
159
d41f73b7 160static inline
f46376a1
MJ
161int lttng_ustconsumer_read_subbuffer(
162 struct lttng_consumer_stream *stream __attribute__((unused)),
163 struct lttng_consumer_local_data *ctx __attribute__((unused)))
d41f73b7
MD
164{
165 return -ENOSYS;
166}
167
168static inline
f46376a1
MJ
169int lttng_ustconsumer_on_recv_stream(
170 struct lttng_consumer_stream *stream __attribute__((unused)))
d41f73b7
MD
171{
172 return -ENOSYS;
173}
174
d056b477 175static inline
f46376a1
MJ
176void lttng_ustconsumer_on_stream_hangup(
177 struct lttng_consumer_stream *stream __attribute__((unused)))
d056b477
MD
178{
179}
180
ca22feea 181static inline
f46376a1
MJ
182int lttng_ustconsumer_data_pending(
183 struct lttng_consumer_stream *stream __attribute__((unused)))
ca22feea
DG
184{
185 return -ENOSYS;
186}
f46376a1 187
ffe60014 188static inline
f46376a1
MJ
189int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream __attribute__((unused)),
190 int producer_active __attribute__((unused)))
fc6d7a51 191{
881fc67f 192 return -ENOSYS;
fc6d7a51 193}
f46376a1 194
fc6d7a51 195static inline
f46376a1
MJ
196void lttng_ustconsumer_close_all_metadata(
197 struct lttng_ht *ht __attribute__((unused)))
6d574024
DG
198{
199}
f46376a1 200
6d574024 201static inline
f46376a1
MJ
202void lttng_ustconsumer_close_metadata(
203 struct lttng_consumer_channel *metadata __attribute__((unused)))
d88aee68
DG
204{
205}
d8ef542d 206static inline
f46376a1
MJ
207void lttng_ustconsumer_close_stream_wakeup(
208 struct lttng_consumer_stream *stream __attribute__((unused)))
d8ef542d
MD
209{
210}
f46376a1 211
ee69440b 212static inline
f46376a1
MJ
213int lttng_ustconsumer_recv_metadata(int sock __attribute__((unused)),
214 uint64_t key __attribute__((unused)),
215 uint64_t offset __attribute__((unused)),
216 uint64_t len __attribute__((unused)),
217 uint64_t version __attribute__((unused)),
218 struct lttng_consumer_channel *channel __attribute__((unused)),
219 int timer __attribute__((unused)))
ee69440b
DG
220{
221 return -ENOSYS;
222}
f46376a1 223
ee69440b 224static inline
f46376a1
MJ
225int lttng_ustconsumer_request_metadata(
226 struct lttng_consumer_local_data *ctx __attribute__((unused)),
227 struct lttng_consumer_channel *channel __attribute__((unused)),
228 int timer __attribute__((unused)),
229 int wait __attribute__((unused)))
ee69440b
DG
230{
231 return -ENOSYS;
232}
f46376a1 233
94d49140 234static inline
f46376a1
MJ
235enum sync_metadata_status lttng_ustconsumer_sync_metadata(
236 struct lttng_consumer_local_data *ctx __attribute__((unused)),
237 struct lttng_consumer_stream *metadata __attribute__((unused)))
94d49140 238{
577eea73 239 return SYNC_METADATA_STATUS_ERROR;
94d49140 240}
f46376a1 241
84a182ce 242static inline
f46376a1
MJ
243int lttng_ustconsumer_flush_buffer(
244 struct lttng_consumer_stream *stream __attribute__((unused)),
245 int producer __attribute__((unused)))
84a182ce 246{
881fc67f 247 return -ENOSYS;
84a182ce 248}
f46376a1 249
84a182ce 250static inline
f46376a1
MJ
251int lttng_ustconsumer_clear_buffer(
252 struct lttng_consumer_stream *stream __attribute__((unused)))
214f70e0 253{
881fc67f 254 return -ENOSYS;
214f70e0 255}
f46376a1 256
214f70e0 257static inline
84a182ce 258int lttng_ustconsumer_get_current_timestamp(
f46376a1
MJ
259 struct lttng_consumer_stream *stream __attribute__((unused)),
260 uint64_t *ts __attribute__((unused)))
84a182ce
DG
261{
262 return -ENOSYS;
263}
f46376a1 264
a31c9f22 265static inline
fb83fe64 266int lttng_ustconsumer_get_sequence_number(
f46376a1
MJ
267 struct lttng_consumer_stream *stream __attribute__((unused)),
268 uint64_t *seq __attribute__((unused)))
fb83fe64
JD
269{
270 return -ENOSYS;
271}
f46376a1 272
70190e1c 273static inline
f46376a1
MJ
274int lttng_ustconsumer_get_stream_id(
275 struct lttng_consumer_stream *stream __attribute__((unused)),
276 uint64_t *stream_id __attribute__((unused)))
70190e1c
DG
277{
278 return -ENOSYS;
279}
f46376a1 280
881fc67f 281static inline
f46376a1
MJ
282void lttng_ustconsumer_sigbus_handle(
283 void *addr __attribute__((unused)))
881fc67f
MD
284{
285}
74d0b642 286#endif /* HAVE_LIBLTTNG_UST_CTL */
3bd1e081
MD
287
288#endif /* _LTTNG_USTCONSUMER_H */
This page took 0.084282 seconds and 4 git commands to generate.