Fix: make ust consumer posix compliant for poll flags
[lttng-tools.git] / src / common / kernel-consumer / kernel-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
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; only version 2
8 * of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */
19
20 #ifndef _LTTNG_KCONSUMER_H
21 #define _LTTNG_KCONSUMER_H
22
23 #include <common/consumer.h>
24
25 /*
26 * Mmap the ring buffer, read it and write the data to the tracefile.
27 *
28 * Returns the number of bytes written, or negative value on error.
29 */
30 extern ssize_t lttng_kconsumer_on_read_subbuffer_mmap(
31 struct lttng_consumer_local_data *ctx,
32 struct lttng_consumer_stream *stream, unsigned long len);
33
34 /*
35 * Splice the data from the ring buffer to the tracefile.
36 *
37 * Returns the number of bytes spliced, or negative error value on
38 * error.
39 */
40 extern ssize_t lttng_kconsumer_on_read_subbuffer_splice(
41 struct lttng_consumer_local_data *ctx,
42 struct lttng_consumer_stream *stream, unsigned long len);
43
44 /*
45 * Take a snapshot for a specific fd
46 *
47 * Returns 0 on success, < 0 on error
48 */
49 int lttng_kconsumer_take_snapshot(struct lttng_consumer_local_data *ctx,
50 struct lttng_consumer_stream *stream);
51
52 /*
53 * Get the produced position
54 *
55 * Returns 0 on success, < 0 on error
56 */
57 int lttng_kconsumer_get_produced_snapshot(
58 struct lttng_consumer_local_data *ctx,
59 struct lttng_consumer_stream *stream,
60 unsigned long *pos);
61
62 int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
63 int sock, struct pollfd *consumer_sockpoll);
64
65
66 ssize_t lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
67 struct lttng_consumer_local_data *ctx);
68 int lttng_kconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
69
70 #endif /* _LTTNG_KCONSUMER_H */
This page took 0.043706 seconds and 4 git commands to generate.