Fix: change ERR/PERROR statement to DBG
authorDavid Goulet <dgoulet@efficios.com>
Tue, 18 Dec 2012 21:04:19 +0000 (16:04 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 18 Dec 2012 21:04:21 +0000 (16:04 -0500)
Most of the explanation is added as comments in the code.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/consumer.c
src/common/consumer.c
src/common/ust-consumer/ust-consumer.c

index 66cdc2479d28213acd65b4c988a413a072ec9ac5..ff55b57df4a59348a93a0047a3fd34e7a5d4011c 100644 (file)
@@ -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. */
                        }
                }
index 1af69ef93015c7e397c8028781dc3c97895c1790..be984a49270fefbba0b55bccd8ebf897ceea4ce7 100644 (file)
@@ -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;
                        }
index e5c5256c7b767675c7bbb748d1a5e25b84131580..1d8f6e81fb8bc9939da1045103ad9db160278fd0 100644 (file)
@@ -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);
        }
This page took 0.040088 seconds and 4 git commands to generate.