Add kernel snapshot support
[lttng-tools.git] / src / common / consumer-stream.c
index 24f1b8a42d14c580c013f3f38bac9b9576f3c89a..b5ab6c6bee2dc38ef615ff84f87129354abf86a2 100644 (file)
@@ -177,9 +177,15 @@ void consumer_stream_delete(struct lttng_consumer_stream *stream,
 
        rcu_read_unlock();
 
-       /* Decrement the stream count of the global consumer data. */
-       assert(consumer_data.stream_count > 0);
-       consumer_data.stream_count--;
+       /*
+        * For a *non* monitored stream, we MUST NOT decrement or else the data
+        * thread will use the wrong value or stream for its local stream set.
+        */
+       if (stream->chan->monitor) {
+               /* Decrement the stream count of the global consumer data. */
+               assert(consumer_data.stream_count > 0);
+               consumer_data.stream_count--;
+       }
 }
 
 /*
This page took 0.024164 seconds and 5 git commands to generate.