Add channel wakeup fd to monitor close
[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);
33
34int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
35 int sock, struct pollfd *consumer_sockpoll);
36
37extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan);
38extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
39extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
40extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
41
42int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
43 struct lttng_consumer_local_data *ctx);
44int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
45
46void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
47
48int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
49 unsigned long *off);
50void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream);
51int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
52void lttng_ustconsumer_close_metadata(struct lttng_ht *ht);
53
54#else /* HAVE_LIBLTTNG_UST_CTL */
55
56static inline
57ssize_t lttng_ustconsumer_on_read_subbuffer_mmap(
58 struct lttng_consumer_local_data *ctx,
59 struct lttng_consumer_stream *stream, unsigned long len,
60 unsigned long padding)
61{
62 return -ENOSYS;
63}
64
65static inline
66ssize_t lttng_ustconsumer_on_read_subbuffer_splice(
67 struct lttng_consumer_local_data *ctx,
68 struct lttng_consumer_stream *uststream, unsigned long len,
69 unsigned long padding)
70{
71 return -ENOSYS;
72}
73
74static inline
75int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream)
76{
77 return -ENOSYS;
78}
79
80static inline
81int lttng_ustconsumer_get_produced_snapshot(
82 struct lttng_consumer_stream *stream, unsigned long *pos)
83{
84 return -ENOSYS;
85}
86
87static inline
88int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
89 int sock, struct pollfd *consumer_sockpoll)
90{
91 return -ENOSYS;
92}
93
94static inline
95int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
96{
97 return -ENOSYS;
98}
99
100static inline
101void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
102{
103}
104
105static inline
106int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
107{
108 return -ENOSYS;
109}
110
111static inline
112void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
113{
114}
115
116static inline
117int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
118 struct lttng_consumer_local_data *ctx)
119{
120 return -ENOSYS;
121}
122
123static inline
124int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
125{
126 return -ENOSYS;
127}
128
129static inline
130void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream)
131{
132}
133
134static inline
135int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
136 unsigned long *off)
137{
138 return -ENOSYS;
139}
140static inline
141int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
142{
143 return -ENOSYS;
144}
145static inline
146void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream)
147{
148 return NULL;
149}
150static inline
151void lttng_ustconsumer_close_metadata(struct lttng_ht *ht)
152{
153}
154#endif /* HAVE_LIBLTTNG_UST_CTL */
155
156#endif /* _LTTNG_USTCONSUMER_H */
This page took 0.024454 seconds and 5 git commands to generate.