Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: I87b05835a268fef92f906c16bb35a84c1df0a27f
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8485
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12395
Tested-by: jenkins <jenkins@lttng.org>
ssize_t received;
size_t total_received = 0, to_receive = len;
struct lttng_live_msg_iter *lttng_live_msg_iter = viewer_connection->lttng_live_msg_iter;
ssize_t received;
size_t total_received = 0, to_receive = len;
struct lttng_live_msg_iter *lttng_live_msg_iter = viewer_connection->lttng_live_msg_iter;
- enum lttng_live_viewer_status status;
BT_SOCKET sock = viewer_connection->control_sock;
/*
BT_SOCKET sock = viewer_connection->control_sock;
/*
* SIGINT and the graph is being torn
* down.
*/
* SIGINT and the graph is being torn
* down.
*/
- status = LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED;
lttng_live_msg_iter->was_interrupted = true;
lttng_live_msg_iter->was_interrupted = true;
+ return LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED;
} else {
/*
* A signal was received, but the graph
} else {
/*
* A signal was received, but the graph
LTTNG_LIVE_CPPLOGE_APPEND_CAUSE_ERRNO("Error receiving from Relay", ".");
viewer_connection_close_socket(viewer_connection);
LTTNG_LIVE_CPPLOGE_APPEND_CAUSE_ERRNO("Error receiving from Relay", ".");
viewer_connection_close_socket(viewer_connection);
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
} else if (received == 0) {
/*
}
} else if (received == 0) {
/*
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Remote side has closed connection");
viewer_connection_close_socket(viewer_connection);
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Remote side has closed connection");
viewer_connection_close_socket(viewer_connection);
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
BT_ASSERT(received <= to_receive);
}
BT_ASSERT(received <= to_receive);
} while (to_receive > 0);
BT_ASSERT(total_received == len);
} while (to_receive > 0);
BT_ASSERT(total_received == len);
- status = LTTNG_LIVE_VIEWER_STATUS_OK;
-
-end:
- return status;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
static enum lttng_live_viewer_status
lttng_live_send(struct live_viewer_connection *viewer_connection, const void *buf, size_t len)
{
static enum lttng_live_viewer_status
lttng_live_send(struct live_viewer_connection *viewer_connection, const void *buf, size_t len)
{
- enum lttng_live_viewer_status status;
struct lttng_live_msg_iter *lttng_live_msg_iter = viewer_connection->lttng_live_msg_iter;
BT_SOCKET sock = viewer_connection->control_sock;
size_t to_send = len;
struct lttng_live_msg_iter *lttng_live_msg_iter = viewer_connection->lttng_live_msg_iter;
BT_SOCKET sock = viewer_connection->control_sock;
size_t to_send = len;
* This interruption was a SIGINT and
* the graph is being teared down.
*/
* This interruption was a SIGINT and
* the graph is being teared down.
*/
- status = LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED;
lttng_live_msg_iter->was_interrupted = true;
lttng_live_msg_iter->was_interrupted = true;
+ return LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED;
} else {
/*
* A signal was received, but the graph
} else {
/*
* A signal was received, but the graph
LTTNG_LIVE_CPPLOGE_APPEND_CAUSE_ERRNO("Error sending to Relay", ".");
viewer_connection_close_socket(viewer_connection);
LTTNG_LIVE_CPPLOGE_APPEND_CAUSE_ERRNO("Error sending to Relay", ".");
viewer_connection_close_socket(viewer_connection);
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
} while (to_send > 0);
BT_ASSERT(total_sent == len);
} while (to_send > 0);
BT_ASSERT(total_sent == len);
- status = LTTNG_LIVE_VIEWER_STATUS_OK;
-
-end:
- return status;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
static int parse_url(struct live_viewer_connection *viewer_connection)
}
static int parse_url(struct live_viewer_connection *viewer_connection)
char error_buf[256] = {0};
struct bt_common_lttng_live_url_parts lttng_live_url_parts = {};
bt_common_lttng_live_url_parts_deleter partsDeleter {lttng_live_url_parts};
char error_buf[256] = {0};
struct bt_common_lttng_live_url_parts lttng_live_url_parts = {};
bt_common_lttng_live_url_parts_deleter partsDeleter {lttng_live_url_parts};
if (viewer_connection->url.empty()) {
if (viewer_connection->url.empty()) {
}
lttng_live_url_parts = bt_common_parse_lttng_live_url(viewer_connection->url.c_str(), error_buf,
}
lttng_live_url_parts = bt_common_parse_lttng_live_url(viewer_connection->url.c_str(), error_buf,
if (!lttng_live_url_parts.proto) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Invalid LTTng live URL format: {}",
error_buf);
if (!lttng_live_url_parts.proto) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Invalid LTTng live URL format: {}",
error_buf);
}
viewer_connection->proto.reset(lttng_live_url_parts.proto);
lttng_live_url_parts.proto = NULL;
}
viewer_connection->proto.reset(lttng_live_url_parts.proto);
lttng_live_url_parts.proto = NULL;
lttng_live_url_parts.session_name = NULL;
}
lttng_live_url_parts.session_name = NULL;
}
- ret = 0;
-
-end:
- return ret;
}
static enum lttng_live_viewer_status
}
static enum lttng_live_viewer_status
status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "viewer connect command");
status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "viewer connect command");
}
status = lttng_live_recv(viewer_connection, &connect, sizeof(connect));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "viewer connect reply");
}
status = lttng_live_recv(viewer_connection, &connect, sizeof(connect));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "viewer connect reply");
}
BT_CPPLOGI_SPEC(viewer_connection->logger, "Received viewer session ID : {}",
}
BT_CPPLOGI_SPEC(viewer_connection->logger, "Received viewer session ID : {}",
if (LTTNG_LIVE_MAJOR != be32toh(connect.major)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Incompatible lttng-relayd protocol");
if (LTTNG_LIVE_MAJOR != be32toh(connect.major)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Incompatible lttng-relayd protocol");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
/* Use the smallest protocol version implemented. */
if (LTTNG_LIVE_MINOR > be32toh(connect.minor)) {
}
/* Use the smallest protocol version implemented. */
if (LTTNG_LIVE_MINOR > be32toh(connect.minor)) {
}
viewer_connection->major = LTTNG_LIVE_MAJOR;
}
viewer_connection->major = LTTNG_LIVE_MAJOR;
- status = LTTNG_LIVE_VIEWER_STATUS_OK;
-
- goto end;
-
-end:
- return status;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
static enum lttng_live_viewer_status
}
static enum lttng_live_viewer_status
if (parse_url(viewer_connection)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Failed to parse URL");
if (parse_url(viewer_connection)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Failed to parse URL");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto error;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Cannot lookup hostname: hostname=\"{}\"",
viewer_connection->relay_hostname->str);
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Cannot lookup hostname: hostname=\"{}\"",
viewer_connection->relay_hostname->str);
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto error;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
if ((viewer_connection->control_sock = socket(AF_INET, SOCK_STREAM, 0)) == BT_INVALID_SOCKET) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Socket creation failed: {}",
bt_socket_errormsg());
}
if ((viewer_connection->control_sock = socket(AF_INET, SOCK_STREAM, 0)) == BT_INVALID_SOCKET) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Socket creation failed: {}",
bt_socket_errormsg());
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto error;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
server_addr.sin_family = AF_INET;
}
server_addr.sin_family = AF_INET;
sizeof(struct sockaddr)) == BT_SOCKET_ERROR) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Connection failed: {}",
bt_socket_errormsg());
sizeof(struct sockaddr)) == BT_SOCKET_ERROR) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Connection failed: {}",
bt_socket_errormsg());
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto error;
+ viewer_connection_close_socket(viewer_connection);
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
status = lttng_live_handshake(viewer_connection);
}
status = lttng_live_handshake(viewer_connection);
*/
if (status == LTTNG_LIVE_VIEWER_STATUS_ERROR) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Viewer handshake failed");
*/
if (status == LTTNG_LIVE_VIEWER_STATUS_ERROR) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Viewer handshake failed");
+ viewer_connection_close_socket(viewer_connection);
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
} else if (status == LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED) {
} else if (status == LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED) {
+ return LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED;
- goto end;
-
-error:
- viewer_connection_close_socket(viewer_connection);
-
-end:
- return status;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
static int list_update_session(const bt2::ArrayValue results,
}
static int list_update_session(const bt2::ArrayValue results,
status = lttng_live_send(viewer_connection, &cmd, sizeof(cmd));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "list sessions command");
status = lttng_live_send(viewer_connection, &cmd, sizeof(cmd));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "list sessions command");
}
status = lttng_live_recv(viewer_connection, &list, sizeof(list));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "session list reply");
}
status = lttng_live_recv(viewer_connection, &list, sizeof(list));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "session list reply");
}
sessions_count = be32toh(list.sessions_count);
}
sessions_count = be32toh(list.sessions_count);
status = lttng_live_recv(viewer_connection, &lsession, sizeof(lsession));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "session reply");
status = lttng_live_recv(viewer_connection, &lsession, sizeof(lsession));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "session reply");
}
lsession.hostname[LTTNG_VIEWER_HOST_NAME_MAX - 1] = '\0';
lsession.session_name[LTTNG_VIEWER_NAME_MAX - 1] = '\0';
}
lsession.hostname[LTTNG_VIEWER_HOST_NAME_MAX - 1] = '\0';
lsession.session_name[LTTNG_VIEWER_NAME_MAX - 1] = '\0';
lsession.session_name)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Failed to add live session");
lsession.session_name)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Failed to add live session");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
- status = LTTNG_LIVE_VIEWER_STATUS_OK;
-
-end:
- return status;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
enum lttng_live_viewer_status
}
enum lttng_live_viewer_status
status = lttng_live_send(viewer_connection, &cmd, sizeof(cmd));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "create session command");
status = lttng_live_send(viewer_connection, &cmd, sizeof(cmd));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "create session command");
}
status = lttng_live_recv(viewer_connection, &resp, sizeof(resp));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "create session reply");
}
status = lttng_live_recv(viewer_connection, &resp, sizeof(resp));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "create session reply");
}
if (be32toh(resp.status) != LTTNG_VIEWER_CREATE_SESSION_OK) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Error creating viewer session");
}
if (be32toh(resp.status) != LTTNG_VIEWER_CREATE_SESSION_OK) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Error creating viewer session");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
status = lttng_live_query_session_ids(lttng_live_msg_iter);
if (status == LTTNG_LIVE_VIEWER_STATUS_ERROR) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Failed to query live viewer session ids");
}
status = lttng_live_query_session_ids(lttng_live_msg_iter);
if (status == LTTNG_LIVE_VIEWER_STATUS_ERROR) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Failed to query live viewer session ids");
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
} else if (status == LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED) {
} else if (status == LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED) {
+ return LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
static enum lttng_live_viewer_status receive_streams(struct lttng_live_session *session,
}
static enum lttng_live_viewer_status receive_streams(struct lttng_live_session *session,
status = lttng_live_recv(viewer_connection, &stream, sizeof(stream));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "stream reply");
status = lttng_live_recv(viewer_connection, &stream, sizeof(stream));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "stream reply");
}
stream.path_name[LTTNG_VIEWER_PATH_MAX - 1] = '\0';
stream.channel_name[LTTNG_VIEWER_NAME_MAX - 1] = '\0';
}
stream.path_name[LTTNG_VIEWER_PATH_MAX - 1] = '\0';
stream.channel_name[LTTNG_VIEWER_NAME_MAX - 1] = '\0';
if (lttng_live_metadata_create_stream(session, ctf_trace_id, stream_id)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Error creating metadata stream");
if (lttng_live_metadata_create_stream(session, ctf_trace_id, stream_id)) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Error creating metadata stream");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
session->lazy_stream_msg_init = true;
} else {
}
session->lazy_stream_msg_init = true;
} else {
lttng_live_stream_iterator_create(session, ctf_trace_id, stream_id, self_msg_iter);
if (!live_stream) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Error creating stream");
lttng_live_stream_iterator_create(session, ctf_trace_id, stream_id, self_msg_iter);
if (!live_stream) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Error creating stream");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
- status = LTTNG_LIVE_VIEWER_STATUS_OK;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
enum lttng_live_viewer_status lttng_live_session_attach(struct lttng_live_session *session,
}
enum lttng_live_viewer_status lttng_live_session_attach(struct lttng_live_session *session,
status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "attach session command");
status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "attach session command");
}
status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "attach session reply");
}
status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "attach session reply");
}
streams_count = be32toh(rp.streams_count);
}
streams_count = be32toh(rp.streams_count);
case LTTNG_VIEWER_ATTACH_UNK:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Session id {} is unknown",
session_id);
case LTTNG_VIEWER_ATTACH_UNK:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Session id {} is unknown",
session_id);
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
case LTTNG_VIEWER_ATTACH_ALREADY:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"There is already a viewer attached to this session");
case LTTNG_VIEWER_ATTACH_ALREADY:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"There is already a viewer attached to this session");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
case LTTNG_VIEWER_ATTACH_NOT_LIVE:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Not a live session");
case LTTNG_VIEWER_ATTACH_NOT_LIVE:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Not a live session");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
case LTTNG_VIEWER_ATTACH_SEEK_ERR:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Wrong seek parameter");
case LTTNG_VIEWER_ATTACH_SEEK_ERR:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Wrong seek parameter");
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Unknown attach return code {}",
be32toh(rp.status));
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Unknown attach return code {}",
be32toh(rp.status));
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
/* We receive the initial list of streams. */
}
/* We receive the initial list of streams. */
case LTTNG_LIVE_VIEWER_STATUS_OK:
break;
case LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED:
case LTTNG_LIVE_VIEWER_STATUS_OK:
break;
case LTTNG_LIVE_VIEWER_STATUS_INTERRUPTED:
case LTTNG_LIVE_VIEWER_STATUS_ERROR:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Error receiving streams");
case LTTNG_LIVE_VIEWER_STATUS_ERROR:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Error receiving streams");
default:
bt_common_abort();
}
default:
bt_common_abort();
}
session->attached = true;
session->new_streams_needed = false;
session->attached = true;
session->new_streams_needed = false;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
enum lttng_live_viewer_status lttng_live_session_detach(struct lttng_live_session *session)
}
enum lttng_live_viewer_status lttng_live_session_detach(struct lttng_live_session *session)
status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "detach session command");
status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(status, "detach session command");
}
status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "detach session reply");
}
status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(status, "detach session reply");
}
switch (be32toh(rp.status)) {
}
switch (be32toh(rp.status)) {
break;
case LTTNG_VIEWER_DETACH_SESSION_UNK:
BT_CPPLOGW_SPEC(viewer_connection->logger, "Session id {} is unknown", session_id);
break;
case LTTNG_VIEWER_DETACH_SESSION_UNK:
BT_CPPLOGW_SPEC(viewer_connection->logger, "Session id {} is unknown", session_id);
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
case LTTNG_VIEWER_DETACH_SESSION_ERR:
BT_CPPLOGW_SPEC(viewer_connection->logger, "Error detaching session id {}", session_id);
case LTTNG_VIEWER_DETACH_SESSION_ERR:
BT_CPPLOGW_SPEC(viewer_connection->logger, "Error detaching session id {}", session_id);
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
default:
BT_CPPLOGE_SPEC(viewer_connection->logger, "Unknown detach return code {}",
be32toh(rp.status));
default:
BT_CPPLOGE_SPEC(viewer_connection->logger, "Unknown detach return code {}",
be32toh(rp.status));
- status = LTTNG_LIVE_VIEWER_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_VIEWER_STATUS_ERROR;
}
session->attached = false;
}
session->attached = false;
- status = LTTNG_LIVE_VIEWER_STATUS_OK;
-
-end:
- return status;
+ return LTTNG_LIVE_VIEWER_STATUS_OK;
}
enum lttng_live_get_one_metadata_status
lttng_live_get_one_metadata_packet(struct lttng_live_trace *trace, std::vector<char>& buf)
{
uint64_t len = 0;
}
enum lttng_live_get_one_metadata_status
lttng_live_get_one_metadata_packet(struct lttng_live_trace *trace, std::vector<char>& buf)
{
uint64_t len = 0;
- enum lttng_live_get_one_metadata_status status;
enum lttng_live_viewer_status viewer_status;
struct lttng_viewer_cmd cmd;
struct lttng_viewer_get_metadata rq;
enum lttng_live_viewer_status viewer_status;
struct lttng_viewer_cmd cmd;
struct lttng_viewer_get_metadata rq;
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get metadata command");
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get metadata command");
- status = (enum lttng_live_get_one_metadata_status) viewer_status;
- goto end;
+ return (lttng_live_get_one_metadata_status) viewer_status;
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get metadata reply");
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get metadata reply");
- status = (enum lttng_live_get_one_metadata_status) viewer_status;
- goto end;
+ return (lttng_live_get_one_metadata_status) viewer_status;
}
switch (be32toh(rp.status)) {
}
switch (be32toh(rp.status)) {
break;
case LTTNG_VIEWER_NO_NEW_METADATA:
BT_CPPLOGD_SPEC(viewer_connection->logger, "Received get_metadata response: no new");
break;
case LTTNG_VIEWER_NO_NEW_METADATA:
BT_CPPLOGD_SPEC(viewer_connection->logger, "Received get_metadata response: no new");
- status = LTTNG_LIVE_GET_ONE_METADATA_STATUS_END;
- goto end;
+ return LTTNG_LIVE_GET_ONE_METADATA_STATUS_END;
case LTTNG_VIEWER_METADATA_ERR:
/*
* The Relayd cannot find this stream id. Maybe its
case LTTNG_VIEWER_METADATA_ERR:
/*
* The Relayd cannot find this stream id. Maybe its
* in a per-pid session.
*/
BT_CPPLOGD_SPEC(viewer_connection->logger, "Received get_metadata response: error");
* in a per-pid session.
*/
BT_CPPLOGD_SPEC(viewer_connection->logger, "Received get_metadata response: error");
- status = LTTNG_LIVE_GET_ONE_METADATA_STATUS_CLOSED;
- goto end;
+ return LTTNG_LIVE_GET_ONE_METADATA_STATUS_CLOSED;
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Received get_metadata response: unknown");
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Received get_metadata response: unknown");
- status = LTTNG_LIVE_GET_ONE_METADATA_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_GET_ONE_METADATA_STATUS_ERROR;
BT_CPPLOGD_SPEC(
viewer_connection->logger,
"Expecting a metadata packet of size 0. Retry to get a packet from the relay.");
BT_CPPLOGD_SPEC(
viewer_connection->logger,
"Expecting a metadata packet of size 0. Retry to get a packet from the relay.");
- goto empty_metadata_packet_retry;
+ return LTTNG_LIVE_GET_ONE_METADATA_STATUS_OK;
}
BT_CPPLOGD_SPEC(viewer_connection->logger, "Writing {} bytes to metadata", len);
if (len <= 0) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Erroneous response length");
}
BT_CPPLOGD_SPEC(viewer_connection->logger, "Writing {} bytes to metadata", len);
if (len <= 0) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger, "Erroneous response length");
- status = LTTNG_LIVE_GET_ONE_METADATA_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_GET_ONE_METADATA_STATUS_ERROR;
viewer_status = lttng_live_recv(viewer_connection, data.data(), len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get metadata packet");
viewer_status = lttng_live_recv(viewer_connection, data.data(), len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get metadata packet");
- status = (enum lttng_live_get_one_metadata_status) viewer_status;
- goto end;
+ return (lttng_live_get_one_metadata_status) viewer_status;
*/
buf.insert(buf.end(), data.begin(), data.end());
*/
buf.insert(buf.end(), data.begin(), data.end());
-empty_metadata_packet_retry:
- status = LTTNG_LIVE_GET_ONE_METADATA_STATUS_OK;
-
-end:
- return status;
+ return LTTNG_LIVE_GET_ONE_METADATA_STATUS_OK;
struct lttng_viewer_get_next_index rq;
enum lttng_live_viewer_status viewer_status;
struct lttng_viewer_index rp;
struct lttng_viewer_get_next_index rq;
enum lttng_live_viewer_status viewer_status;
struct lttng_viewer_index rp;
- enum lttng_live_iterator_status status;
live_viewer_connection *viewer_connection = lttng_live_msg_iter->viewer_connection.get();
struct lttng_live_trace *trace = stream->trace;
const size_t cmd_buf_len = sizeof(cmd) + sizeof(rq);
live_viewer_connection *viewer_connection = lttng_live_msg_iter->viewer_connection.get();
struct lttng_live_trace *trace = stream->trace;
const size_t cmd_buf_len = sizeof(cmd) + sizeof(rq);
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get next index command");
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get next index command");
+ return viewer_status_to_live_iterator_status(viewer_status);
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get next index reply");
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get next index reply");
+ return viewer_status_to_live_iterator_status(viewer_status);
}
flags = be32toh(rp.flags);
}
flags = be32toh(rp.flags);
stream->ctf_stream_class_id.is_set = true;
}
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_QUIESCENT);
stream->ctf_stream_class_id.is_set = true;
}
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_QUIESCENT);
- status = LTTNG_LIVE_ITERATOR_STATUS_OK;
- break;
+ return LTTNG_LIVE_ITERATOR_STATUS_OK;
}
case LTTNG_VIEWER_INDEX_OK:
{
}
case LTTNG_VIEWER_INDEX_OK:
{
static_cast<lttng_viewer_next_index_return_code>(rp_status), trace->id);
trace->metadata_stream_state = LTTNG_LIVE_METADATA_STREAM_STATE_NEEDED;
}
static_cast<lttng_viewer_next_index_return_code>(rp_status), trace->id);
trace->metadata_stream_state = LTTNG_LIVE_METADATA_STREAM_STATE_NEEDED;
}
- status = LTTNG_LIVE_ITERATOR_STATUS_OK;
+ return LTTNG_LIVE_ITERATOR_STATUS_OK;
break;
}
case LTTNG_VIEWER_INDEX_RETRY:
memset(index, 0, sizeof(struct packet_index));
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_ACTIVE_NO_DATA);
break;
}
case LTTNG_VIEWER_INDEX_RETRY:
memset(index, 0, sizeof(struct packet_index));
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_ACTIVE_NO_DATA);
- status = LTTNG_LIVE_ITERATOR_STATUS_AGAIN;
- goto end;
+ return LTTNG_LIVE_ITERATOR_STATUS_AGAIN;
case LTTNG_VIEWER_INDEX_HUP:
memset(index, 0, sizeof(struct packet_index));
index->offset = EOF;
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_EOF);
stream->has_stream_hung_up = true;
case LTTNG_VIEWER_INDEX_HUP:
memset(index, 0, sizeof(struct packet_index));
index->offset = EOF;
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_EOF);
stream->has_stream_hung_up = true;
- status = LTTNG_LIVE_ITERATOR_STATUS_END;
- break;
+ return LTTNG_LIVE_ITERATOR_STATUS_END;
case LTTNG_VIEWER_INDEX_ERR:
memset(index, 0, sizeof(struct packet_index));
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_ACTIVE_NO_DATA);
case LTTNG_VIEWER_INDEX_ERR:
memset(index, 0, sizeof(struct packet_index));
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_ACTIVE_NO_DATA);
- status = LTTNG_LIVE_ITERATOR_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_ITERATOR_STATUS_ERROR;
default:
BT_CPPLOGD_SPEC(viewer_connection->logger,
"Received get_next_index response: unknown value");
memset(index, 0, sizeof(struct packet_index));
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_ACTIVE_NO_DATA);
default:
BT_CPPLOGD_SPEC(viewer_connection->logger,
"Received get_next_index response: unknown value");
memset(index, 0, sizeof(struct packet_index));
lttng_live_stream_iterator_set_state(stream, LTTNG_LIVE_STREAM_ACTIVE_NO_DATA);
- status = LTTNG_LIVE_ITERATOR_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_ITERATOR_STATUS_ERROR;
-
- goto end;
-
-error:
- status = viewer_status_to_live_iterator_status(viewer_status);
-end:
- return status;
}
enum ctf_msg_iter_medium_status
}
enum ctf_msg_iter_medium_status
struct lttng_live_stream_iterator *stream, uint8_t *buf,
uint64_t offset, uint64_t req_len, uint64_t *recv_len)
{
struct lttng_live_stream_iterator *stream, uint8_t *buf,
uint64_t offset, uint64_t req_len, uint64_t *recv_len)
{
- enum ctf_msg_iter_medium_status status;
enum lttng_live_viewer_status viewer_status;
struct lttng_viewer_trace_packet rp;
struct lttng_viewer_cmd cmd;
enum lttng_live_viewer_status viewer_status;
struct lttng_viewer_trace_packet rp;
struct lttng_viewer_cmd cmd;
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get data packet command");
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get data packet command");
- goto error_convert_status;
+ return viewer_status_to_ctf_msg_iter_medium_status(viewer_status);
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get data packet reply");
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get data packet reply");
- goto error_convert_status;
+ return viewer_status_to_ctf_msg_iter_medium_status(viewer_status);
}
flags = be32toh(rp.flags);
}
flags = be32toh(rp.flags);
break;
case LTTNG_VIEWER_GET_PACKET_RETRY:
/* Unimplemented by relay daemon */
break;
case LTTNG_VIEWER_GET_PACKET_RETRY:
/* Unimplemented by relay daemon */
- status = CTF_MSG_ITER_MEDIUM_STATUS_AGAIN;
- goto end;
+ return CTF_MSG_ITER_MEDIUM_STATUS_AGAIN;
case LTTNG_VIEWER_GET_PACKET_ERR:
if (flags & LTTNG_VIEWER_FLAG_NEW_METADATA) {
BT_CPPLOGD_SPEC(viewer_connection->logger,
case LTTNG_VIEWER_GET_PACKET_ERR:
if (flags & LTTNG_VIEWER_FLAG_NEW_METADATA) {
BT_CPPLOGD_SPEC(viewer_connection->logger,
lttng_live_need_new_streams(lttng_live_msg_iter);
}
if (flags & (LTTNG_VIEWER_FLAG_NEW_METADATA | LTTNG_VIEWER_FLAG_NEW_STREAM)) {
lttng_live_need_new_streams(lttng_live_msg_iter);
}
if (flags & (LTTNG_VIEWER_FLAG_NEW_METADATA | LTTNG_VIEWER_FLAG_NEW_STREAM)) {
- status = CTF_MSG_ITER_MEDIUM_STATUS_AGAIN;
BT_CPPLOGD_SPEC(viewer_connection->logger,
"Reply with any one flags set means we should retry: response={}",
static_cast<lttng_viewer_get_packet_return_code>(rp_status));
BT_CPPLOGD_SPEC(viewer_connection->logger,
"Reply with any one flags set means we should retry: response={}",
static_cast<lttng_viewer_get_packet_return_code>(rp_status));
+ return CTF_MSG_ITER_MEDIUM_STATUS_AGAIN;
}
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Received get_data_packet response: error");
}
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Received get_data_packet response: error");
- status = CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
- goto end;
+ return CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
case LTTNG_VIEWER_GET_PACKET_EOF:
case LTTNG_VIEWER_GET_PACKET_EOF:
- status = CTF_MSG_ITER_MEDIUM_STATUS_EOF;
- goto end;
+ return CTF_MSG_ITER_MEDIUM_STATUS_EOF;
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Received get_data_packet response: unknown ({})", rp_status);
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
"Received get_data_packet response: unknown ({})", rp_status);
- status = CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
- goto end;
+ return CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
- status = CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
- goto end;
+ return CTF_MSG_ITER_MEDIUM_STATUS_ERROR;
}
viewer_status = lttng_live_recv(viewer_connection, buf, req_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get data packet");
}
viewer_status = lttng_live_recv(viewer_connection, buf, req_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get data packet");
- goto error_convert_status;
+ return viewer_status_to_ctf_msg_iter_medium_status(viewer_status);
- status = CTF_MSG_ITER_MEDIUM_STATUS_OK;
- goto end;
-
-error_convert_status:
- status = viewer_status_to_ctf_msg_iter_medium_status(viewer_status);
-end:
- return status;
+ return CTF_MSG_ITER_MEDIUM_STATUS_OK;
lttng_live_session_get_new_streams(struct lttng_live_session *session,
bt_self_message_iterator *self_msg_iter)
{
lttng_live_session_get_new_streams(struct lttng_live_session *session,
bt_self_message_iterator *self_msg_iter)
{
- enum lttng_live_iterator_status status = LTTNG_LIVE_ITERATOR_STATUS_OK;
struct lttng_viewer_cmd cmd;
struct lttng_viewer_new_streams_request rq;
struct lttng_viewer_new_streams_response rp;
struct lttng_viewer_cmd cmd;
struct lttng_viewer_new_streams_request rq;
struct lttng_viewer_new_streams_response rp;
char cmd_buf[cmd_buf_len];
if (!session->new_streams_needed) {
char cmd_buf[cmd_buf_len];
if (!session->new_streams_needed) {
- status = LTTNG_LIVE_ITERATOR_STATUS_OK;
- goto end;
+ return LTTNG_LIVE_ITERATOR_STATUS_OK;
}
BT_CPPLOGD_SPEC(viewer_connection->logger,
}
BT_CPPLOGD_SPEC(viewer_connection->logger,
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get new streams command");
viewer_status = lttng_live_send(viewer_connection, &cmd_buf, cmd_buf_len);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_send_status(viewer_status, "get new streams command");
- status = viewer_status_to_live_iterator_status(viewer_status);
- goto end;
+ return viewer_status_to_live_iterator_status(viewer_status);
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get new streams reply");
}
viewer_status = lttng_live_recv(viewer_connection, &rp, sizeof(rp));
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "get new streams reply");
- status = viewer_status_to_live_iterator_status(viewer_status);
- goto end;
+ return viewer_status_to_live_iterator_status(viewer_status);
}
streams_count = be32toh(rp.streams_count);
}
streams_count = be32toh(rp.streams_count);
break;
case LTTNG_VIEWER_NEW_STREAMS_NO_NEW:
session->new_streams_needed = false;
break;
case LTTNG_VIEWER_NEW_STREAMS_NO_NEW:
session->new_streams_needed = false;
+ return LTTNG_LIVE_ITERATOR_STATUS_OK;
case LTTNG_VIEWER_NEW_STREAMS_HUP:
session->new_streams_needed = false;
session->closed = true;
case LTTNG_VIEWER_NEW_STREAMS_HUP:
session->new_streams_needed = false;
session->closed = true;
- status = LTTNG_LIVE_ITERATOR_STATUS_END;
- goto end;
+ return LTTNG_LIVE_ITERATOR_STATUS_END;
case LTTNG_VIEWER_NEW_STREAMS_ERR:
BT_CPPLOGD_SPEC(viewer_connection->logger, "Received get_new_streams response: error");
case LTTNG_VIEWER_NEW_STREAMS_ERR:
BT_CPPLOGD_SPEC(viewer_connection->logger, "Received get_new_streams response: error");
- status = LTTNG_LIVE_ITERATOR_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_ITERATOR_STATUS_ERROR;
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
default:
BT_CPPLOGE_APPEND_CAUSE_SPEC(viewer_connection->logger,
- "Received get_new_streams response: Unknown:"
- "return code {}",
+ "Received get_new_streams response: Unknown return code {}",
- status = LTTNG_LIVE_ITERATOR_STATUS_ERROR;
- goto end;
+ return LTTNG_LIVE_ITERATOR_STATUS_ERROR;
}
viewer_status = receive_streams(session, streams_count, self_msg_iter);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "new streams");
}
viewer_status = receive_streams(session, streams_count, self_msg_iter);
if (viewer_status != LTTNG_LIVE_VIEWER_STATUS_OK) {
viewer_handle_recv_status(viewer_status, "new streams");
- status = viewer_status_to_live_iterator_status(viewer_status);
- goto end;
+ return viewer_status_to_live_iterator_status(viewer_status);
- status = LTTNG_LIVE_ITERATOR_STATUS_OK;
-end:
- return status;
+ return LTTNG_LIVE_ITERATOR_STATUS_OK;
}
enum lttng_live_viewer_status
}
enum lttng_live_viewer_status