sessiond: implement consumer clear channel
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 12 Dec 2019 16:31:34 +0000 (11:31 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Dec 2019 22:47:30 +0000 (17:47 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I1c17a34c23e4c03f94acb99fb822c3bc42faccf5
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/consumer.h

index 2e31279247ddf84335bc1a2391bf47a29732f612..e745702f85cd9cea776a1063d7dea6025849bd4a 100644 (file)
@@ -1727,6 +1727,34 @@ error:
        return ret;
 }
 
+int consumer_clear_channel(struct consumer_socket *socket, uint64_t key)
+{
+       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;
+
+       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);
+
+       health_code_update();
+       return ret;
+}
+
 int consumer_init(struct consumer_socket *socket,
                const lttng_uuid sessiond_uuid)
 {
index 8ebbe00e2edd35e37eaaf259b8c131e5fbb559d9..1844a1c695fce4e89808655309891c39dcbb817e 100644 (file)
@@ -332,4 +332,7 @@ int consumer_trace_chunk_exists(struct consumer_socket *socket,
 char *setup_channel_trace_path(struct consumer_output *consumer,
                const char *session_path, size_t *consumer_path_offset);
 
+/* Clear command */
+int consumer_clear_channel(struct consumer_socket *socket, uint64_t key);
+
 #endif /* _CONSUMER_H */
This page took 0.026608 seconds and 4 git commands to generate.