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