X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer-stream.h;h=cb1dafe3951a4a004cfc2b03864f11471de7d130;hp=44a5b0fc1efa42505c03af8054b12212c86687e6;hb=e2d1190b9ea09c54e5d7373643d62e2034bc1531;hpb=c35f9726a22f1d93e14589688d830efccda196f3 diff --git a/src/common/consumer/consumer-stream.h b/src/common/consumer/consumer-stream.h index 44a5b0fc1..cb1dafe39 100644 --- a/src/common/consumer/consumer-stream.h +++ b/src/common/consumer/consumer-stream.h @@ -1,18 +1,8 @@ /* - * Copyright (C) 2013 - David Goulet + * Copyright (C) 2013 David Goulet * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License, version 2 only, as - * published by the Free Software Foundation. + * SPDX-License-Identifier: GPL-2.0-only * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef LTTNG_CONSUMER_STREAM_H @@ -20,6 +10,24 @@ #include "consumer.h" +/* + * Create a consumer stream. + * + * The channel lock MUST be acquired. + */ +struct lttng_consumer_stream *consumer_stream_create( + struct lttng_consumer_channel *channel, + uint64_t channel_key, + uint64_t stream_key, + const char *channel_name, + uint64_t relayd_id, + uint64_t session_id, + struct lttng_trace_chunk *trace_chunk, + int cpu, + int *alloc_ret, + enum consumer_channel_type type, + unsigned int monitor); + /* * Close stream's file descriptors and, if needed, close stream also on the * relayd side. @@ -94,4 +102,22 @@ int consumer_stream_create_output_files(struct lttng_consumer_stream *stream, */ int consumer_stream_rotate_output_files(struct lttng_consumer_stream *stream); +/* + * Indicates whether or not a stream is logically deleted. A deleted stream + * should no longer be used; its existence is only garanteed by the RCU lock + * held by the caller. + * + * This function must be called with the RCU read side lock held. + */ +bool consumer_stream_is_deleted(struct lttng_consumer_stream *stream); + +/* + * Enable metadata bucketization. This must only be enabled if the tracer + * provides a reliable metadata `coherent` flag. + * + * This must be called on initialization before any subbuffer is consumed. + */ +int consumer_stream_enable_metadata_bucketization( + struct lttng_consumer_stream *stream); + #endif /* LTTNG_CONSUMER_STREAM_H */