Fix: kconsumer: missing wait for metadata thread in do_sync_metadata
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.h
CommitLineData
3bd1e081
MD
1/*
2 * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
3 * Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
d14d33bf
AM
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2 only,
7 * as published by the Free Software Foundation.
3bd1e081
MD
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d14d33bf 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3bd1e081
MD
12 * GNU General Public License for more details.
13 *
d14d33bf
AM
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3bd1e081
MD
17 */
18
19#ifndef _LTTNG_USTCONSUMER_H
20#define _LTTNG_USTCONSUMER_H
21
3bd1e081
MD
22#include <errno.h>
23
c8fea79c 24#include <common/consumer/consumer.h>
02d02e31 25#include <stdbool.h>
10a8a223 26
74d0b642 27#ifdef HAVE_LIBLTTNG_UST_CTL
3bd1e081 28
ffe60014 29int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream);
e9404c27
JG
30int lttng_ustconsumer_sample_snapshot_positions(
31 struct lttng_consumer_stream *stream);
3bd1e081 32
3bd1e081 33int lttng_ustconsumer_get_produced_snapshot(
ffe60014 34 struct lttng_consumer_stream *stream, unsigned long *pos);
10a50311
JD
35int lttng_ustconsumer_get_consumed_snapshot(
36 struct lttng_consumer_stream *stream, unsigned long *pos);
3bd1e081
MD
37
38int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
39 int sock, struct pollfd *consumer_sockpoll);
40
41extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan);
42extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
b83e03c4 43extern void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan);
e316aad5 44extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
3bd1e081
MD
45extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
46
d41f73b7 47int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
e5148e25 48 struct lttng_consumer_local_data *ctx);
d41f73b7
MD
49int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
50
d056b477
MD
51void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
52
fc6d7a51
JD
53void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream,
54 int producer_active);
70190e1c
DG
55int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
56 uint64_t *stream_id);
6d805429 57int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
6d574024
DG
58void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht);
59void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata);
d8ef542d 60void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream);
331744e3 61int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
93ec662e
JD
62 uint64_t len, uint64_t version,
63 struct lttng_consumer_channel *channel, int timer, int wait);
331744e3 64int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
94d49140 65 struct lttng_consumer_channel *channel, int timer, int wait);
27e2fa5d
JG
66enum sync_metadata_status lttng_ustconsumer_sync_metadata(
67 struct lttng_consumer_local_data *ctx,
94d49140 68 struct lttng_consumer_stream *metadata);
84a182ce
DG
69void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
70 int producer);
71int lttng_ustconsumer_get_current_timestamp(
72 struct lttng_consumer_stream *stream, uint64_t *ts);
fb83fe64
JD
73int lttng_ustconsumer_get_sequence_number(
74 struct lttng_consumer_stream *stream, uint64_t *seq);
f02e1e8a 75
74d0b642 76#else /* HAVE_LIBLTTNG_UST_CTL */
3bd1e081
MD
77
78static inline
4078b776 79ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
3bd1e081 80 struct lttng_consumer_local_data *ctx,
1d4dfdef
DG
81 struct lttng_consumer_stream *stream, unsigned long len,
82 unsigned long padding)
3bd1e081
MD
83{
84 return -ENOSYS;
85}
86
87static inline
4078b776 88ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
3bd1e081 89 struct lttng_consumer_local_data *ctx,
1d4dfdef
DG
90 struct lttng_consumer_stream *uststream, unsigned long len,
91 unsigned long padding)
3bd1e081
MD
92{
93 return -ENOSYS;
94}
95
96static inline
ffe60014 97int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream)
3bd1e081
MD
98{
99 return -ENOSYS;
100}
101
e9404c27
JG
102static inline
103int lttng_ustconsumer_sample_snapshot_positions(
104 struct lttng_consumer_stream *stream)
105{
106 return -ENOSYS;
107}
108
3bd1e081
MD
109static inline
110int lttng_ustconsumer_get_produced_snapshot(
ffe60014 111 struct lttng_consumer_stream *stream, unsigned long *pos)
3bd1e081
MD
112{
113 return -ENOSYS;
114}
115
e9404c27
JG
116static inline
117int lttng_ustconsumer_get_consumed_snapshot(
118 struct lttng_consumer_stream *stream, unsigned long *pos)
119{
120 return -ENOSYS;
121}
122
3bd1e081
MD
123static inline
124int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
fbc72522
DG
125 int sock, struct pollfd *consumer_sockpoll)
126{
127 return -ENOSYS;
128}
3bd1e081
MD
129
130static inline
131int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
132{
133 return -ENOSYS;
134}
135
136static inline
137void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
138{
139}
140
b83e03c4
MD
141static inline
142void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
143{
144}
145
3bd1e081 146static inline
e316aad5 147int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
3bd1e081
MD
148{
149 return -ENOSYS;
150}
151
152static inline
153void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
154{
155}
156
d41f73b7
MD
157static inline
158int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
e5148e25 159 struct lttng_consumer_local_data *ctx)
d41f73b7
MD
160{
161 return -ENOSYS;
162}
163
164static inline
165int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
166{
167 return -ENOSYS;
168}
169
d056b477
MD
170static inline
171void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream)
172{
173}
174
f02e1e8a 175static inline
ffe60014
DG
176int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
177 unsigned long *off)
f02e1e8a
DG
178{
179 return -ENOSYS;
180}
ca22feea 181static inline
6d805429 182int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
ca22feea
DG
183{
184 return -ENOSYS;
185}
ffe60014
DG
186static inline
187void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream)
188{
189 return NULL;
190}
d88aee68 191static inline
fc6d7a51
JD
192void lttng_ustctl_flush_buffer(struct lttng_consumer_stream *stream,
193 int producer_active)
194{
195}
196static inline
6d574024
DG
197void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht)
198{
199}
200static inline
201void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata)
d88aee68
DG
202{
203}
d8ef542d
MD
204static inline
205void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream)
206{
207}
ee69440b
DG
208static inline
209int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
93ec662e
JD
210 uint64_t len, uint64_t version,
211 struct lttng_consumer_channel *channel, int timer)
ee69440b
DG
212{
213 return -ENOSYS;
214}
215static inline
ee69440b 216int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
84a182ce 217 struct lttng_consumer_channel *channel, int timer, int wait)
ee69440b
DG
218{
219 return -ENOSYS;
220}
94d49140 221static inline
27e2fa5d 222enum sync_metadata_status lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
94d49140
JD
223 struct lttng_consumer_stream *metadata)
224{
27e2fa5d 225 return SYNC_METADATA_STATUS_ERROR;
94d49140 226}
84a182ce
DG
227static inline
228void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
229 int producer)
230{
231}
232static inline
233int lttng_ustconsumer_get_current_timestamp(
234 struct lttng_consumer_stream *stream, uint64_t *ts)
235{
236 return -ENOSYS;
237}
a31c9f22 238static inline
fb83fe64
JD
239int lttng_ustconsumer_get_sequence_number(
240 struct lttng_consumer_stream *stream, uint64_t *seq)
241{
242 return -ENOSYS;
243}
70190e1c
DG
244static inline
245int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
246 uint64_t *stream_id)
247{
248 return -ENOSYS;
249}
74d0b642 250#endif /* HAVE_LIBLTTNG_UST_CTL */
3bd1e081
MD
251
252#endif /* _LTTNG_USTCONSUMER_H */
This page took 0.065247 seconds and 4 git commands to generate.