X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fconsumer.c;h=76572a075c9afca920d782a8b7639c11396c9896;hb=d60962b2fd59c26410139d5203c9ec7f894f8e02;hp=717dcdbf30859b58b4f9be2c1c6f0d848d27cedb;hpb=ef895a18579c845259ff0e99f5d58191f19e7f82;p=deliverable%2Flttng-tools.git diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 717dcdbf3..76572a075 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -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. *