CUSTOM: liver timer: immediate liver timer control on data pending and destroy
[lttng-tools.git] / src / bin / lttng-sessiond / consumer.c
index 717dcdbf30859b58b4f9be2c1c6f0d848d27cedb..76572a075c9afca920d782a8b7639c11396c9896 100644 (file)
@@ -1205,6 +1205,69 @@ end:
        return ret;
 }
 
+/*
+ * Stop live timer.
+ *
+ * Return 0 on success else a negative value.
+ */
+int consumer_channel_stop_live_timer(struct consumer_socket *socket, uint64_t key)
+{
+       int ret;
+       struct lttcomm_consumer_msg msg;
+
+       assert(socket);
+
+       DBG2("Consumer stop live timer for channel key %" PRIu64, key);
+
+       memset(&msg, 0, sizeof(msg));
+       msg.cmd_type = LTTNG_CONSUMER_CHANNEL_STOP_LIVE_TIMER;
+       msg.u.stop_live_timer.key = key;
+
+       pthread_mutex_lock(socket->lock);
+       health_code_update();
+
+       ret = consumer_send_msg(socket, &msg);
+       if (ret < 0) {
+               goto end;
+       }
+
+end:
+       health_code_update();
+       pthread_mutex_unlock(socket->lock);
+       return ret;
+}
+
+/*
+ * Start live timer.
+ *
+ * Return 0 on success else a negative value.
+ */
+int consumer_channel_start_live_timer(struct consumer_socket *socket, uint64_t key)
+{
+       int ret;
+       struct lttcomm_consumer_msg msg;
+
+       assert(socket);
+
+       DBG2("Consumer start live timer for channel key %" PRIu64, key);
+
+       memset(&msg, 0, sizeof(msg));
+       msg.cmd_type = LTTNG_CONSUMER_CHANNEL_START_LIVE_TIMER;
+       msg.u.start_live_timer.key = key;
+
+       pthread_mutex_lock(socket->lock);
+       health_code_update();
+
+       ret = consumer_send_msg(socket, &msg);
+       if (ret < 0) {
+               goto end;
+       }
+
+end:
+       health_code_update();
+       pthread_mutex_unlock(socket->lock);
+       return ret;
+}
 /*
  * Send a clear quiescent command to consumer using the given channel key.
  *
This page took 0.025717 seconds and 5 git commands to generate.