+
+ /* Lookup channel in the ust app session */
+ ua_chan_node = hashtable_lookup(ua_sess->channels,
+ (void *)uchan->name, strlen(uchan->name), &iter);
+ if (ua_chan_node == NULL) {
+ DBG2("Unable to find channel %s in ust session uid %u",
+ uchan->name, ua_sess->uid);
+ ua_chan = alloc_ust_app_channel(uchan->name, &uchan->attr);
+ if (ua_chan == NULL) {
+ goto error;
+ }
+ shadow_copy_channel(ua_chan, uchan);
+
+ hashtable_add_unique(ua_sess->channels, &ua_chan->node);
+ } else {
+ ua_chan = caa_container_of(ua_chan_node, struct ust_app_channel, node);
+ }
+
+ ret = create_ust_channel(app, ua_sess, ua_chan);
+ if (ret < 0) {
+ goto error;
+ }
+
+ return ua_chan;
+
+error:
+ return NULL;
+}
+
+/*
+ * Create UST app event and create it on the tracer side.
+ */
+static struct ust_app_event *create_ust_app_event(
+ struct ust_app_session *ua_sess, struct ust_app_channel *ua_chan,
+ struct ltt_ust_event *uevent, struct ust_app *app)
+{
+ int ret;
+ struct cds_lfht_iter iter;
+ struct cds_lfht_node *ua_event_node;