From: David Goulet Date: Tue, 18 Dec 2012 21:04:19 +0000 (-0500) Subject: Fix: change ERR/PERROR statement to DBG X-Git-Tag: v2.1.0~24 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c5c45efab4fc692edd8fd4db88c0df1d5f6cefff;p=lttng-tools.git Fix: change ERR/PERROR statement to DBG Most of the explanation is added as comments in the code. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 66cdc2479..ff55b57df 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -91,7 +91,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; } @@ -127,7 +128,7 @@ void consumer_output_send_destroy_relayd(struct consumer_output *consumer) /* 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. */ } } diff --git a/src/common/consumer.c b/src/common/consumer.c index 1af69ef93..be984a492 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1435,7 +1435,13 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( } while (ret < 0 && errno == EINTR); DBG("Consumer mmap write() ret %zd (len %lu)", ret, len); if (ret < 0) { - PERROR("Error in file write"); + /* + * This is possible if the fd is closed on the other side (outfd) + * or any write problem. It can be verbose a bit for a normal + * execution if for instance the relayd is stopped abruptly. This + * can happen so set this to a DBG statement. + */ + DBG("Error in file write mmap"); if (written == 0) { written = ret; } diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index e5c5256c7..1d8f6e81f 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -540,9 +540,13 @@ int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream, (ret != len && stream->net_seq_idx == -1)) { /* * Display the error but continue processing to try to release the - * subbuffer + * subbuffer. This is a DBG statement since any unexpected kill or + * signal, the application gets unregistered, relayd gets closed or + * anything that affects the buffer lifetime will trigger this error. + * So, for the sake of the user, don't print this error since it can + * happen and it is OK with the code flow. */ - ERR("Error writing to tracefile " + DBG("Error writing to tracefile " "(ret: %zd != len: %lu != subbuf_size: %lu)", ret, len, subbuf_size); }