Test for new metadata at each packet
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.h
1 /*
2 * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca>
3 * Copyright (C) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 *
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.
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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
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.
17 */
18
19 #ifndef _LTTNG_USTCONSUMER_H
20 #define _LTTNG_USTCONSUMER_H
21
22 #include <config.h>
23 #include <errno.h>
24
25 #include <common/consumer.h>
26
27 #ifdef HAVE_LIBLTTNG_UST_CTL
28
29 int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream);
30
31 int lttng_ustconsumer_get_produced_snapshot(
32 struct lttng_consumer_stream *stream, unsigned long *pos);
33 int lttng_ustconsumer_get_consumed_snapshot(
34 struct lttng_consumer_stream *stream, unsigned long *pos);
35
36 int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
37 int sock, struct pollfd *consumer_sockpoll);
38
39 extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan);
40 extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
41 extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
42 extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
43
44 int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
45 struct lttng_consumer_local_data *ctx);
46 int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
47
48 void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
49
50 int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
51 unsigned long *off);
52 void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream);
53 int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
54 void lttng_ustconsumer_close_metadata(struct lttng_ht *ht);
55 void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream);
56 int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
57 uint64_t len, struct lttng_consumer_channel *channel,
58 int timer, int wait);
59 int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
60 struct lttng_consumer_channel *channel, int timer, int wait);
61 int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
62 struct lttng_consumer_stream *metadata);
63
64 #else /* HAVE_LIBLTTNG_UST_CTL */
65
66 static inline
67 ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
68 struct lttng_consumer_local_data *ctx,
69 struct lttng_consumer_stream *stream, unsigned long len,
70 unsigned long padding)
71 {
72 return -ENOSYS;
73 }
74
75 static inline
76 ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
77 struct lttng_consumer_local_data *ctx,
78 struct lttng_consumer_stream *uststream, unsigned long len,
79 unsigned long padding)
80 {
81 return -ENOSYS;
82 }
83
84 static inline
85 int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream)
86 {
87 return -ENOSYS;
88 }
89
90 static inline
91 int lttng_ustconsumer_get_produced_snapshot(
92 struct lttng_consumer_stream *stream, unsigned long *pos)
93 {
94 return -ENOSYS;
95 }
96
97 static inline
98 int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
99 int sock, struct pollfd *consumer_sockpoll)
100 {
101 return -ENOSYS;
102 }
103
104 static inline
105 int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
106 {
107 return -ENOSYS;
108 }
109
110 static inline
111 void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
112 {
113 }
114
115 static inline
116 int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
117 {
118 return -ENOSYS;
119 }
120
121 static inline
122 void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
123 {
124 }
125
126 static inline
127 int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
128 struct lttng_consumer_local_data *ctx)
129 {
130 return -ENOSYS;
131 }
132
133 static inline
134 int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
135 {
136 return -ENOSYS;
137 }
138
139 static inline
140 void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream)
141 {
142 }
143
144 static inline
145 int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
146 unsigned long *off)
147 {
148 return -ENOSYS;
149 }
150 static inline
151 int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
152 {
153 return -ENOSYS;
154 }
155 static inline
156 void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream)
157 {
158 return NULL;
159 }
160 static inline
161 void lttng_ustconsumer_close_metadata(struct lttng_ht *ht)
162 {
163 }
164 static inline
165 void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream)
166 {
167 }
168 static inline
169 int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset,
170 uint64_t len, struct lttng_consumer_channel *channel,
171 int timer)
172 {
173 return -ENOSYS;
174 }
175 static inline
176 int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
177 struct lttng_consumer_channel *channel, int timer)
178 {
179 return -ENOSYS;
180 }
181 static inline
182 int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
183 struct lttng_consumer_stream *metadata)
184 {
185 return -ENOSYS;
186 }
187 #endif /* HAVE_LIBLTTNG_UST_CTL */
188
189 #endif /* _LTTNG_USTCONSUMER_H */
This page took 0.032616 seconds and 4 git commands to generate.