projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Build fix: missing stdio.h include in signal-helper.hpp
[lttng-tools.git]
/
tests
/
regression
/
tools
/
live
/
live_test.cpp
diff --git
a/tests/regression/tools/live/live_test.cpp
b/tests/regression/tools/live/live_test.cpp
index 76d801e9b024ee3fcbcd78e6722dbe0e762fd361..08eb8197cddc29f1676f2ef9183f5f5630e1c5da 100644
(file)
--- a/
tests/regression/tools/live/live_test.cpp
+++ b/
tests/regression/tools/live/live_test.cpp
@@
-9,7
+9,7
@@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <common/compat/time.h>
+#include <common/compat/time.h
pp
>
#include <sys/types.h>
#include <inttypes.h>
#include <stdlib.h>
#include <sys/types.h>
#include <inttypes.h>
#include <stdlib.h>
@@
-20,17
+20,18
@@
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/stat.h>
-#include <tap/tap.h>
#include <lttng/lttng.h>
#include <urcu/list.h>
#include <lttng/lttng.h>
#include <urcu/list.h>
-#include <common/common.h>
+#include <common/common.hpp>
+
+#include <bin/lttng-relayd/lttng-viewer-abi.hpp>
+#include <common/index/ctf-index.hpp>
-#include <
bin/lttng-relayd/lttng-viewer-abi.h
>
-#include <common/
index/ctf-index.h
>
+#include <
common/compat/errno.hpp
>
+#include <common/
compat/endian.hpp
>
-#include <common/compat/errno.h>
-#include <common/compat/endian.h>
+#include <tap/tap.h>
#define SESSION1 "test1"
#define RELAYD_URL "net://localhost"
#define SESSION1 "test1"
#define RELAYD_URL "net://localhost"
@@
-46,12
+47,13
@@
LTTNG_EXPORT DEFINE_LTTNG_UST_SIGBUS_STATE();
#endif
LTTNG_EXPORT DEFINE_LTTNG_UST_SIGBUS_STATE();
#endif
-static int control_sock;
+namespace {
struct live_session *session;
struct live_session *session;
+int control_sock;
-
static
int first_packet_offset;
-
static
int first_packet_len;
-
static
int first_packet_stream_id = -1;
+int first_packet_offset;
+int first_packet_len;
+int first_packet_stream_id = -1;
struct viewer_stream {
uint64_t id;
struct viewer_stream {
uint64_t id;
@@
-68,6
+70,7
@@
struct live_session {
uint64_t live_timer_interval;
uint64_t stream_count;
};
uint64_t live_timer_interval;
uint64_t stream_count;
};
+} /* namespace */
static
ssize_t lttng_live_recv(int fd, void *buf, size_t len)
static
ssize_t lttng_live_recv(int fd, void *buf, size_t len)
@@
-285,7
+288,7
@@
int attach_session(uint64_t id)
int i;
ssize_t ret_len;
int i;
ssize_t ret_len;
- session =
(live_session *) zmalloc(sizeof(struct live_session)
);
+ session =
zmalloc<live_session>(
);
if (!session) {
goto error;
}
if (!session) {
goto error;
}
@@
-327,8
+330,7
@@
int attach_session(uint64_t id)
diag("Got session stream count == 0");
goto error;
}
diag("Got session stream count == 0");
goto error;
}
- session->streams = (viewer_stream *) zmalloc(session->stream_count *
- sizeof(struct viewer_stream));
+ session->streams = calloc<viewer_stream>(session->stream_count);
if (!session->streams) {
goto error;
}
if (!session->streams) {
goto error;
}
@@
-436,7
+438,7
@@
retry:
goto error;
}
goto error;
}
- data =
(char *) zmalloc
(len);
+ data =
calloc<char>
(len);
if (!data) {
PERROR("relay data zmalloc");
goto error;
if (!data) {
PERROR("relay data zmalloc");
goto error;
This page took
0.025403 seconds
and
4
git commands to generate.