X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.c;h=3c51cfa6f40221cff9c2ee8ce65b8788c3ca7afc;hp=09f0f0983a37cef21893e263d0ab2528b1d709f5;hb=1f8d1c146ba9c46338d04c416a75ee6d105c5c50;hpb=13e3b28009f1f922da6021e43254db86b78aa109 diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 09f0f0983..3c51cfa6f 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -709,11 +709,6 @@ void consumer_add_data_stream(struct lttng_consumer_stream *stream) pthread_mutex_unlock(&consumer_data.lock); } -void consumer_del_data_stream(struct lttng_consumer_stream *stream) -{ - consumer_del_stream(stream, data_ht); -} - /* * Add relayd socket to global consumer data hashtable. RCU read side lock MUST * be acquired before calling this. @@ -1014,13 +1009,6 @@ int lttng_consumer_channel_set_trace_chunk( struct lttng_consumer_channel *channel, struct lttng_trace_chunk *new_trace_chunk) { - int ret = 0; - const bool is_local_trace = channel->relayd_id == -1ULL; - bool update_stream_trace_chunk; - struct cds_lfht_iter iter; - struct lttng_consumer_stream *stream; - unsigned long channel_hash; - pthread_mutex_lock(&channel->lock); if (channel->is_deleted) { /* @@ -1032,24 +1020,6 @@ int lttng_consumer_channel_set_trace_chunk( */ goto end; } - /* - * A stream can transition to a state where it and its channel - * no longer belong to a trace chunk. For instance, this happens when - * a session is rotated while it is inactive. After the rotation - * of an inactive session completes, the channel and its streams no - * longer belong to a trace chunk. - * - * However, if a session is stopped, rotated, and started again, - * the session daemon will create a new chunk and send it to its peers. - * In that case, the streams' transition to a new chunk can be performed - * immediately. - * - * This trace chunk transition could also be performed lazily when - * a buffer is consumed. However, creating the files here allows the - * consumer daemon to report any creation error to the session daemon - * and cause the start of the tracing session to fail. - */ - update_stream_trace_chunk = !channel->trace_chunk && new_trace_chunk; /* * The acquisition of the reference cannot fail (barring @@ -1065,59 +1035,9 @@ int lttng_consumer_channel_set_trace_chunk( lttng_trace_chunk_put(channel->trace_chunk); channel->trace_chunk = new_trace_chunk; - if (!is_local_trace || !new_trace_chunk) { - /* Not an error. */ - goto end; - } - - if (!update_stream_trace_chunk) { - goto end; - } - - channel_hash = consumer_data.stream_per_chan_id_ht->hash_fct( - &channel->key, lttng_ht_seed); - rcu_read_lock(); - cds_lfht_for_each_entry_duplicate(consumer_data.stream_per_chan_id_ht->ht, - channel_hash, - consumer_data.stream_per_chan_id_ht->match_fct, - &channel->key, &iter, stream, node_channel_id.node) { - bool acquired_reference, should_regenerate_metadata = false; - - acquired_reference = lttng_trace_chunk_get(channel->trace_chunk); - assert(acquired_reference); - - pthread_mutex_lock(&stream->lock); - - /* - * On a transition from "no-chunk" to a new chunk, a metadata - * stream's content must be entirely dumped. This must occcur - * _after_ the creation of the metadata stream's output files - * as the consumption thread (not necessarily the one executing - * this) may start to consume during the call to - * consumer_metadata_stream_dump(). - */ - should_regenerate_metadata = - stream->metadata_flag && - !stream->trace_chunk && channel->trace_chunk; - stream->trace_chunk = channel->trace_chunk; - ret = consumer_stream_create_output_files(stream, true); - if (ret) { - pthread_mutex_unlock(&stream->lock); - goto end_rcu_unlock; - } - if (should_regenerate_metadata) { - ret = consumer_metadata_stream_dump(stream); - } - pthread_mutex_unlock(&stream->lock); - if (ret) { - goto end_rcu_unlock; - } - } -end_rcu_unlock: - rcu_read_unlock(); end: pthread_mutex_unlock(&channel->lock); - return ret; + return 0; } /* @@ -2254,6 +2174,7 @@ int lttng_consumer_recv_cmd(struct lttng_consumer_local_data *ctx, } } +static void lttng_consumer_close_all_metadata(void) { switch (consumer_data.type) { @@ -4435,7 +4356,7 @@ enum lttcomm_return_code lttng_consumer_init_command( const lttng_uuid sessiond_uuid) { enum lttcomm_return_code ret; - char uuid_str[UUID_STR_LEN]; + char uuid_str[LTTNG_UUID_STR_LEN]; if (ctx->sessiond_uuid.is_set) { ret = LTTCOMM_CONSUMERD_ALREADY_SET;