Most of the explanation is added as comments in the code.
Signed-off-by: David Goulet <dgoulet@efficios.com>
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;
}
/* 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. */
}
}
} 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;
}
(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);
}