79efa721e80388a934343254e56a8ac3a602dd8b
[lttng-tools.git] / src / common / consumer-stream.h
1 /*
2 * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #ifndef LTTNG_CONSUMER_STREAM_H
19 #define LTTNG_CONSUMER_STREAM_H
20
21 #include "consumer.h"
22
23 /*
24 * Close stream's file descriptors and, if needed, close stream also on the
25 * relayd side.
26 *
27 * The stream lock MUST be acquired.
28 * The consumer data lock MUST be acquired.
29 */
30 void consumer_stream_close(struct lttng_consumer_stream *stream);
31
32 /*
33 * Close stream on the relayd side. This call can destroy a relayd if the
34 * conditions are met.
35 *
36 * A RCU read side lock MUST be acquired if the relayd object was looked up in
37 * a hash table before calling this.
38 */
39 void consumer_stream_relayd_close(struct lttng_consumer_stream *stream,
40 struct consumer_relayd_sock_pair *relayd);
41
42 /*
43 * Delete the stream from all possible hash tables.
44 *
45 * The consumer data lock MUST be acquired.
46 */
47 void consumer_stream_delete(struct lttng_consumer_stream *stream,
48 struct lttng_ht *ht);
49
50 /*
51 * Free the given stream within a RCU call.
52 */
53 void consumer_stream_free(struct lttng_consumer_stream *stream);
54
55 /*
56 * Destroy a stream completely. This will delete, close and free the stream.
57 * Once return, the stream is NO longer usable. Its channel may get destroyed
58 * if conditions are met.
59 *
60 * This MUST be called WITHOUT the consumer data and stream lock acquired.
61 */
62 void consumer_stream_destroy(struct lttng_consumer_stream *stream,
63 struct lttng_ht *ht);
64
65 /*
66 * Destroy the stream's buffers on the tracer side. This is also called in a
67 * stream destroy.
68 */
69 void consumer_stream_destroy_buffers(struct lttng_consumer_stream *stream);
70
71 /*
72 * Write index of a specific stream either on the relayd or local disk.
73 */
74 int consumer_stream_write_index(struct lttng_consumer_stream *stream,
75 struct lttng_packet_index *index);
76
77 int consumer_stream_sync_metadata(struct lttng_consumer_local_data *ctx,
78 uint64_t session_id);
79
80 #endif /* LTTNG_CONSUMER_STREAM_H */
This page took 0.030172 seconds and 4 git commands to generate.