- health_code_update(&health_thread_cmd);
- return ret;
-}
-
-/*
- * Open metadata onto the UST tracer for a UST session.
- */
-static int open_ust_metadata(struct ust_app *app,
- struct ust_app_session *ua_sess)
-{
- int ret;
- struct lttng_ust_channel_attr uattr;
-
- health_code_update(&health_thread_cmd);
-
- uattr.overwrite = ua_sess->metadata->attr.overwrite;
- uattr.subbuf_size = ua_sess->metadata->attr.subbuf_size;
- uattr.num_subbuf = ua_sess->metadata->attr.num_subbuf;
- uattr.switch_timer_interval =
- ua_sess->metadata->attr.switch_timer_interval;
- uattr.read_timer_interval =
- ua_sess->metadata->attr.read_timer_interval;
- uattr.output = ua_sess->metadata->attr.output;
-
- /* We are going to receive 2 fds, we need to reserve them. */
- ret = lttng_fd_get(LTTNG_FD_APPS, 2);
- if (ret < 0) {
- ERR("Exhausted number of available FD upon metadata open");
- goto error;
- }
- /* UST tracer metadata creation */
- ret = ustctl_open_metadata(app->sock, ua_sess->handle, &uattr,
- &ua_sess->metadata->obj);
- if (ret < 0) {
- ERR("UST app open metadata failed for app pid:%d with ret %d",
- app->pid, ret);
- goto error;
- }
-
- ua_sess->metadata->handle = ua_sess->metadata->obj->handle;
-
-error:
- health_code_update(&health_thread_cmd);
- return ret;
-}
-
-/*
- * Create metadata stream onto the UST tracer for a given session.
- */
-static int create_ust_metadata_stream(struct ust_app *app,
- struct ust_app_session *ua_sess)
-{
- int ret;
-
- health_code_update(&health_thread_cmd);
-
- /* We are going to receive 2 fds, we need to reserve them. */
- ret = lttng_fd_get(LTTNG_FD_APPS, 2);
- if (ret < 0) {
- ERR("Exhausted number of available FD upon metadata stream create");
- goto error;
- }
- ret = ustctl_create_stream(app->sock, ua_sess->metadata->obj,
- &ua_sess->metadata->stream_obj);
- if (ret < 0) {
- ERR("UST create metadata stream failed");
- goto error;
- }
-
-error:
- health_code_update(&health_thread_cmd);