conn->minor = be32toh(msg.minor);
}
- if (be32toh(msg.type) == VIEWER_CLIENT_COMMAND) {
+ if (be32toh(msg.type) == LTTNG_VIEWER_CLIENT_COMMAND) {
conn->type = RELAY_VIEWER_COMMAND;
- } else if (be32toh(msg.type) == VIEWER_CLIENT_NOTIFICATION) {
+ } else if (be32toh(msg.type) == LTTNG_VIEWER_CLIENT_NOTIFICATION) {
conn->type = RELAY_VIEWER_NOTIFICATION;
} else {
ERR("Unknown connection type : %u", be32toh(msg.type));
if (!session) {
DBG("Relay session %" PRIu64 " not found",
be64toh(request.session_id));
- response.status = htobe32(VIEWER_NEW_STREAMS_ERR);
+ response.status = htobe32(LTTNG_VIEWER_NEW_STREAMS_ERR);
goto send_reply;
}
if (conn->session_id == session->id) {
/* We confirmed the viewer is asking for the same session. */
send_streams = 1;
- response.status = htobe32(VIEWER_NEW_STREAMS_OK);
+ response.status = htobe32(LTTNG_VIEWER_NEW_STREAMS_OK);
} else {
send_streams = 0;
- response.status = htobe32(VIEWER_NEW_STREAMS_ERR);
+ response.status = htobe32(LTTNG_VIEWER_NEW_STREAMS_ERR);
goto send_reply;
}
goto send_reply;
}
- ret = make_viewer_streams(session, VIEWER_SEEK_LAST, NULL, &nb_unsent,
+ ret = make_viewer_streams(session, LTTNG_VIEWER_SEEK_LAST, NULL, &nb_unsent,
&nb_created);
if (ret < 0) {
goto end_unlock;
if (!session) {
DBG("Relay session %" PRIu64 " not found",
be64toh(request.session_id));
- response.status = htobe32(VIEWER_ATTACH_UNK);
+ response.status = htobe32(LTTNG_VIEWER_ATTACH_UNK);
goto send_reply;
}
session_viewer_attach(session);
if (uatomic_read(&session->viewer_refcount) > 1) {
DBG("Already a viewer attached");
- response.status = htobe32(VIEWER_ATTACH_ALREADY);
+ response.status = htobe32(LTTNG_VIEWER_ATTACH_ALREADY);
session_viewer_detach(session);
goto send_reply;
} else if (session->live_timer == 0) {
DBG("Not live session");
- response.status = htobe32(VIEWER_ATTACH_NOT_LIVE);
+ response.status = htobe32(LTTNG_VIEWER_ATTACH_NOT_LIVE);
goto send_reply;
} else {
send_streams = 1;
- response.status = htobe32(VIEWER_ATTACH_OK);
+ response.status = htobe32(LTTNG_VIEWER_ATTACH_OK);
conn->session_id = session->id;
conn->session = session;
}
switch (be32toh(request.seek)) {
- case VIEWER_SEEK_BEGINNING:
- case VIEWER_SEEK_LAST:
+ case LTTNG_VIEWER_SEEK_BEGINNING:
+ case LTTNG_VIEWER_SEEK_LAST:
seek_type = be32toh(request.seek);
break;
default:
ERR("Wrong seek parameter");
- response.status = htobe32(VIEWER_ATTACH_SEEK_ERR);
+ response.status = htobe32(LTTNG_VIEWER_ATTACH_SEEK_ERR);
send_streams = 0;
goto send_reply;
}
* The viewer should not ask for index on metadata stream.
*/
if (vstream->metadata_flag) {
- viewer_index.status = htobe32(VIEWER_INDEX_HUP);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_HUP);
goto send_reply;
}
* The index is created only when the first data packet arrives, it
* might not be ready at the beginning of the session
*/
- viewer_index.status = htobe32(VIEWER_INDEX_RETRY);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_RETRY);
goto send_reply;
} else if (ret < 0) {
- viewer_index.status = htobe32(VIEWER_INDEX_ERR);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_ERR);
goto send_reply;
}
vstream->index_read_fd = ret;
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
- viewer_index.status = htobe32(VIEWER_INDEX_HUP);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_HUP);
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
if (rstream->tracefile_count_current == vstream->tracefile_count_current) {
if (rstream->beacon_ts_end != -1ULL &&
vstream->last_sent_index == rstream->total_index_received) {
- viewer_index.status = htobe32(VIEWER_INDEX_INACTIVE);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_INACTIVE);
viewer_index.timestamp_end = htobe64(rstream->beacon_ts_end);
pthread_mutex_unlock(&rstream->viewer_stream_rotation_lock);
goto send_reply;
*/
pthread_mutex_unlock(&rstream->viewer_stream_rotation_lock);
/* No new index to send, retry later. */
- viewer_index.status = htobe32(VIEWER_INDEX_RETRY);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_RETRY);
goto send_reply;
}
}
} else if (rstream->close_flag && vstream->close_write_flag &&
vstream->total_index_received == vstream->last_sent_index) {
/* Last index sent and current tracefile closed in write */
- viewer_index.status = htobe32(VIEWER_INDEX_HUP);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_HUP);
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
/*
* The file is being overwritten by the writer, we cannot * use it.
*/
- viewer_index.status = htobe32(VIEWER_INDEX_RETRY);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_RETRY);
pthread_mutex_unlock(&vstream->overwrite_lock);
ret = viewer_stream_rotate(vstream, rstream);
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
- viewer_index.status = htobe32(VIEWER_INDEX_HUP);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_HUP);
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
* The tracefile is closed in write, so we read up to EOF.
*/
if (vstream->close_write_flag == 1) {
- viewer_index.status = htobe32(VIEWER_INDEX_RETRY);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_RETRY);
/* Rotate on normal EOF */
ret = viewer_stream_rotate(vstream, rstream);
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
- viewer_index.status = htobe32(VIEWER_INDEX_HUP);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_HUP);
viewer_stream_delete(vstream);
viewer_stream_destroy(ctf_trace, vstream);
goto send_reply;
}
} else {
PERROR("Relay reading index file %d", vstream->index_read_fd);
- viewer_index.status = htobe32(VIEWER_INDEX_ERR);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_ERR);
}
goto send_reply;
} else {
- viewer_index.status = htobe32(VIEWER_INDEX_OK);
+ viewer_index.status = htobe32(LTTNG_VIEWER_INDEX_OK);
vstream->last_sent_index++;
}
if (!ctf_trace->metadata_received ||
ctf_trace->metadata_received > ctf_trace->metadata_sent) {
- reply.status = htobe32(VIEWER_GET_PACKET_ERR);
+ reply.status = htobe32(LTTNG_VIEWER_GET_PACKET_ERR);
reply.flags |= LTTNG_VIEWER_FLAG_NEW_METADATA;
goto send_reply;
}
if (ret < 0) {
goto end_unlock;
} else if (ret == 1) {
- reply.status = htobe32(VIEWER_GET_PACKET_ERR);
+ reply.status = htobe32(LTTNG_VIEWER_GET_PACKET_ERR);
reply.flags |= LTTNG_VIEWER_FLAG_NEW_STREAM;
goto send_reply;
}
PERROR("lseek");
goto error;
}
- reply.status = htobe32(VIEWER_GET_PACKET_EOF);
+ reply.status = htobe32(LTTNG_VIEWER_GET_PACKET_EOF);
goto send_reply;
}
read_len = lttng_read(stream->read_fd, data, len);
be64toh(get_packet_info.offset));
goto error;
} else {
- reply.status = htobe32(VIEWER_GET_PACKET_EOF);
+ reply.status = htobe32(LTTNG_VIEWER_GET_PACKET_EOF);
goto send_reply;
}
}
- reply.status = htobe32(VIEWER_GET_PACKET_OK);
+ reply.status = htobe32(LTTNG_VIEWER_GET_PACKET_OK);
reply.len = htobe32(len);
send_data = 1;
goto send_reply;
error:
- reply.status = htobe32(VIEWER_GET_PACKET_ERR);
+ reply.status = htobe32(LTTNG_VIEWER_GET_PACKET_ERR);
send_reply:
reply.flags = htobe32(reply.flags);
len = ctf_trace->metadata_received - ctf_trace->metadata_sent;
if (len == 0) {
- reply.status = htobe32(VIEWER_NO_NEW_METADATA);
+ reply.status = htobe32(LTTNG_VIEWER_NO_NEW_METADATA);
goto send_reply;
}
goto error;
}
ctf_trace->metadata_sent += read_len;
- reply.status = htobe32(VIEWER_METADATA_OK);
+ reply.status = htobe32(LTTNG_VIEWER_METADATA_OK);
goto send_reply;
error:
- reply.status = htobe32(VIEWER_METADATA_ERR);
+ reply.status = htobe32(LTTNG_VIEWER_METADATA_ERR);
send_reply:
health_code_update();
* Make sure we've done the version check before any command other then a
* new client connection.
*/
- if (msg_value != VIEWER_CONNECT && !conn->version_check_done) {
+ if (msg_value != LTTNG_VIEWER_CONNECT && !conn->version_check_done) {
ERR("Viewer conn value %" PRIu32 " before version check", msg_value);
ret = -1;
goto end;
}
switch (msg_value) {
- case VIEWER_CONNECT:
+ case LTTNG_VIEWER_CONNECT:
ret = viewer_connect(conn);
break;
- case VIEWER_LIST_SESSIONS:
+ case LTTNG_VIEWER_LIST_SESSIONS:
ret = viewer_list_sessions(conn);
break;
- case VIEWER_ATTACH_SESSION:
+ case LTTNG_VIEWER_ATTACH_SESSION:
ret = viewer_attach_session(conn);
break;
- case VIEWER_GET_NEXT_INDEX:
+ case LTTNG_VIEWER_GET_NEXT_INDEX:
ret = viewer_get_next_index(conn);
break;
- case VIEWER_GET_PACKET:
+ case LTTNG_VIEWER_GET_PACKET:
ret = viewer_get_packet(conn);
break;
- case VIEWER_GET_METADATA:
+ case LTTNG_VIEWER_GET_METADATA:
ret = viewer_get_metadata(conn);
break;
- case VIEWER_GET_NEW_STREAMS:
+ case LTTNG_VIEWER_GET_NEW_STREAMS:
ret = viewer_get_new_streams(conn);
break;
default:
-#ifndef LTTNG_VIEWER_ABI_H
-#define LTTNG_VIEWER_ABI_H
+#ifndef LTTNG_VIEWER_H
+#define LTTNG_VIEWER_H
/*
* Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
#define LTTNG_VIEWER_PATH_MAX 4096
#define LTTNG_VIEWER_NAME_MAX 255
-#define LTTNG_VIEWER_ABI_HOST_NAME_MAX 64
+#define LTTNG_VIEWER_HOST_NAME_MAX 64
/* Flags in reply to get_next_index and get_packet. */
-/* New metadata is required to read this packet. */
-#define LTTNG_VIEWER_FLAG_NEW_METADATA (1 << 0)
-/* New stream got added to the trace. */
-#define LTTNG_VIEWER_FLAG_NEW_STREAM (1 << 1)
+enum {
+ /* New metadata is required to read this packet. */
+ LTTNG_VIEWER_FLAG_NEW_METADATA = (1 << 0),
+ /* New stream got added to the trace. */
+ LTTNG_VIEWER_FLAG_NEW_STREAM = (1 << 1),
+};
enum lttng_viewer_command {
- VIEWER_CONNECT = 1,
- VIEWER_LIST_SESSIONS = 2,
- VIEWER_ATTACH_SESSION = 3,
- VIEWER_GET_NEXT_INDEX = 4,
- VIEWER_GET_PACKET = 5,
- VIEWER_GET_METADATA = 6,
- VIEWER_GET_NEW_STREAMS = 7,
+ LTTNG_VIEWER_CONNECT = 1,
+ LTTNG_VIEWER_LIST_SESSIONS = 2,
+ LTTNG_VIEWER_ATTACH_SESSION = 3,
+ LTTNG_VIEWER_GET_NEXT_INDEX = 4,
+ LTTNG_VIEWER_GET_PACKET = 5,
+ LTTNG_VIEWER_GET_METADATA = 6,
+ LTTNG_VIEWER_GET_NEW_STREAMS = 7,
};
enum lttng_viewer_attach_return_code {
- VIEWER_ATTACH_OK = 1, /* If the attach command succeeded. */
- VIEWER_ATTACH_ALREADY = 2, /* If a viewer is already attached. */
- VIEWER_ATTACH_UNK = 3, /* If the session ID is unknown. */
- VIEWER_ATTACH_NOT_LIVE = 4, /* If the session is not live. */
- VIEWER_ATTACH_SEEK_ERR = 5, /* Seek error. */
+ LTTNG_VIEWER_ATTACH_OK = 1, /* The attach command succeeded. */
+ LTTNG_VIEWER_ATTACH_ALREADY = 2, /* A viewer is already attached. */
+ LTTNG_VIEWER_ATTACH_UNK = 3, /* The session ID is unknown. */
+ LTTNG_VIEWER_ATTACH_NOT_LIVE = 4, /* The session is not live. */
+ LTTNG_VIEWER_ATTACH_SEEK_ERR = 5, /* Seek error. */
};
enum lttng_viewer_next_index_return_code {
- VIEWER_INDEX_OK = 1, /* Index is available. */
- VIEWER_INDEX_RETRY = 2, /* Index not yet available. */
- VIEWER_INDEX_HUP = 3, /* Index closed (trace destroyed). */
- VIEWER_INDEX_ERR = 4, /* Unknow error. */
- VIEWER_INDEX_INACTIVE = 5, /* Inactive stream beacon. */
- VIEWER_INDEX_EOF = 6, /* End of index file. */
+ LTTNG_VIEWER_INDEX_OK = 1, /* Index is available. */
+ LTTNG_VIEWER_INDEX_RETRY = 2, /* Index not yet available. */
+ LTTNG_VIEWER_INDEX_HUP = 3, /* Index closed (trace destroyed). */
+ LTTNG_VIEWER_INDEX_ERR = 4, /* Unknow error. */
+ LTTNG_VIEWER_INDEX_INACTIVE = 5, /* Inactive stream beacon. */
+ LTTNG_VIEWER_INDEX_EOF = 6, /* End of index file. */
};
enum lttng_viewer_get_packet_return_code {
- VIEWER_GET_PACKET_OK = 1,
- VIEWER_GET_PACKET_RETRY = 2,
- VIEWER_GET_PACKET_ERR = 3,
- VIEWER_GET_PACKET_EOF = 4,
+ LTTNG_VIEWER_GET_PACKET_OK = 1,
+ LTTNG_VIEWER_GET_PACKET_RETRY = 2,
+ LTTNG_VIEWER_GET_PACKET_ERR = 3,
+ LTTNG_VIEWER_GET_PACKET_EOF = 4,
};
enum lttng_viewer_get_metadata_return_code {
- VIEWER_METADATA_OK = 1,
- VIEWER_NO_NEW_METADATA = 2,
- VIEWER_METADATA_ERR = 3,
+ LTTNG_VIEWER_METADATA_OK = 1,
+ LTTNG_VIEWER_NO_NEW_METADATA = 2,
+ LTTNG_VIEWER_METADATA_ERR = 3,
};
enum lttng_viewer_connection_type {
- VIEWER_CLIENT_COMMAND = 1,
- VIEWER_CLIENT_NOTIFICATION = 2,
+ LTTNG_VIEWER_CLIENT_COMMAND = 1,
+ LTTNG_VIEWER_CLIENT_NOTIFICATION = 2,
};
enum lttng_viewer_seek {
/* Receive the trace packets from the beginning. */
- VIEWER_SEEK_BEGINNING = 1,
+ LTTNG_VIEWER_SEEK_BEGINNING = 1,
/* Receive the trace packets from now. */
- VIEWER_SEEK_LAST = 2,
+ LTTNG_VIEWER_SEEK_LAST = 2,
};
enum lttng_viewer_new_streams_return_code {
- VIEWER_NEW_STREAMS_OK = 1, /* If new streams are being sent. */
- VIEWER_NEW_STREAMS_NO_NEW = 2, /* If no new streams are available. */
- VIEWER_NEW_STREAMS_ERR = 3, /* Error. */
+ LTTNG_VIEWER_NEW_STREAMS_OK = 1, /* If new streams are being sent. */
+ LTTNG_VIEWER_NEW_STREAMS_NO_NEW = 2, /* If no new streams are available. */
+ LTTNG_VIEWER_NEW_STREAMS_ERR = 3, /* Error. */
};
struct lttng_viewer_session {
uint32_t live_timer;
uint32_t clients;
uint32_t streams;
- char hostname[LTTNG_VIEWER_ABI_HOST_NAME_MAX];
+ char hostname[LTTNG_VIEWER_HOST_NAME_MAX];
char session_name[LTTNG_VIEWER_NAME_MAX];
} __attribute__((__packed__));
} __attribute__((__packed__));
/*
- * CONNECT payload.
+ * LTTNG_VIEWER_CONNECT payload.
*/
struct lttng_viewer_connect {
/* session ID assigned by the relay for command connections */
uint64_t viewer_session_id;
uint32_t major;
uint32_t minor;
- uint32_t type; /* enum lttng_viewer_connection_type */
+ uint32_t type; /* enum lttng_viewer_connection_type */
} __attribute__((__packed__));
/*
- * VIEWER_LIST_SESSIONS payload.
+ * LTTNG_VIEWER_LIST_SESSIONS payload.
*/
struct lttng_viewer_list_sessions {
uint32_t sessions_count;
- char session_list[]; /* struct lttng_viewer_session */
+ char session_list[]; /* struct lttng_viewer_session */
} __attribute__((__packed__));
/*
- * VIEWER_ATTACH_SESSION payload.
+ * LTTNG_VIEWER_ATTACH_SESSION payload.
*/
struct lttng_viewer_attach_session_request {
uint64_t session_id;
} __attribute__((__packed__));
/*
- * VIEWER_GET_NEXT_INDEX payload.
+ * LTTNG_VIEWER_GET_NEXT_INDEX payload.
*/
struct lttng_viewer_get_next_index {
uint64_t stream_id;
uint64_t timestamp_end;
uint64_t events_discarded;
uint64_t stream_id;
- /* enum lttng_viewer_next_index_return_code */
- uint32_t status;
- uint32_t flags; /* LTTNG_VIEWER_FLAG_* */
+ uint32_t status; /* enum lttng_viewer_next_index_return_code */
+ uint32_t flags; /* LTTNG_VIEWER_FLAG_* */
} __attribute__ ((__packed__));
/*
- * VIEWER_GET_PACKET payload.
+ * LTTNG_VIEWER_GET_PACKET payload.
*/
struct lttng_viewer_get_packet {
uint64_t stream_id;
} __attribute__((__packed__));
struct lttng_viewer_trace_packet {
- /* enum lttng_viewer_get_packet_return_code */
- uint32_t status;
+ uint32_t status; /* enum lttng_viewer_get_packet_return_code */
uint32_t len;
- uint32_t flags; /* LTTNG_VIEWER_FLAG_* */
+ uint32_t flags; /* LTTNG_VIEWER_FLAG_* */
char data[];
} __attribute__((__packed__));
/*
- * VIEWER_GET_METADATA payload.
+ * LTTNG_VIEWER_GET_METADATA payload.
*/
struct lttng_viewer_get_metadata {
uint64_t stream_id;
struct lttng_viewer_metadata_packet {
uint64_t len;
- /* enum lttng_viewer_get_metadata_return_code */
- uint32_t status;
+ uint32_t status; /* enum lttng_viewer_get_metadata_return_code */
char data[];
} __attribute__((__packed__));
/*
- * VIEWER_GET_NEW_STREAMS payload.
+ * LTTNG_VIEWER_GET_NEW_STREAMS payload.
*/
struct lttng_viewer_new_streams_request {
uint64_t session_id;
char stream_list[];
} __attribute__((__packed__));
-
-#endif /* LTTNG_VIEWER_ABI_H */
+#endif /* LTTNG_VIEWER_H */
vstream->tracefile_count_last = -1ULL;
switch (seek_t) {
- case VIEWER_SEEK_BEGINNING:
+ case LTTNG_VIEWER_SEEK_BEGINNING:
vstream->tracefile_count_current = stream->oldest_tracefile_id;
break;
- case VIEWER_SEEK_LAST:
+ case LTTNG_VIEWER_SEEK_LAST:
vstream->tracefile_count_current = stream->tracefile_count_current;
break;
default:
vstream->index_read_fd = read_fd;
}
- if (seek_t == VIEWER_SEEK_LAST && vstream->index_read_fd >= 0) {
+ if (seek_t == LTTNG_VIEWER_SEEK_LAST && vstream->index_read_fd >= 0) {
off_t lseek_ret;
lseek_ret = lseek(vstream->index_read_fd,
struct lttng_viewer_connect connect;
int ret;
- cmd.cmd = htobe32(VIEWER_CONNECT);
+ cmd.cmd = htobe32(LTTNG_VIEWER_CONNECT);
cmd.data_size = sizeof(connect);
cmd.cmd_version = 0;
memset(&connect, 0, sizeof(connect));
connect.major = htobe32(VERSION_MAJOR);
connect.minor = htobe32(VERSION_MINOR);
- connect.type = htobe32(VIEWER_CLIENT_COMMAND);
+ connect.type = htobe32(LTTNG_VIEWER_CLIENT_COMMAND);
do {
ret = send(control_sock, &cmd, sizeof(cmd), 0);
int i, ret;
int first_session = 0;
- cmd.cmd = htobe32(VIEWER_LIST_SESSIONS);
+ cmd.cmd = htobe32(LTTNG_VIEWER_LIST_SESSIONS);
cmd.data_size = 0;
cmd.cmd_version = 0;
goto error;
}
- cmd.cmd = htobe32(VIEWER_ATTACH_SESSION);
+ cmd.cmd = htobe32(LTTNG_VIEWER_ATTACH_SESSION);
cmd.data_size = sizeof(rq);
cmd.cmd_version = 0;
memset(&rq, 0, sizeof(rq));
rq.session_id = htobe64(id);
- rq.seek = htobe32(VIEWER_SEEK_BEGINNING);
+ rq.seek = htobe32(LTTNG_VIEWER_SEEK_BEGINNING);
do {
ret = send(control_sock, &cmd, sizeof(cmd), 0);
fprintf(stderr, "Error receiving attach response\n");
goto error;
}
- if (be32toh(rp.status) != VIEWER_ATTACH_OK) {
+ if (be32toh(rp.status) != LTTNG_VIEWER_ATTACH_OK) {
ret = -1;
goto end;
}
uint64_t len = 0;
int metadata_stream_id = -1;
- cmd.cmd = htobe32(VIEWER_GET_METADATA);
+ cmd.cmd = htobe32(LTTNG_VIEWER_GET_METADATA);
cmd.data_size = sizeof(rq);
cmd.cmd_version = 0;
goto error;
}
switch (be32toh(rp.status)) {
- case VIEWER_METADATA_OK:
+ case LTTNG_VIEWER_METADATA_OK:
break;
- case VIEWER_NO_NEW_METADATA:
+ case LTTNG_VIEWER_NO_NEW_METADATA:
fprintf(stderr, "NO NEW\n");
ret = -1;
goto end;
- case VIEWER_METADATA_ERR:
+ case LTTNG_VIEWER_METADATA_ERR:
fprintf(stderr, "ERR\n");
ret = -1;
goto end;
int ret;
int id;
- cmd.cmd = htobe32(VIEWER_GET_NEXT_INDEX);
+ cmd.cmd = htobe32(LTTNG_VIEWER_GET_NEXT_INDEX);
cmd.data_size = sizeof(rq);
cmd.cmd_version = 0;
rp.flags = be32toh(rp.flags);
switch (be32toh(rp.status)) {
- case VIEWER_INDEX_INACTIVE:
+ case LTTNG_VIEWER_INDEX_INACTIVE:
fprintf(stderr, "(INACTIVE)\n");
break;
- case VIEWER_INDEX_OK:
+ case LTTNG_VIEWER_INDEX_OK:
break;
- case VIEWER_INDEX_RETRY:
+ case LTTNG_VIEWER_INDEX_RETRY:
sleep(1);
goto retry;
- case VIEWER_INDEX_HUP:
+ case LTTNG_VIEWER_INDEX_HUP:
fprintf(stderr, "(HUP)\n");
session->streams[id].id = -1ULL;
session->streams[id].fd = -1;
break;
- case VIEWER_INDEX_ERR:
+ case LTTNG_VIEWER_INDEX_ERR:
fprintf(stderr, "(ERR)\n");
ret = -1;
goto error;
struct lttng_viewer_trace_packet rp;
int ret;
- cmd.cmd = htobe32(VIEWER_GET_PACKET);
+ cmd.cmd = htobe32(LTTNG_VIEWER_GET_PACKET);
cmd.data_size = sizeof(rq);
cmd.cmd_version = 0;
rp.flags = be32toh(rp.flags);
switch (be32toh(rp.status)) {
- case VIEWER_GET_PACKET_OK:
+ case LTTNG_VIEWER_GET_PACKET_OK:
break;
- case VIEWER_GET_PACKET_RETRY:
+ case LTTNG_VIEWER_GET_PACKET_RETRY:
fprintf(stderr, "RETRY\n");
ret = -1;
goto end;
- case VIEWER_GET_PACKET_ERR:
+ case LTTNG_VIEWER_GET_PACKET_ERR:
if (rp.flags & LTTNG_VIEWER_FLAG_NEW_METADATA) {
fprintf(stderr, "NEW_METADATA\n");
ret = 0;