ua_ctx = alloc_ust_app_ctx(uctx);
if (ua_ctx == NULL) {
/* malloc failed */
- ret = -1;
+ ret = -ENOMEM;
goto error;
}
/*
* Create and send to the application the created buffers with per UID buffers.
*
+ * This MUST be called with a RCU read side lock acquired.
+ *
* Return 0 on success else a negative value.
*/
static int create_channel_per_uid(struct ust_app *app,
created = true;
}
- /* Send buffers to the application. */
- ret = send_channel_uid_to_ust(reg_chan, app, ua_sess, ua_chan);
- if (ret < 0) {
- if (ret != -ENOTCONN) {
- ERR("Error sending channel to application");
- }
- goto error;
- }
-
if (created) {
enum lttng_error_code cmd_ret;
struct ltt_session *session;
uint64_t chan_reg_key;
struct ust_registry_channel *chan_reg;
- rcu_read_lock();
chan_reg_key = ua_chan->tracing_channel_id;
pthread_mutex_lock(®_uid->registry->reg.ust->lock);
ua_chan->key,
LTTNG_DOMAIN_UST,
ua_chan->attr.subbuf_size * ua_chan->attr.num_subbuf);
- rcu_read_unlock();
if (cmd_ret != LTTNG_OK) {
ret = - (int) cmd_ret;
ERR("Failed to add channel to notification thread");
}
}
+ /* Send buffers to the application. */
+ ret = send_channel_uid_to_ust(reg_chan, app, ua_sess, ua_chan);
+ if (ret < 0) {
+ if (ret != -ENOTCONN) {
+ ERR("Error sending channel to application");
+ }
+ goto error;
+ }
+
error:
return ret;
}