X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=ltt-sessiond%2Fmain.c;h=5a73b68dfed46fb8c1878725b3727bb2c16e2787;hp=b1dbc8f97f6fff2b73a961c6a79c1f48e841b1a5;hb=8b270bdb4dccf5571180a9906084126e90eec949;hpb=e88129fcabf35d124a7d97f6600350745dcbbb81 diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index b1dbc8f97..5a73b68df 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -288,6 +288,7 @@ static int send_kconsumerd_channel_fds(int sock, struct ltt_kernel_channel *chan lkm.fd = stream->fd; lkm.state = stream->state; lkm.max_sb_size = channel->channel->attr.subbuf_size; + lkm.output = DEFAULT_KERNEL_CHANNEL_OUTPUT; strncpy(lkm.path_name, stream->pathname, PATH_MAX); lkm.path_name[PATH_MAX - 1] = '\0'; @@ -338,6 +339,7 @@ static int send_kconsumerd_fds(int sock, struct ltt_kernel_session *session) lkm.fd = session->metadata_stream_fd; lkm.state = ACTIVE_FD; lkm.max_sb_size = session->metadata->conf->attr.subbuf_size; + lkm.output = DEFAULT_KERNEL_CHANNEL_OUTPUT; strncpy(lkm.path_name, session->metadata->pathname, PATH_MAX); lkm.path_name[PATH_MAX - 1] = '\0'; @@ -1245,8 +1247,15 @@ static int create_kernel_session(struct ltt_session *session) goto error; } - ret = mkdir_recursive(session->path, S_IRWXU | S_IRWXG, - geteuid(), allowed_group()); + ret = asprintf(&session->kernel_session->trace_path, "%s/kernel", + session->path); + if (ret < 0) { + perror("asprintf kernel traces path"); + goto error; + } + + ret = mkdir_recursive(session->kernel_session->trace_path, + S_IRWXU | S_IRWXG, geteuid(), allowed_group()); if (ret < 0) { if (ret != -EEXIST) { ERR("Trace directory creation error"); @@ -1360,7 +1369,9 @@ static int process_client_msg(struct command_ctx *cmd_ctx) DBG("Processing client command %d", cmd_ctx->lsm->cmd_type); - /* Listing commands don't need a session */ + /* + * Commands that DO NOT need a session. + */ switch (cmd_ctx->lsm->cmd_type) { case LTTNG_CREATE_SESSION: case LTTNG_LIST_SESSIONS: @@ -1609,7 +1620,8 @@ static int process_client_msg(struct command_ctx *cmd_ctx) DBG("Creating kernel channel"); ret = kernel_create_channel(cmd_ctx->session->kernel_session, - &cmd_ctx->lsm->u.channel.chan, cmd_ctx->session->path); + &cmd_ctx->lsm->u.channel.chan, + cmd_ctx->session->kernel_session->trace_path); if (ret < 0) { ret = LTTCOMM_KERN_CHAN_FAIL; goto error; @@ -1672,7 +1684,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx) } ret = kernel_create_channel(cmd_ctx->session->kernel_session, - chan, cmd_ctx->session->path); + chan, cmd_ctx->session->kernel_session->trace_path); if (ret < 0) { ret = LTTCOMM_KERN_CHAN_FAIL; goto error; @@ -1744,7 +1756,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx) } ret = kernel_create_channel(cmd_ctx->session->kernel_session, - chan, cmd_ctx->session->path); + chan, cmd_ctx->session->kernel_session->trace_path); if (ret < 0) { ret = LTTCOMM_KERN_CHAN_FAIL; goto error; @@ -1849,7 +1861,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx) if (cmd_ctx->session->kernel_session->metadata == NULL) { DBG("Open kernel metadata"); ret = kernel_open_metadata(cmd_ctx->session->kernel_session, - cmd_ctx->session->path); + cmd_ctx->session->kernel_session->trace_path); if (ret < 0) { ret = LTTCOMM_KERN_META_FAIL; goto error;