X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-sessiond%2Fchannel.c;h=0e8b1672086b7031b950ba92b4e32fd7ea28e39e;hb=734f79bf717d87817623d382c59086dc9e8ef610;hp=b4dc48d161e662f12678e5d8de900e5a7c2761b0;hpb=24d1723f7e614f74b6957ad3f3666a5713664d63;p=lttng-tools.git diff --git a/lttng-sessiond/channel.c b/lttng-sessiond/channel.c index b4dc48d16..0e8b16720 100644 --- a/lttng-sessiond/channel.c +++ b/lttng-sessiond/channel.c @@ -216,7 +216,6 @@ int channel_ust_create(struct ltt_ust_session *usess, int domain, struct lttng_channel *attr) { int ret = LTTCOMM_OK; - struct lttng_ht *chan_ht; struct ltt_ust_channel *uchan = NULL; struct lttng_channel *defattr = NULL; @@ -236,11 +235,11 @@ int channel_ust_create(struct ltt_ust_session *usess, int domain, ret = LTTCOMM_FATAL; goto error; } + uchan->enabled = 1; switch (domain) { case LTTNG_DOMAIN_UST: DBG2("Channel %s being created in UST global domain", uchan->name); - chan_ht = usess->domain_global.channels; /* Enable channel for global domain */ ret = ust_app_create_channel_glb(usess, uchan); @@ -258,8 +257,11 @@ int channel_ust_create(struct ltt_ust_session *usess, int domain, goto error_free_chan; } - uchan->enabled = 1; - lttng_ht_add_unique_str(chan_ht, &uchan->node); + /* Adding the channel to the channel hash table. */ + rcu_read_lock(); + lttng_ht_add_unique_str(usess->domain_global.channels, &uchan->node); + rcu_read_unlock(); + DBG2("Channel %s created successfully", uchan->name); free(defattr);