Adapt to namespaced liblttng-ust-ctl symbols
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 *
7 */
8
9#ifndef _LTTNG_USTCONSUMER_H
10#define _LTTNG_USTCONSUMER_H
11
12#include <common/compat/errno.h>
13#include <common/consumer/consumer.h>
14#include <stdbool.h>
15
16#ifdef HAVE_LIBLTTNG_UST_CTL
17
18int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream);
19int lttng_ustconsumer_sample_snapshot_positions(
20 struct lttng_consumer_stream *stream);
21
22int lttng_ustconsumer_get_produced_snapshot(
23 struct lttng_consumer_stream *stream, unsigned long *pos);
24int lttng_ustconsumer_get_consumed_snapshot(
25 struct lttng_consumer_stream *stream, unsigned long *pos);
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);
32extern void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan);
33extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
34extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
35
36int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
37 struct lttng_consumer_local_data *ctx);
38int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
39
40void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
41
42void lttng_lttng_ust_ctl_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);
46int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
47void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht);
48void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata);
49void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream);
50int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
51 uint64_t len, uint64_t version,
52 struct lttng_consumer_channel *channel, int timer, int wait);
53int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
54 struct lttng_consumer_channel *channel, int timer, int wait);
55enum sync_metadata_status lttng_ustconsumer_sync_metadata(
56 struct lttng_consumer_local_data *ctx,
57 struct lttng_consumer_stream *metadata);
58void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
59 int producer);
60void lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream);
61int lttng_ustconsumer_get_current_timestamp(
62 struct lttng_consumer_stream *stream, uint64_t *ts);
63int lttng_ustconsumer_get_sequence_number(
64 struct lttng_consumer_stream *stream, uint64_t *seq);
65
66#else /* HAVE_LIBLTTNG_UST_CTL */
67
68static inline
69ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
70 struct lttng_consumer_local_data *ctx,
71 struct lttng_consumer_stream *stream, unsigned long len,
72 unsigned long padding)
73{
74 return -ENOSYS;
75}
76
77static inline
78ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
79 struct lttng_consumer_local_data *ctx,
80 struct lttng_consumer_stream *uststream, unsigned long len,
81 unsigned long padding)
82{
83 return -ENOSYS;
84}
85
86static inline
87int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream)
88{
89 return -ENOSYS;
90}
91
92static inline
93int lttng_ustconsumer_sample_snapshot_positions(
94 struct lttng_consumer_stream *stream)
95{
96 return -ENOSYS;
97}
98
99static inline
100int lttng_ustconsumer_get_produced_snapshot(
101 struct lttng_consumer_stream *stream, unsigned long *pos)
102{
103 return -ENOSYS;
104}
105
106static inline
107int lttng_ustconsumer_get_consumed_snapshot(
108 struct lttng_consumer_stream *stream, unsigned long *pos)
109{
110 return -ENOSYS;
111}
112
113static inline
114int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
115 int sock, struct pollfd *consumer_sockpoll)
116{
117 return -ENOSYS;
118}
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
131static inline
132void lttng_ustconsumer_free_channel(struct lttng_consumer_channel *chan)
133{
134}
135
136static inline
137int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
138{
139 return -ENOSYS;
140}
141
142static inline
143void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
144{
145}
146
147static inline
148int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
149 struct lttng_consumer_local_data *ctx)
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
160static inline
161void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream)
162{
163}
164
165static inline
166int lttng_lttng_ust_ctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
167 unsigned long *off)
168{
169 return -ENOSYS;
170}
171static inline
172int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
173{
174 return -ENOSYS;
175}
176static inline
177void *lttng_lttng_ust_ctl_get_mmap_base(struct lttng_consumer_stream *stream)
178{
179 return NULL;
180}
181static inline
182void lttng_lttng_ust_ctl_flush_buffer(struct lttng_consumer_stream *stream,
183 int producer_active)
184{
185}
186static inline
187void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht)
188{
189}
190static inline
191void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata)
192{
193}
194static inline
195void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream)
196{
197}
198static inline
199int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
200 uint64_t len, uint64_t version,
201 struct lttng_consumer_channel *channel, int timer)
202{
203 return -ENOSYS;
204}
205static inline
206int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
207 struct lttng_consumer_channel *channel, int timer, int wait)
208{
209 return -ENOSYS;
210}
211static inline
212enum sync_metadata_status lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
213 struct lttng_consumer_stream *metadata)
214{
215 return SYNC_METADATA_STATUS_ERROR;
216}
217static inline
218void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
219 int producer)
220{
221}
222static inline
223void lttng_ustconsumer_clear_buffer(struct lttng_consumer_stream *stream)
224{
225}
226static inline
227int lttng_ustconsumer_get_current_timestamp(
228 struct lttng_consumer_stream *stream, uint64_t *ts)
229{
230 return -ENOSYS;
231}
232static inline
233int lttng_ustconsumer_get_sequence_number(
234 struct lttng_consumer_stream *stream, uint64_t *seq)
235{
236 return -ENOSYS;
237}
238static inline
239int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream,
240 uint64_t *stream_id)
241{
242 return -ENOSYS;
243}
244#endif /* HAVE_LIBLTTNG_UST_CTL */
245
246#endif /* _LTTNG_USTCONSUMER_H */
This page took 0.024429 seconds and 4 git commands to generate.