X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=b8695698da7301b69b114fe373680b248294b486;hp=191367cd0cd55c55be523cdf139182d4dbe8feca;hb=d3e2ba59faddb31870e2ce29b6a881f7ad5ad883;hpb=7ce3675685dbbc7be9536eb9c2b5ff8d677dc0b5 diff --git a/src/common/consumer.c b/src/common/consumer.c index 191367cd0..b8695698d 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "consumer.h" #include "consumer-stream.h" @@ -305,6 +306,10 @@ void consumer_del_channel(struct lttng_consumer_channel *channel) consumer_stream_destroy(stream, NULL); } + if (channel->live_timer_enabled == 1) { + consumer_timer_live_stop(channel); + } + switch (consumer_data.type) { case LTTNG_CONSUMER_KERNEL: break; @@ -3112,7 +3117,8 @@ void lttng_consumer_init(void) int consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type, struct lttng_consumer_local_data *ctx, int sock, struct pollfd *consumer_sockpoll, - struct lttcomm_relayd_sock *relayd_sock, uint64_t sessiond_id) + struct lttcomm_relayd_sock *relayd_sock, uint64_t sessiond_id, + uint64_t relayd_session_id) { int fd = -1, ret = -1, relayd_created = 0; enum lttng_error_code ret_code = LTTNG_OK; @@ -3212,29 +3218,7 @@ int consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type, relayd->control_sock.major = relayd_sock->major; relayd->control_sock.minor = relayd_sock->minor; - /* - * Create a session on the relayd and store the returned id. Lock the - * control socket mutex if the relayd was NOT created before. - */ - if (!relayd_created) { - pthread_mutex_lock(&relayd->ctrl_sock_mutex); - } - ret = relayd_create_session(&relayd->control_sock, - &relayd->relayd_session_id); - if (!relayd_created) { - pthread_mutex_unlock(&relayd->ctrl_sock_mutex); - } - if (ret < 0) { - /* - * Close all sockets of a relayd object. It will be freed if it was - * created at the error code path or else it will be garbage - * collect. - */ - (void) relayd_close(&relayd->control_sock); - (void) relayd_close(&relayd->data_sock); - ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL; - goto error; - } + relayd->relayd_session_id = relayd_session_id; break; case LTTNG_STREAM_DATA: