X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;h=bf3559a21fa021a55e5cebeb7a582b72e80b87de;hp=ef6dccb538219c86b70615b5323c00697f5a510d;hb=07b86b528dc279d59cdf16e6cb946c144fe773f2;hpb=2bba9e532ca1910822005ff7f67400a2e871467c diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index ef6dccb53..bf3559a21 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -202,14 +202,6 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, session->metadata_stream_fd, 0); /* CPU: 0 for metadata. */ - /* - * Set the no monitor flag. If set to 1, it indicates the consumer to NOT - * monitor the stream but rather add it to a special list in the associated - * channel. This is used to handle ephemeral stream used by the snapshot - * command or store streams for the flight recorder mode. - */ - lkm.u.stream.no_monitor = no_monitor; - health_code_update(); /* Send stream and file descriptor */ @@ -370,3 +362,61 @@ int kernel_consumer_send_session(struct consumer_socket *sock, error: return ret; } + +int kernel_consumer_destroy_channel(struct consumer_socket *socket, + struct ltt_kernel_channel *channel) +{ + int ret; + struct lttcomm_consumer_msg msg; + + assert(channel); + assert(socket); + assert(socket->fd >= 0); + + DBG("Sending kernel consumer destroy channel key %d", channel->fd); + + msg.cmd_type = LTTNG_CONSUMER_DESTROY_CHANNEL; + msg.u.destroy_channel.key = channel->fd; + + pthread_mutex_lock(socket->lock); + health_code_update(); + + ret = consumer_send_msg(socket, &msg); + if (ret < 0) { + goto error; + } + +error: + health_code_update(); + pthread_mutex_unlock(socket->lock); + return ret; +} + +int kernel_consumer_destroy_metadata(struct consumer_socket *socket, + struct ltt_kernel_metadata *metadata) +{ + int ret; + struct lttcomm_consumer_msg msg; + + assert(metadata); + assert(socket); + assert(socket->fd >= 0); + + DBG("Sending kernel consumer destroy channel key %d", metadata->fd); + + msg.cmd_type = LTTNG_CONSUMER_DESTROY_CHANNEL; + msg.u.destroy_channel.key = metadata->fd; + + pthread_mutex_lock(socket->lock); + health_code_update(); + + ret = consumer_send_msg(socket, &msg); + if (ret < 0) { + goto error; + } + +error: + health_code_update(); + pthread_mutex_unlock(socket->lock); + return ret; +}