Fix: add globally visible flag in stream
[lttng-tools.git] / src / common / consumer.c
index 0005b1039cb27d6ced5dfac3537e72bbf737fce0..3aafb519380b334099d584b83ca17d9b201ed6e1 100644 (file)
@@ -292,21 +292,22 @@ void consumer_del_channel(struct lttng_consumer_channel *channel)
 
        pthread_mutex_lock(&consumer_data.lock);
 
+       /* Delete streams that might have been left in the stream list. */
+       cds_list_for_each_entry_safe(stream, stmp, &channel->streams.head,
+                       send_node) {
+               cds_list_del(&stream->send_node);
+               /*
+                * Once a stream is added to this list, the buffers were created so
+                * we have a guarantee that this call will succeed.
+                */
+               consumer_stream_destroy(stream, NULL);
+       }
+
        switch (consumer_data.type) {
        case LTTNG_CONSUMER_KERNEL:
                break;
        case LTTNG_CONSUMER32_UST:
        case LTTNG_CONSUMER64_UST:
-               /* Delete streams that might have been left in the stream list. */
-               cds_list_for_each_entry_safe(stream, stmp, &channel->streams.head,
-                               send_node) {
-                       cds_list_del(&stream->send_node);
-                       /*
-                        * Once a stream is added to this list, the buffers were created so
-                        * we have a guarantee that this call will succeed.
-                        */
-                       consumer_stream_destroy(stream, NULL);
-               }
                lttng_ustconsumer_del_channel(channel);
                break;
        default:
@@ -464,7 +465,8 @@ struct lttng_consumer_stream *consumer_allocate_stream(uint64_t channel_key,
                uint64_t session_id,
                int cpu,
                int *alloc_ret,
-               enum consumer_channel_type type)
+               enum consumer_channel_type type,
+               unsigned int monitor)
 {
        int ret;
        struct lttng_consumer_stream *stream;
@@ -486,6 +488,7 @@ struct lttng_consumer_stream *consumer_allocate_stream(uint64_t channel_key,
        stream->gid = gid;
        stream->net_seq_idx = relayd_id;
        stream->session_id = session_id;
+       stream->monitor = monitor;
        pthread_mutex_init(&stream->lock, NULL);
 
        /* If channel is the metadata, flag this stream as metadata. */
This page took 0.023748 seconds and 4 git commands to generate.