Fix: consumer should await for initial streams
[lttng-tools.git] / src / bin / lttng-sessiond / ust-app.c
index 7f4e9f1e0c928df31c5b5a39b1614e54f22361f8..fc8728dd21da9b4d68a417323f41fbe0c7a6f225 100644 (file)
@@ -1667,6 +1667,7 @@ int ust_app_list_event_fields(struct lttng_event_field **fields)
 
                        memcpy(tmp[count].field_name, uiter.field_name, LTTNG_UST_SYM_NAME_LEN);
                        tmp[count].type = uiter.type;
+                       tmp[count].nowrite = uiter.nowrite;
 
                        memcpy(tmp[count].event.name, uiter.event_name, LTTNG_UST_SYM_NAME_LEN);
                        tmp[count].event.loglevel = uiter.loglevel;
@@ -2196,6 +2197,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
 
        ret = create_ust_app_metadata(ua_sess, usess->pathname, app);
        if (ret < 0) {
+               ret = LTTNG_ERR_UST_META_FAIL;
                goto error_rcu_unlock;
        }
 
@@ -2227,6 +2229,7 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
                                /* Got all streams */
                                lttng_fd_put(LTTNG_FD_APPS, 2);
                                free(ustream);
+                               ret = LTTNG_ERR_UST_STREAM_FAIL;
                                break;
                        }
                        ustream->handle = ustream->obj->handle;
@@ -2236,7 +2239,8 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app)
                        /* Order is important */
                        cds_list_add_tail(&ustream->list, &ua_chan->streams.head);
                        ret = snprintf(ustream->name, sizeof(ustream->name), "%s_%u",
-                                       ua_chan->name, ua_chan->streams.count++);
+                                       ua_chan->name, ua_chan->streams.count);
+                       ua_chan->streams.count++;
                        if (ret < 0) {
                                PERROR("asprintf UST create stream");
                                /*
@@ -2925,7 +2929,7 @@ int ust_app_validate_version(int sock)
                goto error;
        }
 
-       DBG2("UST app PID %d is compatible with major version %d "
+       DBG2("UST app PID %d is compatible with internal major version %d "
                        "(supporting == %d)", app->pid, app->version.major,
                        UST_APP_MAJOR_VERSION);
        app->compatible = 1;
@@ -2934,7 +2938,7 @@ int ust_app_validate_version(int sock)
        return 0;
 
 error:
-       DBG2("UST app PID %d is not compatible with major version %d "
+       DBG2("UST app PID %d is not compatible with internal major version %d "
                        "(supporting == %d)", app->pid, app->version.major,
                        UST_APP_MAJOR_VERSION);
        app->compatible = 0;
This page took 0.024158 seconds and 4 git commands to generate.