X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=8363ae2954912482900e2aa5f3eeeeb4cd7bd26f;hp=c80d5e772de8c48e913b5399f23be7af785241c5;hb=31746f9311cefdd95109e231b78d6bd5fc12e85c;hpb=d386c872c7c9a05b367355fa6bbcb5946e93bacd diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index c80d5e772..8363ae295 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -289,6 +289,8 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan) /* Init node */ lttng_ht_node_init_str(&luc->node, luc->name); + CDS_INIT_LIST_HEAD(&luc->ctx_list); + /* Alloc hash tables */ luc->events = lttng_ht_new(0, LTTNG_HT_TYPE_STRING); luc->ctx = lttng_ht_new(0, LTTNG_HT_TYPE_ULONG); @@ -463,6 +465,7 @@ struct ltt_ust_context *trace_ust_create_context( uctx->ctx.ctx = utype; lttng_ht_node_init_ulong(&uctx->node, (unsigned long) uctx->ctx.ctx); + CDS_INIT_LIST_HEAD(&uctx->list); return uctx; @@ -491,11 +494,16 @@ static void destroy_contexts(struct lttng_ht *ht) int ret; struct lttng_ht_node_ulong *node; struct lttng_ht_iter iter; + struct ltt_ust_context *ctx; assert(ht); rcu_read_lock(); cds_lfht_for_each_entry(ht->ht, &iter.iter, node, node) { + /* Remove from ordered list. */ + ctx = caa_container_of(node, struct ltt_ust_context, node); + cds_list_del(&ctx->list); + /* Remove from channel's hash table. */ ret = lttng_ht_del(ht, &iter); if (!ret) { call_rcu(&node->head, destroy_context_rcu);