X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=5710226fc4504cb609eefa0b31ac4c989e15276a;hp=c74599ded1c38f8b65ed307ab3368e223c11c29a;hb=0a9c649428b2ea8d4e743aebc12585eeb58fcf64;hpb=8c0670510c21676df20f086268593738e91ee332 diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index c74599ded..5710226fc 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2527,8 +2527,8 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, metadata->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; metadata->attr.subbuf_size = default_get_metadata_subbuf_size(); metadata->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; - metadata->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; - metadata->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; + metadata->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; + metadata->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; metadata->attr.output = LTTNG_UST_MMAP; metadata->attr.type = LTTNG_UST_CHAN_METADATA; } else { @@ -2537,13 +2537,6 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, metadata->attr.type = LTTNG_UST_CHAN_METADATA; } - /* Get the right consumer socket for the application. */ - socket = consumer_find_socket_by_bitness(app->bits_per_long, consumer); - if (!socket) { - ret = -EINVAL; - goto error_consumer; - } - /* Need one fd for the channel. */ ret = lttng_fd_get(LTTNG_FD_APPS, 1); if (ret < 0) { @@ -2551,6 +2544,13 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, goto error; } + /* Get the right consumer socket for the application. */ + socket = consumer_find_socket_by_bitness(app->bits_per_long, consumer); + if (!socket) { + ret = -EINVAL; + goto error_consumer; + } + /* * Keep metadata key so we can identify it on the consumer side. Assign it * to the registry *before* we ask the consumer so we avoid the race of the @@ -2572,7 +2572,6 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, * Safe because the metadata obj pointer is not set so the delete below * will not put a FD back again. */ - lttng_fd_put(LTTNG_FD_APPS, 1); goto error_consumer; } @@ -2588,7 +2587,6 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, * Safe because the metadata obj pointer is not set so the delete below * will not put a FD back again. */ - lttng_fd_put(LTTNG_FD_APPS, 1); goto error_consumer; } @@ -2596,6 +2594,7 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, metadata->key, app->pid); error_consumer: + lttng_fd_put(LTTNG_FD_APPS, 1); delete_ust_app_channel(-1, metadata, app); error: return ret;