Tests: add consumer testpoint to pause data consumption
[lttng-tools.git] / src / common / consumer / consumer.c
index b2feb3945c8a40f3c1476e4dba7d9b659b8f9f8b..d07e5b4925317f026fbe8b9483b54eae19c7ae77 100644 (file)
@@ -67,6 +67,7 @@ struct consumer_channel_msg {
        uint64_t key;                           /* del */
 };
 
+/* Flag used to temporarily pause data consumption from testpoints. */
 int data_consumption_paused;
 
 /*
@@ -2554,6 +2555,12 @@ void *consumer_thread_data_poll(void *data)
                        goto end;
                }
 
+               if (caa_unlikely(data_consumption_paused)) {
+                       DBG("Data consumption paused, sleeping...");
+                       sleep(1);
+                       goto restart;
+               }
+
                /*
                 * If the consumer_data_pipe triggered poll go directly to the
                 * beginning of the loop to update the array. We want to prioritize
This page took 0.023326 seconds and 4 git commands to generate.