stream->buf, pos);
if (ret != 0) {
errno = -ret;
- PERROR("kernctl_snapshot_get_produced");
+ PERROR("ustctl_snapshot_get_produced");
}
return ret;
DBG("Consumer received unexpected message size %zd (expects %zu)",
ret, sizeof(msg));
lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_ERROR_RECV_FD);
+ /*
+ * The ret value might 0 meaning an orderly shutdown but this is ok
+ * since the caller handles this.
+ */
return ret;
}
if (msg.cmd_type == LTTNG_CONSUMER_STOP) {
if (ret != sizeof(fds)) {
lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_ERROR_RECV_FD);
rcu_read_unlock();
+ /*
+ * The ret value might 0 meaning an orderly shutdown but this is ok
+ * since the caller handles this.
+ */
return ret;
}
if (ret != sizeof(fds)) {
lttng_consumer_send_error(ctx, LTTCOMM_CONSUMERD_ERROR_RECV_FD);
rcu_read_unlock();
+ /*
+ * The ret value might 0 meaning an orderly shutdown but this is ok
+ * since the caller handles this.
+ */
return ret;
}
/* Get relayd reference if exists. */
relayd = consumer_find_relayd(index);
if (relayd == NULL) {
- ERR("Unable to find relayd %" PRIu64, index);
+ DBG("Unable to find relayd %" PRIu64, index);
ret_code = LTTNG_ERR_NO_CONSUMER;
}
}
case LTTNG_CONSUMER_DATA_PENDING:
{
- int32_t ret;
+ int ret, is_data_pending;
uint64_t id = msg.u.data_pending.session_id;
DBG("UST consumer data pending command for id %" PRIu64, id);
- ret = consumer_data_pending(id);
+ is_data_pending = consumer_data_pending(id);
/* Send back returned value to session daemon */
- ret = lttcomm_send_unix_sock(sock, &ret, sizeof(ret));
+ ret = lttcomm_send_unix_sock(sock, &is_data_pending,
+ sizeof(is_data_pending));
if (ret < 0) {
- PERROR("send data pending ret code");
+ DBG("Error when sending the data pending ret code: %d", ret);
}
/*
struct lttng_ust_shm_handle *handle;
struct lttng_ust_lib_ring_buffer *buf;
char dummy;
- ssize_t readlen;
DBG("In read_subbuffer (wait_fd: %d, stream key: %d)",
stream->wait_fd, stream->key);
/* We can consume the 1 byte written into the wait_fd by UST */
if (!stream->hangup_flush_done) {
+ ssize_t readlen;
+
do {
readlen = read(stream->wait_fd, &dummy, 1);
} while (readlen == -1 && errno == EINTR);
(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);
}
ret = lttng_ustconsumer_add_stream(stream);
if (ret) {
- consumer_del_stream(stream, NULL);
ret = -1;
goto error;
}