+ case LTTNG_DOMAIN_UST:
+ {
+ struct lttng_channel *attr;
+ struct ltt_ust_channel *uchan;
+ struct ltt_ust_session *usess = session->ust_session;
+
+ /* Get channel from global UST domain */
+ uchan = trace_ust_find_channel_by_name(usess->domain_global.channels,
+ channel_name);
+ if (uchan == NULL) {
+ /* Create default channel */
+ attr = channel_new_default_attr(domain);
+ if (attr == NULL) {
+ ret = LTTCOMM_FATAL;
+ goto error;
+ }
+ snprintf(attr->name, NAME_MAX, "%s", channel_name);
+ attr->name[NAME_MAX - 1] = '\0';
+
+ /* Use the internal command enable channel */
+ ret = channel_ust_create(usess, domain, attr);
+ if (ret != LTTCOMM_OK) {
+ free(attr);
+ goto error;
+ }
+ free(attr);
+
+ /* Get the newly created channel reference back */
+ uchan = trace_ust_find_channel_by_name(
+ usess->domain_global.channels, channel_name);
+ if (uchan == NULL) {
+ /* Something is really wrong */
+ ret = LTTCOMM_FATAL;
+ goto error;
+ }
+ }
+
+ /* At this point, the session and channel exist on the tracer */
+
+ switch (event_type) {
+ case LTTNG_EVENT_ALL:
+ case LTTNG_EVENT_TRACEPOINT:
+ ret = event_ust_enable_all_tracepoints(usess, domain, uchan);
+ if (ret != LTTCOMM_OK) {
+ goto error;
+ }
+ break;
+ default:
+ ret = LTTCOMM_UST_ENABLE_FAIL;
+ goto error;
+ }
+
+ /* Manage return value */
+ if (ret != LTTCOMM_OK) {
+ goto error;
+ }
+
+ break;
+ }
+ case LTTNG_DOMAIN_UST_EXEC_NAME:
+ case LTTNG_DOMAIN_UST_PID:
+ case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: