Adapt to namespaced liblttng-ust-ctl symbols
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.h
CommitLineData
3bd1e081 1/*
ab5be9fa
MJ
2 * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
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
b623cb6a 42void lttng_lttng_ust_ctl_flush_buffer(struct lttng_consumer_stream *stream,
fc6d7a51 43 int producer_active);
70190e1c
DG
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);
84a182ce
DG
58void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
59 int producer);
214f70e0 60void 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);
f02e1e8a 65
74d0b642 66#else /* HAVE_LIBLTTNG_UST_CTL */
3bd1e081
MD
67
68static inline
4078b776 69ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
3bd1e081 70 struct lttng_consumer_local_data *ctx,
1d4dfdef
DG
71 struct lttng_consumer_stream *stream, unsigned long len,
72 unsigned long padding)
3bd1e081
MD
73{
74 return -ENOSYS;
75}
76
77static inline
4078b776 78ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
3bd1e081 79 struct lttng_consumer_local_data *ctx,
1d4dfdef
DG
80 struct lttng_consumer_stream *uststream, unsigned long len,
81 unsigned long padding)
3bd1e081
MD
82{
83 return -ENOSYS;
84}
85
86static inline
ffe60014 87int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream)
3bd1e081
MD
88{
89 return -ENOSYS;
90}
91
e9404c27
JG
92static inline
93int lttng_ustconsumer_sample_snapshot_positions(
94 struct lttng_consumer_stream *stream)
95{
96 return -ENOSYS;
97}
98
3bd1e081
MD
99static inline
100int lttng_ustconsumer_get_produced_snapshot(
ffe60014 101 struct lttng_consumer_stream *stream, unsigned long *pos)
3bd1e081
MD
102{
103 return -ENOSYS;
104}
105
e9404c27
JG
106static inline
107int lttng_ustconsumer_get_consumed_snapshot(
108 struct lttng_consumer_stream *stream, unsigned long *pos)
109{
110 return -ENOSYS;
111}
112
3bd1e081
MD
113static inline
114int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
fbc72522
DG
115 int sock, struct pollfd *consumer_sockpoll)
116{
117 return -ENOSYS;
118}
3bd1e081
MD
119
120static inline
121int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
122{
123 return -ENOSYS;
124}
125
126static inline
127void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
128{
129}
130
b83e03c4
MD
131static inline
132void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
133{
134}
135
3bd1e081 136static inline
e316aad5 137int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
3bd1e081
MD
138{
139 return -ENOSYS;
140}
141
142static inline
143void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
144{
145}
146
d41f73b7
MD
147static inline
148int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
d2956687 149 struct lttng_consumer_local_data *ctx)
d41f73b7
MD
150{
151 return -ENOSYS;
152}
153
154static inline
155int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
156{
157 return -ENOSYS;
158}
159
d056b477
MD
160static inline
161void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream)
162{
163}
164
f02e1e8a 165static inline
b623cb6a 166int lttng_lttng_ust_ctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
ffe60014 167 unsigned long *off)
f02e1e8a
DG
168{
169 return -ENOSYS;
170}
ca22feea 171static inline
6d805429 172int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
ca22feea
DG
173{
174 return -ENOSYS;
175}
ffe60014 176static inline
b623cb6a 177void *lttng_lttng_ust_ctl_get_mmap_base(struct lttng_consumer_stream *stream)
ffe60014
DG
178{
179 return NULL;
180}
d88aee68 181static inline
b623cb6a 182void lttng_lttng_ust_ctl_flush_buffer(struct lttng_consumer_stream *stream,
fc6d7a51
JD
183 int producer_active)
184{
185}
186static inline
6d574024
DG
187void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht)
188{
189}
190static inline
191void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata)
d88aee68
DG
192{
193}
d8ef542d
MD
194static inline
195void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream)
196{
197}
ee69440b
DG
198static inline
199int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
93ec662e
JD
200 uint64_t len, uint64_t version,
201 struct lttng_consumer_channel *channel, int timer)
ee69440b
DG
202{
203 return -ENOSYS;
204}
205static inline
ee69440b 206int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
84a182ce 207 struct lttng_consumer_channel *channel, int timer, int wait)
ee69440b
DG
208{
209 return -ENOSYS;
210}
94d49140 211static inline
577eea73 212enum sync_metadata_status lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
94d49140
JD
213 struct lttng_consumer_stream *metadata)
214{
577eea73 215 return SYNC_METADATA_STATUS_ERROR;
94d49140 216}
84a182ce
DG
217static inline
218void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
219 int producer)
220{
221}
222static inline
214f70e0
JR
223void lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream)
224{
225}
226static inline
84a182ce
DG
227int lttng_ustconsumer_get_current_timestamp(
228 struct lttng_consumer_stream *stream, uint64_t *ts)
229{
230 return -ENOSYS;
231}
a31c9f22 232static inline
fb83fe64
JD
233int lttng_ustconsumer_get_sequence_number(
234 struct lttng_consumer_stream *stream, uint64_t *seq)
235{
236 return -ENOSYS;
237}
70190e1c
DG
238static inline
239int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
240 uint64_t *stream_id)
241{
242 return -ENOSYS;
243}
74d0b642 244#endif /* HAVE_LIBLTTNG_UST_CTL */
3bd1e081
MD
245
246#endif /* _LTTNG_USTCONSUMER_H */
This page took 0.115141 seconds and 4 git commands to generate.