2 * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
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.
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
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.
18 #ifndef LTTNG_CONSUMER_STREAM_H
19 #define LTTNG_CONSUMER_STREAM_H
24 * Close stream's file descriptors and, if needed, close stream also on the
27 * The stream lock MUST be acquired.
28 * The consumer data lock MUST be acquired.
30 void consumer_stream_close(struct lttng_consumer_stream
*stream
);
33 * Close stream on the relayd side. This call can destroy a relayd if the
36 * A RCU read side lock MUST be acquired if the relayd object was looked up in
37 * a hash table before calling this.
39 void consumer_stream_relayd_close(struct lttng_consumer_stream
*stream
,
40 struct consumer_relayd_sock_pair
*relayd
);
43 * Delete the stream from all possible hash tables.
45 * The consumer data lock MUST be acquired.
47 void consumer_stream_delete(struct lttng_consumer_stream
*stream
,
51 * Free the given stream within a RCU call.
53 void consumer_stream_free(struct lttng_consumer_stream
*stream
);
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.
60 * This MUST be called WITHOUT the consumer data and stream lock acquired.
62 void consumer_stream_destroy(struct lttng_consumer_stream
*stream
,
66 * Destroy the stream's buffers on the tracer side. This is also called in a
69 void consumer_stream_destroy_buffers(struct lttng_consumer_stream
*stream
);
72 * Write index of a specific stream either on the relayd or local disk.
74 int consumer_stream_write_index(struct lttng_consumer_stream
*stream
,
75 struct lttng_packet_index
*index
);
77 int consumer_stream_sync_metadata(struct lttng_consumer_local_data
*ctx
,
80 #endif /* LTTNG_CONSUMER_STREAM_H */