Move metadata creation into lttng-sessiond and lttng-consumed
[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
34 int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
35 int sock, struct pollfd *consumer_sockpoll);
36
37 extern int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan);
38 extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
39 extern int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream);
40 extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
41
42 int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
43 struct lttng_consumer_local_data *ctx);
44 int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
45
46 void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream);
47
48 int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
49 unsigned long *off);
50 void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream);
51 int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream);
52 void lttng_ustconsumer_close_metadata(struct lttng_ht *ht);
53
54 #else /* HAVE_LIBLTTNG_UST_CTL */
55
56 static inline
57 ssize_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
65 static inline
66 ssize_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
74 static inline
75 int lttng_ustconsumer_take_snapshot(struct lttng_consumer_stream *stream)
76 {
77 return -ENOSYS;
78 }
79
80 static inline
81 int lttng_ustconsumer_get_produced_snapshot(
82 struct lttng_consumer_stream *stream, unsigned long *pos)
83 {
84 return -ENOSYS;
85 }
86
87 static inline
88 int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
89 int sock, struct pollfd *consumer_sockpoll)
90 {
91 return -ENOSYS;
92 }
93
94 static inline
95 int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
96 {
97 return -ENOSYS;
98 }
99
100 static inline
101 void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
102 {
103 }
104
105 static inline
106 int lttng_ustconsumer_add_stream(struct lttng_consumer_stream *stream)
107 {
108 return -ENOSYS;
109 }
110
111 static inline
112 void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
113 {
114 }
115
116 static inline
117 int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
118 struct lttng_consumer_local_data *ctx)
119 {
120 return -ENOSYS;
121 }
122
123 static inline
124 int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
125 {
126 return -ENOSYS;
127 }
128
129 static inline
130 void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream)
131 {
132 }
133
134 static inline
135 int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream,
136 unsigned long *off)
137 {
138 return -ENOSYS;
139 }
140 static inline
141 int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream)
142 {
143 return -ENOSYS;
144 }
145 static inline
146 void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream)
147 {
148 return NULL;
149 }
150 static inline
151 void 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.033739 seconds and 5 git commands to generate.