X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=12c8f92244693a6e63fbfb9c4633a0daf24223e9;hb=ba1bb3dc644f478e212b513d70dc53ed76a74d34;hp=0b32f351814bf723710105550b6bd5b1f569501a;hpb=f9dfc3d95caf3a7d927d58f252006390e168a1c2;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 0b32f3518..12c8f9224 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -721,9 +721,9 @@ error: } /* - * Create stream onto the UST tracer for a UST session. + * Create metadata stream onto the UST tracer for a given session. */ -static int create_ust_stream(struct ust_app *app, +static int create_ust_metadata_stream(struct ust_app *app, struct ust_app_session *ua_sess) { int ret; @@ -739,6 +739,7 @@ static int create_ust_stream(struct ust_app *app, ret = ustctl_create_stream(app->sock, ua_sess->metadata->obj, &ua_sess->metadata->stream_obj); if (ret < 0) { + lttng_fd_put(LTTNG_FD_APPS, 2); ERR("UST create metadata stream failed"); goto error; } @@ -1352,7 +1353,7 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, /* Open UST metadata stream */ if (ua_sess->metadata->stream_obj == NULL) { - ret = create_ust_stream(app, ua_sess); + ret = create_ust_metadata_stream(app, ua_sess); if (ret < 0) { goto error; } @@ -2288,11 +2289,16 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) ret = ustctl_create_stream(app->sock, ua_chan->obj, &ustream->obj); if (ret < 0) { - /* Got all streams */ - lttng_fd_put(LTTNG_FD_APPS, 2); + /* Free unused memory and reset FD states. */ free(ustream); + lttng_fd_put(LTTNG_FD_APPS, 2); + if (ret == -LTTNG_UST_ERR_NOENT) { + /* Got all streams. Continue normal execution. */ + break; + } + /* Error at this point. Stop everything. */ ret = LTTNG_ERR_UST_STREAM_FAIL; - break; + goto error_rcu_unlock; } ustream->handle = ustream->obj->handle; @@ -2350,7 +2356,7 @@ skip_setup: /* This start the UST tracing */ ret = ustctl_start_session(app->sock, ua_sess->handle); if (ret < 0) { - ERR("Error starting tracing for app pid: %d", app->pid); + ERR("Error starting tracing for app pid: %d (ret: %d)", app->pid, ret); goto error_rcu_unlock; } @@ -2411,7 +2417,7 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) /* This inhibits UST tracing */ ret = ustctl_stop_session(app->sock, ua_sess->handle); if (ret < 0) { - ERR("Error stopping tracing for app pid: %d", app->pid); + ERR("Error stopping tracing for app pid: %d (ret: %d)", app->pid, ret); goto error_rcu_unlock; } @@ -2651,12 +2657,6 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock) /* FIXME: Should we quit here or continue... */ continue; } - - ret = set_ust_event_filter(ua_event, app); - if (ret < 0) { - /* FIXME: Should we quit here or continue... */ - continue; - } } }