Fix: consumerd: slow metadata push slows down application registration
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.h
CommitLineData
3bd1e081 1/*
90c106c6 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
d85707b0
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 51 uint64_t len, uint64_t version,
95671f53
JG
52 struct lttng_consumer_channel *channel, bool invoked_by_timer,
53 int wait);
331744e3 54int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
95671f53
JG
55 struct lttng_consumer_channel *channel, bool invoked_by_timer,
56 int wait);
577eea73
JG
57enum sync_metadata_status lttng_ustconsumer_sync_metadata(
58 struct lttng_consumer_local_data *ctx,
94d49140 59 struct lttng_consumer_stream *metadata);
d85707b0 60int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
84a182ce 61 int producer);
d85707b0 62int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream);
84a182ce
DG
63int lttng_ustconsumer_get_current_timestamp(
64 struct lttng_consumer_stream *stream, uint64_t *ts);
fb83fe64
JD
65int lttng_ustconsumer_get_sequence_number(
66 struct lttng_consumer_stream *stream, uint64_t *seq);
d85707b0 67void lttng_ustconsumer_sigbus_handle(void *addr);
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
ca22feea 168static inline
6d805429 169int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
ca22feea
DG
170{
171 return -ENOSYS;
172}
ffe60014 173static inline
d85707b0 174int lttng_ust_flush_buffer(struct lttng_consumer_stream *stream,
fc6d7a51
JD
175 int producer_active)
176{
d85707b0 177 return -ENOSYS;
fc6d7a51
JD
178}
179static inline
6d574024
DG
180void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht)
181{
182}
183static inline
184void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata)
d88aee68
DG
185{
186}
d8ef542d
MD
187static inline
188void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream)
189{
190}
ee69440b
DG
191static inline
192int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
93ec662e
JD
193 uint64_t len, uint64_t version,
194 struct lttng_consumer_channel *channel, int timer)
ee69440b
DG
195{
196 return -ENOSYS;
197}
198static inline
ee69440b 199int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
84a182ce 200 struct lttng_consumer_channel *channel, int timer, int wait)
ee69440b
DG
201{
202 return -ENOSYS;
203}
94d49140 204static inline
577eea73 205enum sync_metadata_status lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
94d49140
JD
206 struct lttng_consumer_stream *metadata)
207{
577eea73 208 return SYNC_METADATA_STATUS_ERROR;
94d49140 209}
84a182ce 210static inline
d85707b0 211int lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
84a182ce
DG
212 int producer)
213{
d85707b0 214 return -ENOSYS;
84a182ce
DG
215}
216static inline
d85707b0 217int lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream)
214f70e0 218{
d85707b0 219 return -ENOSYS;
214f70e0
JR
220}
221static inline
84a182ce
DG
222int lttng_ustconsumer_get_current_timestamp(
223 struct lttng_consumer_stream *stream, uint64_t *ts)
224{
225 return -ENOSYS;
226}
a31c9f22 227static inline
fb83fe64
JD
228int lttng_ustconsumer_get_sequence_number(
229 struct lttng_consumer_stream *stream, uint64_t *seq)
230{
231 return -ENOSYS;
232}
70190e1c
DG
233static inline
234int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
235 uint64_t *stream_id)
236{
237 return -ENOSYS;
238}
d85707b0
MD
239static inline
240void lttng_ustconsumer_sigbus_handle(void *addr)
241{
242}
74d0b642 243#endif /* HAVE_LIBLTTNG_UST_CTL */
3bd1e081
MD
244
245#endif /* _LTTNG_USTCONSUMER_H */
This page took 0.082022 seconds and 4 git commands to generate.