{
struct lttng_ht_node_u64 *node;
struct lttng_ht_iter iter;
- struct relay_stream *stream = NULL;
+ struct relay_stream *stream = nullptr;
rcu_read_lock();
lttng_ht_lookup(relay_streams_ht, &stream_id, &iter);
}
stream = lttng::utils::container_of(node, &relay_stream::node);
if (!stream_get(stream)) {
- stream = NULL;
+ stream = nullptr;
}
end:
rcu_read_unlock();
stream->channel_name,
stream->tracefile_size,
stream->tracefile_current_index,
- NULL,
+ nullptr,
stream_path,
sizeof(stream_path));
if (ret < 0) {
if (stream->file) {
fs_handle_close(stream->file);
- stream->file = NULL;
+ stream->file = nullptr;
}
stream->tracefile_wrapped_around = false;
off_t lseek_ret, previous_stream_copy_origin;
uint64_t copy_bytes_left, misplaced_data_size;
bool acquired_reference;
- struct fs_handle *previous_stream_file = NULL;
- struct lttng_trace_chunk *previous_chunk = NULL;
+ struct fs_handle *previous_stream_file = nullptr;
+ struct lttng_trace_chunk *previous_chunk = nullptr;
if (!LTTNG_OPTIONAL_GET(stream->ongoing_rotation).next_trace_chunk) {
ERR("Protocol error encoutered in %s(): stream rotation "
*/
LTTNG_ASSERT(stream->file);
previous_stream_file = stream->file;
- stream->file = NULL;
+ stream->file = nullptr;
LTTNG_ASSERT(!stream->is_metadata);
LTTNG_ASSERT(stream->tracefile_size_current > stream->pos_after_last_complete_data_index);
{
int ret;
uint32_t major, minor;
- char *index_subpath = NULL;
+ char *index_subpath = nullptr;
enum lttng_trace_chunk_status status;
ASSERT_LOCKED(stream->lock);
/* Put ref on previous index_file. */
if (stream->index_file) {
lttng_index_file_put(stream->index_file);
- stream->index_file = NULL;
+ stream->index_file = nullptr;
}
major = stream->trace->session->major;
minor = stream->trace->session->minor;
DBG("Rotating stream %" PRIu64 " index file", stream->stream_handle);
if (stream->index_file) {
lttng_index_file_put(stream->index_file);
- stream->index_file = NULL;
+ stream->index_file = nullptr;
}
stream->ongoing_rotation.value.index_rotated = true;
if (stream->file) {
fs_handle_close(stream->file);
- stream->file = NULL;
+ stream->file = nullptr;
}
ret = stream_create_data_output_file_from_trace_chunk(stream, chunk, false, &stream->file);
end:
uint64_t tracefile_count)
{
int ret;
- struct relay_stream *stream = NULL;
+ struct relay_stream *stream = nullptr;
struct relay_session *session = trace->session;
bool acquired_reference = false;
struct lttng_trace_chunk *current_trace_chunk;
stream = zmalloc<relay_stream>();
- if (stream == NULL) {
+ if (stream == nullptr) {
PERROR("relay stream zmalloc");
goto error_no_alloc;
}
stream->channel_name = channel_name;
stream->beacon_ts_end = -1ULL;
lttng_ht_node_init_u64(&stream->node, stream->stream_handle);
- pthread_mutex_init(&stream->lock, NULL);
+ pthread_mutex_init(&stream->lock, nullptr);
urcu_ref_init(&stream->ref);
ctf_trace_get(trace);
stream->trace = trace;
if (ret) {
if (stream->file) {
fs_handle_close(stream->file);
- stream->file = NULL;
+ stream->file = nullptr;
}
stream_put(stream);
- stream = NULL;
+ stream = nullptr;
}
if (acquired_reference) {
lttng_trace_chunk_put(current_trace_chunk);
*/
free(path_name);
free(channel_name);
- return NULL;
+ return nullptr;
}
/*
if (stream->file) {
fs_handle_close(stream->file);
- stream->file = NULL;
+ stream->file = nullptr;
}
if (stream->index_file) {
lttng_index_file_put(stream->index_file);
- stream->index_file = NULL;
+ stream->index_file = nullptr;
}
if (stream->trace) {
ctf_trace_put(stream->trace);
- stream->trace = NULL;
+ stream->trace = nullptr;
}
stream_complete_rotation(stream);
lttng_trace_chunk_put(stream->trace_chunk);
- stream->trace_chunk = NULL;
+ stream->trace_chunk = nullptr;
call_rcu(&stream->rcu_node, stream_destroy_rcu);
}
/* Put stream fd before put chunk. */
if (stream->file) {
fs_handle_close(stream->file);
- stream->file = NULL;
+ stream->file = nullptr;
}
if (stream->index_file) {
lttng_index_file_put(stream->index_file);
- stream->index_file = NULL;
+ stream->index_file = nullptr;
}
lttng_trace_chunk_put(stream->trace_chunk);
- stream->trace_chunk = NULL;
+ stream->trace_chunk = nullptr;
pthread_mutex_unlock(&stream->lock);
DBG("Succeeded in closing stream %" PRIu64, stream->stream_handle);
stream_put(stream);
if (stream->file) {
fs_handle_close(stream->file);
- stream->file = NULL;
+ stream->file = nullptr;
}
ret = stream_create_data_output_file_from_trace_chunk(
stream, stream->trace_chunk, false, &stream->file);
stream->stream_handle);
/* Put self-ref for this index due to error. */
relay_index_put(index);
- index = NULL;
+ index = nullptr;
goto end;
}
}
ret = -1;
/* Put self-ref for this index due to error. */
relay_index_put(index);
- index = NULL;
+ index = nullptr;
goto end;
}
stream->channel_name,
stream->stream_handle);
}
- stream->file = NULL;
+ stream->file = nullptr;
}
DBG("%s: reset tracefile_size_current for stream %" PRIu64 " was %" PRIu64,
stream, stream->trace_chunk, true, &stream->file);
}
-void print_relay_streams(void)
+void print_relay_streams()
{
struct lttng_ht_iter iter;
struct relay_stream *stream;