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;
goto skip_setup;
}
+ /* Create directories if consumer is LOCAL and has a path defined. */
+ if (usess->consumer->type == CONSUMER_DST_LOCAL &&
+ strlen(usess->consumer->dst.trace_path) > 0) {
+ ret = run_as_mkdir_recursive(usess->consumer->dst.trace_path,
+ S_IRWXU | S_IRWXG, usess->uid, usess->gid);
+ if (ret < 0) {
+ if (ret != -EEXIST) {
+ ERR("Trace directory creation error");
+ ret = -1;
+ goto error_rcu_unlock;
+ }
+ }
+ }
+
/* Indicate that the session has been started once */
ua_sess->started = 1;
ret = create_ust_app_metadata(ua_sess, usess->pathname, app);
if (ret < 0) {
+ ret = LTTNG_ERR_UST_META_FAIL;
goto error_rcu_unlock;
}
/* Got all streams */
lttng_fd_put(LTTNG_FD_APPS, 2);
free(ustream);
+ ret = LTTNG_ERR_UST_STREAM_FAIL;
break;
}
ustream->handle = ustream->obj->handle;
/* 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");
/*
}
/* Validate version */
- if (app->version.major > UST_APP_MAJOR_VERSION) {
+ if (app->version.major != UST_APP_MAJOR_VERSION) {
goto error;
}
- DBG2("UST app PID %d is compatible with major version %d "
- "(supporting <= %d)", app->pid, app->version.major,
+ 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;
rcu_read_unlock();
return 0;
error:
- DBG2("UST app PID %d is not compatible with major version %d "
- "(supporting <= %d)", app->pid, app->version.major,
+ 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;
rcu_read_unlock();