Test for new metadata at each packet
[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 * 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
29int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream);
30
31int lttng_ustconsumer_get_produced_snapshot(
32 struct lttng_consumer_stream *stream, unsigned long *pos);
33int lttng_ustconsumer_get_consumed_snapshot(
34 struct lttng_consumer_stream *stream, unsigned long *pos);
35
36int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
37 int sock, struct pollfd *consumer_sockpoll);
38
39extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan);
40extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
41extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
42extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
43
44int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
45 struct lttng_consumer_local_data *ctx);
46int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
47
48void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
49
50int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
51 unsigned long *off);
52void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream);
53int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
54void lttng_ustconsumer_close_metadata(struct lttng_ht *ht);
55void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream);
56int 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);
59int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
60 struct lttng_consumer_channel *channel, int timer, int wait);
61int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
62 struct lttng_consumer_stream *metadata);
63
64#else /* HAVE_LIBLTTNG_UST_CTL */
65
66static inline
67ssize_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
75static inline
76ssize_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
84static inline
85int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream)
86{
87 return -ENOSYS;
88}
89
90static inline
91int lttng_ustconsumer_get_produced_snapshot(
92 struct lttng_consumer_stream *stream, unsigned long *pos)
93{
94 return -ENOSYS;
95}
96
97static inline
98int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
99 int sock, struct pollfd *consumer_sockpoll)
100{
101 return -ENOSYS;
102}
103
104static inline
105int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
106{
107 return -ENOSYS;
108}
109
110static inline
111void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
112{
113}
114
115static inline
116int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
117{
118 return -ENOSYS;
119}
120
121static inline
122void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
123{
124}
125
126static inline
127int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
128 struct lttng_consumer_local_data *ctx)
129{
130 return -ENOSYS;
131}
132
133static inline
134int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
135{
136 return -ENOSYS;
137}
138
139static inline
140void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream)
141{
142}
143
144static inline
145int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
146 unsigned long *off)
147{
148 return -ENOSYS;
149}
150static inline
151int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
152{
153 return -ENOSYS;
154}
155static inline
156void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream)
157{
158 return NULL;
159}
160static inline
161void lttng_ustconsumer_close_metadata(struct lttng_ht *ht)
162{
163}
164static inline
165void lttng_ustconsumer_close_stream_wakeup(struct lttng_consumer_stream *stream)
166{
167}
168static inline
169int 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}
175static inline
176int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
177 struct lttng_consumer_channel *channel, int timer)
178{
179 return -ENOSYS;
180}
181static inline
182int 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.022541 seconds and 4 git commands to generate.