X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng-sessiond%2Fconsumer.c;h=26ff56effe8f57715822badae8d8df2ade6c092e;hb=3448e2667be7445ae7630a18c2ab32cb2bcdd174;hp=92a6c5ddc72a0fca50f40fd2c1d03a0b7cddde12;hpb=f50f23d9f80ed9fae7fe5c49aee65e813e0031c8;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 92a6c5ddc..26ff56eff 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -46,7 +46,8 @@ int consumer_recv_status_reply(struct consumer_socket *sock) ret = lttcomm_recv_unix_sock(sock->fd, &reply, sizeof(reply)); if (ret < 0) { - PERROR("recv consumer status msg"); + /* The above call will print a PERROR on error. */ + DBG("Fail to receive status reply on sock %d", sock->fd); goto end; } @@ -55,7 +56,7 @@ int consumer_recv_status_reply(struct consumer_socket *sock) ret = 0; } else { ret = -reply.ret_code; - ERR("Consumer ret code %d", reply.ret_code); + DBG("Consumer ret code %d", reply.ret_code); } end: @@ -91,7 +92,8 @@ int consumer_send_destroy_relayd(struct consumer_socket *sock, pthread_mutex_lock(sock->lock); ret = lttcomm_send_unix_sock(sock->fd, &msg, sizeof(msg)); if (ret < 0) { - PERROR("send consumer destroy relayd command"); + /* Indicate that the consumer is probably closing at this point. */ + DBG("send consumer destroy relayd command"); goto error_send; } @@ -112,7 +114,6 @@ error: */ void consumer_output_send_destroy_relayd(struct consumer_output *consumer) { - int ret; struct lttng_ht_iter iter; struct consumer_socket *socket; @@ -123,10 +124,12 @@ void consumer_output_send_destroy_relayd(struct consumer_output *consumer) rcu_read_lock(); cds_lfht_for_each_entry(consumer->socks->ht, &iter.iter, socket, node.node) { + int ret; + /* Send destroy relayd command */ ret = consumer_send_destroy_relayd(socket, consumer); if (ret < 0) { - ERR("Unable to send destroy relayd command to consumer"); + DBG("Unable to send destroy relayd command to consumer"); /* Continue since we MUST delete everything at this point. */ } } @@ -490,7 +493,8 @@ int consumer_send_fds(struct consumer_socket *sock, int *fds, size_t nb_fd) ret = lttcomm_send_fds_unix_sock(sock->fd, fds, nb_fd); if (ret < 0) { - PERROR("send consumer fds"); + /* The above call will print a PERROR on error. */ + DBG("Error when sending consumer fds on sock %d", sock->fd); goto error; } @@ -515,7 +519,8 @@ int consumer_send_channel(struct consumer_socket *sock, ret = lttcomm_send_unix_sock(sock->fd, msg, sizeof(struct lttcomm_consumer_msg)); if (ret < 0) { - PERROR("send consumer channel"); + /* The above call will print a PERROR on error. */ + DBG("Error when sending consumer channel on sock %d", sock->fd); goto error; } @@ -633,7 +638,8 @@ int consumer_send_stream(struct consumer_socket *sock, ret = lttcomm_send_unix_sock(sock->fd, msg, sizeof(struct lttcomm_consumer_msg)); if (ret < 0) { - PERROR("send consumer stream"); + /* The above call will print a PERROR on error. */ + DBG("Error when sending consumer stream on sock %d", sock->fd); goto error; } @@ -658,7 +664,7 @@ error: */ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, struct lttcomm_sock *sock, struct consumer_output *consumer, - enum lttng_stream_type type) + enum lttng_stream_type type, unsigned int session_id) { int ret; struct lttcomm_consumer_msg msg; @@ -682,12 +688,14 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, */ msg.u.relayd_sock.net_index = consumer->net_seq_index; msg.u.relayd_sock.type = type; + msg.u.relayd_sock.session_id = session_id; memcpy(&msg.u.relayd_sock.sock, sock, sizeof(msg.u.relayd_sock.sock)); DBG3("Sending relayd sock info to consumer on %d", consumer_sock->fd); ret = lttcomm_send_unix_sock(consumer_sock->fd, &msg, sizeof(msg)); if (ret < 0) { - PERROR("send consumer relayd socket info"); + /* The above call will print a PERROR on error. */ + DBG("Error when sending relayd sockets on sock %d", sock->fd); goto error; } @@ -790,7 +798,8 @@ int consumer_is_data_pending(unsigned int id, ret = lttcomm_send_unix_sock(socket->fd, &msg, sizeof(msg)); if (ret < 0) { - PERROR("send consumer data pending command"); + /* The above call will print a PERROR on error. */ + DBG("Error on consumer is data pending on sock %d", socket->fd); pthread_mutex_unlock(socket->lock); goto error; } @@ -802,7 +811,8 @@ int consumer_is_data_pending(unsigned int id, ret = lttcomm_recv_unix_sock(socket->fd, &ret_code, sizeof(ret_code)); if (ret < 0) { - PERROR("recv consumer data pending status"); + /* The above call will print a PERROR on error. */ + DBG("Error on recv consumer is data pending on sock %d", socket->fd); pthread_mutex_unlock(socket->lock); goto error; } @@ -814,7 +824,8 @@ int consumer_is_data_pending(unsigned int id, } } - DBG("Consumer data pending ret %d", ret_code); + DBG("Consumer data is %s pending for session id %u", + ret_code == 1 ? "" : "NOT", id); return ret_code; error: