consumer: implement clear channel
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index b053df521d0f3a9b46cb7b17d6ed92257fb9bd41..209869e762e4498cf40c706c3335afbb88ab4301 100644 (file)
@@ -2013,6 +2013,31 @@ error_push_metadata_fatal:
 end_rotate_channel_nosignal:
                goto end_nosignal;
        }
+       case LTTNG_CONSUMER_CLEAR_CHANNEL:
+       {
+               struct lttng_consumer_channel *channel;
+               uint64_t key = msg.u.clear_channel.key;
+
+               channel = consumer_find_channel(key);
+               if (!channel) {
+                       DBG("Channel %" PRIu64 " not found", key);
+                       ret_code = LTTCOMM_CONSUMERD_CHAN_NOT_FOUND;
+               } else {
+                       ret = lttng_consumer_clear_channel(channel);
+                       if (ret) {
+                               ERR("Clear channel failed key %" PRIu64, key);
+                               ret_code = ret;
+                       }
+
+                       health_code_update();
+               }
+               ret = consumer_send_status_msg(sock, ret_code);
+               if (ret < 0) {
+                       /* Somehow, the session daemon is not responding anymore. */
+                       goto end_nosignal;
+               }
+               break;
+       }
        case LTTNG_CONSUMER_INIT:
        {
                ret_code = lttng_consumer_init_command(ctx,
This page took 0.024063 seconds and 5 git commands to generate.