/*
- * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
- * David Goulet <dgoulet@efficios.com>
- * 2015 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- * 2019 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
+ * Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
+ * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * 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.
*/
#define _LGPL_SOURCE
lttng_trace_chunk_put(stream->trace_chunk);
stream->trace_chunk = stream->ongoing_rotation.value.next_trace_chunk;
stream->ongoing_rotation = (typeof(stream->ongoing_rotation)) {};
+ stream->completed_rotation_count++;
}
static int stream_create_data_output_file_from_trace_chunk(
* trace chunk.
*/
acquired_reference = lttng_trace_chunk_get(stream->trace_chunk);
- assert(acquired_reference);
+ LTTNG_ASSERT(acquired_reference);
previous_chunk = stream->trace_chunk;
/*
* the orinal stream_fd will be used to copy the "extra" data
* to the new file.
*/
- assert(stream->file);
+ LTTNG_ASSERT(stream->file);
previous_stream_file = stream->file;
stream->file = NULL;
- assert(!stream->is_metadata);
- assert(stream->tracefile_size_current >
+ LTTNG_ASSERT(!stream->is_metadata);
+ LTTNG_ASSERT(stream->tracefile_size_current >
stream->pos_after_last_complete_data_index);
misplaced_data_size = stream->tracefile_size_current -
stream->pos_after_last_complete_data_index;
goto end;
}
- assert(stream->file);
+ LTTNG_ASSERT(stream->file);
/*
* Seek the current tracefile to the position at which the rotation
* should have occurred.
* In overwrite mode, the packet seq num may jump over the
* rotation position.
*/
- assert(LTTNG_OPTIONAL_GET(stream->received_packet_seq_num) + 1 >=
+ LTTNG_ASSERT(LTTNG_OPTIONAL_GET(stream->received_packet_seq_num) + 1 >=
stream->ongoing_rotation.value.packet_seq_num);
DBG("Rotating stream %" PRIu64 " index file",
stream->stream_handle);
lttng_trace_chunk_put(stream->trace_chunk);
acquired_reference = lttng_trace_chunk_get(chunk);
- assert(acquired_reference);
+ LTTNG_ASSERT(acquired_reference);
stream->trace_chunk = chunk;
if (stream->file) {
iter.iter.node = &stream->node.node;
ret = lttng_ht_del(relay_streams_ht, &iter);
- assert(!ret);
+ LTTNG_ASSERT(!ret);
stream->in_stream_ht = false;
}
if (stream->published) {
void stream_put(struct relay_stream *stream)
{
rcu_read_lock();
- assert(stream->ref.refcount != 0);
+ LTTNG_ASSERT(stream->ref.refcount != 0);
/*
* Wait until we have processed all the stream packets before
* actually putting our last stream reference.
const bool reference_acquired =
lttng_trace_chunk_get(next_trace_chunk);
- assert(reference_acquired);
+ LTTNG_ASSERT(reference_acquired);
}
LTTNG_OPTIONAL_SET(&stream->ongoing_rotation, rotation);
uint64_t data_offset;
struct relay_index *index;
- assert(stream->trace_chunk);
+ LTTNG_ASSERT(stream->trace_chunk);
ASSERT_LOCKED(stream->lock);
/* Get data offset because we are about to update the index. */
data_offset = htobe64(stream->tracefile_size_current);