ret = ustctl_create_event(app->sock, &ua_event->attr, ua_chan->obj,
&ua_event->obj);
if (ret < 0) {
- if (ret == -EEXIST) {
+ if (ret == -EEXIST || ret == -EPERM) {
ret = 0;
goto error;
}
ua_sess->uid = usess->uid;
ua_sess->gid = usess->gid;
- ret = snprintf(ua_sess->path, PATH_MAX, "%s/%s-%d-%s", usess->pathname,
- app->name, app->pid, datetime);
+ ret = snprintf(ua_sess->path, PATH_MAX, "%s-%d-%s/", app->name, app->pid,
+ datetime);
if (ret < 0) {
PERROR("asprintf UST shadow copy session");
/* TODO: We cannot return an error from here.. */
goto error;
}
- ret = run_as_mkdir(ua_sess->path, S_IRWXU | S_IRWXG,
- ua_sess->uid, ua_sess->gid);
- if (ret < 0) {
- PERROR("mkdir UST metadata");
- goto error;
- }
-
ret = snprintf(ua_sess->metadata->pathname, PATH_MAX,
"%s/metadata", ua_sess->path);
if (ret < 0) {
goto rcu_error;
}
}
-
memcpy(tmp[count].field_name, uiter.field_name, LTTNG_UST_SYM_NAME_LEN);
tmp[count].type = uiter.type;
/* Order is important */
cds_list_add_tail(&ustream->list, &ua_chan->streams.head);
- ret = snprintf(ustream->pathname, PATH_MAX, "%s/%s_%u",
- ua_sess->path, ua_chan->name,
- ua_chan->streams.count++);
+ ret = snprintf(ustream->name, sizeof(ustream->name), "%s_%u",
+ ua_chan->name, ua_chan->streams.count++);
if (ret < 0) {
PERROR("asprintf UST create stream");
/*
*/
continue;
}
- DBG2("UST stream %d ready at %s", ua_chan->streams.count,
- ustream->pathname);
+ DBG2("UST stream %d ready (handle: %d)", ua_chan->streams.count,
+ ustream->handle);
}
}
}
/* Setup UST consumer socket and send fds to it */
- ret = ust_consumer_send_session(consumerd_fd, ua_sess);
+ ret = ust_consumer_send_session(consumerd_fd, ua_sess, usess->consumer);
if (ret < 0) {
goto error_rcu_unlock;
}