Fix: destroy default created channel if add-context fails
[lttng-tools.git] / src / bin / lttng-sessiond / trace-ust.c
index 51632bad4ed602bcbc52fc769cc346bb709c74b3..2c63ef0b5e65f7149e28eca47d6730cfeee3c9aa 100644 (file)
@@ -571,6 +571,23 @@ void trace_ust_destroy_channel(struct ltt_ust_channel *channel)
        call_rcu(&channel->node.head, destroy_channel_rcu);
 }
 
+/*
+ * Remove an UST channel from a channel HT.
+ */
+void trace_ust_delete_channel(struct lttng_ht *ht,
+               struct ltt_ust_channel *channel)
+{
+       int ret;
+       struct lttng_ht_iter iter;
+
+       assert(ht);
+       assert(channel);
+
+       iter.iter.node = &channel->node.node;
+       ret = lttng_ht_del(ht, &iter);
+       assert(!ret);
+}
+
 /*
  * Cleanup ust metadata structure.
  */
This page took 0.024892 seconds and 4 git commands to generate.