X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fconsumer.c;fp=src%2Fbin%2Flttng-sessiond%2Fconsumer.c;h=397d207253b84b02d1e8ab62538564bc5ec12adb;hp=80e3137788ebc0c26da3302988a8ead922adf121;hb=f3e3b7222f889a4e9f8936fc5ad3577400e4318d;hpb=dc722af3d0305807fca29ad00d694cbd5967497a diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 80e313778..397d20725 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -1899,3 +1899,38 @@ error: health_code_update(); return ret; } + +int consumer_clear_channel(struct consumer_socket *socket, uint64_t key, + struct consumer_output *output) +{ + int ret; + struct lttcomm_consumer_msg msg; + + assert(socket); + + DBG("Consumer clear channel %" PRIu64, key); + + memset(&msg, 0, sizeof(msg)); + msg.cmd_type = LTTNG_CONSUMER_CLEAR_CHANNEL; + msg.u.clear_channel.key = key; + + if (output->type == CONSUMER_DST_NET) { + ERR("Relayd clear is not supported for now"); + ret = -LTTNG_ERR_INVALID; + goto error; + } + health_code_update(); + + pthread_mutex_lock(socket->lock); + ret = consumer_send_msg(socket, &msg); + if (ret < 0) { + goto error_socket; + } + +error_socket: + pthread_mutex_unlock(socket->lock); + +error: + health_code_update(); + return ret; +}