ret = snprintf(tmp_path, sizeof(tmp_path), "%s%s%s",
consumer->dst.session_root_path,
consumer->chunk_path,
- consumer->subdir);
+ consumer->domain_subdir);
if (ret < 0) {
PERROR("snprintf kernel channel path");
goto error;
sizeof(tmp_path), ret,
consumer->dst.session_root_path,
consumer->chunk_path,
- consumer->subdir);
+ consumer->domain_subdir);
goto error;
}
pathname = lttng_strndup(tmp_path, sizeof(tmp_path));
}
DBG3("Kernel local consumer tracefile path: %s", pathname);
} else {
+ /* Network output. */
ret = snprintf(tmp_path, sizeof(tmp_path), "%s%s",
consumer->dst.net.base_dir,
- consumer->subdir);
+ consumer->domain_subdir);
if (ret < 0) {
PERROR("snprintf kernel metadata path");
goto error;
ERR("Kernel channel path exceeds the maximal allowed length of of %zu bytes (%i bytes required) with path \"%s%s\"",
sizeof(tmp_path), ret,
consumer->dst.net.base_dir,
- consumer->subdir);
+ consumer->domain_subdir);
goto error;
}
pathname = lttng_strndup(tmp_path, sizeof(tmp_path));
/*
* Sending a single channel to the consumer with command ADD_CHANNEL.
*/
+static
int kernel_consumer_add_channel(struct consumer_socket *sock,
struct ltt_kernel_channel *channel,
struct ltt_kernel_session *ksession,
struct lttcomm_consumer_msg lkm;
struct consumer_output *consumer;
enum lttng_error_code status;
- struct ltt_session *session;
+ struct ltt_session *session = NULL;
struct lttng_channel_extended *channel_attr_extended;
/* Safety net */
channel->published_to_notification_thread = true;
error:
+ if (session) {
+ session_put(session);
+ }
free(pathname);
return ret;
}
char *pathname;
struct lttcomm_consumer_msg lkm;
struct consumer_output *consumer;
- struct ltt_session *session;
+ struct ltt_session *session = NULL;
rcu_read_lock();
error:
rcu_read_unlock();
free(pathname);
+ if (session) {
+ session_put(session);
+ }
return ret;
}
{
int ret = LTTNG_OK;
struct ltt_kernel_stream *stream;
- struct ltt_session *session;
+ struct ltt_session *session = NULL;
/* Safety net */
assert(channel);
error:
rcu_read_unlock();
+ if (session) {
+ session_put(session);
+ }
return ret;
}