projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
relayd: introduce --group-output-by-session
[lttng-tools.git]
/
tests
/
regression
/
tools
/
live
/
live_test.c
diff --git
a/tests/regression/tools/live/live_test.c
b/tests/regression/tools/live/live_test.c
index aa96fc6c3f7ec9ef5b93119bee5928309915324d..8a884ab6bf68d3b5d8cbc04cfcbfdcf609f70388 100644
(file)
--- a/
tests/regression/tools/live/live_test.c
+++ b/
tests/regression/tools/live/live_test.c
@@
-21,7
+21,7
@@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <time.h>
+#include <
common/compat/
time.h>
#include <sys/types.h>
#include <inttypes.h>
#include <stdlib.h>
#include <sys/types.h>
#include <inttypes.h>
#include <stdlib.h>
@@
-36,7
+36,6
@@
#include <lttng/lttng.h>
#include <urcu/list.h>
#include <lttng/lttng.h>
#include <urcu/list.h>
-#include <bin/lttng-sessiond/session.h>
#include <common/common.h>
#include <bin/lttng-relayd/lttng-viewer-abi.h>
#include <common/common.h>
#include <bin/lttng-relayd/lttng-viewer-abi.h>
@@
-159,8
+158,8
@@
int establish_connection(void)
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_CONNECT);
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_CONNECT);
- cmd.data_size =
sizeof(connect
);
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(sizeof(connect)
);
+ cmd.cmd_version =
htobe32(0)
;
memset(&connect, 0, sizeof(connect));
connect.major = htobe32(VERSION_MAJOR);
memset(&connect, 0, sizeof(connect));
connect.major = htobe32(VERSION_MAJOR);
@@
-206,8
+205,8
@@
int list_sessions(uint64_t *session_id)
int first_session = 0;
cmd.cmd = htobe32(LTTNG_VIEWER_LIST_SESSIONS);
int first_session = 0;
cmd.cmd = htobe32(LTTNG_VIEWER_LIST_SESSIONS);
- cmd.data_size =
0
;
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(0)
;
+ cmd.cmd_version =
htobe32(0)
;
ret_len = lttng_live_send(control_sock, &cmd, sizeof(cmd));
if (ret_len < 0) {
ret_len = lttng_live_send(control_sock, &cmd, sizeof(cmd));
if (ret_len < 0) {
@@
-250,8
+249,8
@@
int create_viewer_session(void)
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_CREATE_SESSION);
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_CREATE_SESSION);
- cmd.data_size =
0
;
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(0)
;
+ cmd.cmd_version =
htobe32(0)
;
ret_len = lttng_live_send(control_sock, &cmd, sizeof(cmd));
if (ret_len < 0) {
ret_len = lttng_live_send(control_sock, &cmd, sizeof(cmd));
if (ret_len < 0) {
@@
-296,8
+295,8
@@
int attach_session(uint64_t id)
}
cmd.cmd = htobe32(LTTNG_VIEWER_ATTACH_SESSION);
}
cmd.cmd = htobe32(LTTNG_VIEWER_ATTACH_SESSION);
- cmd.data_size =
sizeof(rq
);
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(sizeof(rq)
);
+ cmd.cmd_version =
htobe32(0)
;
memset(&rq, 0, sizeof(rq));
rq.session_id = htobe64(id);
memset(&rq, 0, sizeof(rq));
rq.session_id = htobe64(id);
@@
-383,8
+382,8
@@
int get_metadata(void)
int metadata_stream_id = -1;
cmd.cmd = htobe32(LTTNG_VIEWER_GET_METADATA);
int metadata_stream_id = -1;
cmd.cmd = htobe32(LTTNG_VIEWER_GET_METADATA);
- cmd.data_size =
sizeof(rq
);
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(sizeof(rq)
);
+ cmd.cmd_version =
htobe32(0)
;
for (i = 0; i < session->stream_count; i++) {
if (session->streams[i].metadata_flag) {
for (i = 0; i < session->stream_count; i++) {
if (session->streams[i].metadata_flag) {
@@
-473,8
+472,8
@@
int get_next_index(void)
int id;
cmd.cmd = htobe32(LTTNG_VIEWER_GET_NEXT_INDEX);
int id;
cmd.cmd = htobe32(LTTNG_VIEWER_GET_NEXT_INDEX);
- cmd.data_size =
sizeof(rq
);
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(sizeof(rq)
);
+ cmd.cmd_version =
htobe32(0)
;
for (id = 0; id < session->stream_count; id++) {
if (session->streams[id].metadata_flag) {
for (id = 0; id < session->stream_count; id++) {
if (session->streams[id].metadata_flag) {
@@
-556,8
+555,8
@@
int get_data_packet(int id, uint64_t offset,
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_GET_PACKET);
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_GET_PACKET);
- cmd.data_size =
sizeof(rq
);
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(sizeof(rq)
);
+ cmd.cmd_version =
htobe32(0)
;
memset(&rq, 0, sizeof(rq));
rq.stream_id = htobe64(session->streams[id].id);
memset(&rq, 0, sizeof(rq));
rq.stream_id = htobe64(session->streams[id].id);
@@
-638,8
+637,8
@@
int detach_viewer_session(uint64_t id)
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_DETACH_SESSION);
ssize_t ret_len;
cmd.cmd = htobe32(LTTNG_VIEWER_DETACH_SESSION);
- cmd.data_size =
sizeof(rq
);
- cmd.cmd_version =
0
;
+ cmd.data_size =
htobe64(sizeof(rq)
);
+ cmd.cmd_version =
htobe32(0)
;
memset(&rq, 0, sizeof(rq));
rq.session_id = htobe64(id);
memset(&rq, 0, sizeof(rq));
rq.session_id = htobe64(id);
@@
-694,6
+693,9
@@
int main(int argc, char **argv)
ret = list_sessions(&session_id);
ok(ret > 0, "List sessions : %d session(s)", ret);
ret = list_sessions(&session_id);
ok(ret > 0, "List sessions : %d session(s)", ret);
+ if (ret < 0) {
+ goto end;
+ }
ret = create_viewer_session();
ok(ret == 0, "Create viewer session");
ret = create_viewer_session();
ok(ret == 0, "Create viewer session");
@@
-722,6
+724,6
@@
int main(int argc, char **argv)
ret = attach_session(session_id);
ok(ret > 0, "Attach to session, %d streams received", ret);
ret = attach_session(session_id);
ok(ret > 0, "Attach to session, %d streams received", ret);
-
+end:
return exit_status();
}
return exit_status();
}
This page took
0.026216 seconds
and
4
git commands to generate.