X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fconsumer.cpp;h=bdda3913597a7639150a67473517e92bf31f1180;hb=8a880a84dcb8ee64cbc4a5e04cae6775b4f9babd;hp=3637cb2e57348c7a8fafa17687a1d18a78d0f22d;hpb=4222116f0098672bbbc0fea2b994e50007929d58;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/consumer.cpp b/src/bin/lttng-sessiond/consumer.cpp index 3637cb2e5..bdda39135 100644 --- a/src/bin/lttng-sessiond/consumer.cpp +++ b/src/bin/lttng-sessiond/consumer.cpp @@ -15,17 +15,17 @@ #include #include -#include -#include -#include -#include -#include - -#include "consumer.h" -#include "health-sessiond.h" -#include "ust-app.h" -#include "utils.h" -#include "lttng-sessiond.h" +#include +#include +#include +#include +#include + +#include "consumer.hpp" +#include "health-sessiond.hpp" +#include "ust-app.hpp" +#include "utils.hpp" +#include "lttng-sessiond.hpp" /* * Return allocated full pathname of the session using the consumer trace path @@ -49,7 +49,7 @@ char *setup_channel_trace_path(struct consumer_output *consumer, * Allocate the string ourself to make sure we never exceed * LTTNG_PATH_MAX. */ - pathname = (char *) zmalloc(LTTNG_PATH_MAX); + pathname = calloc(LTTNG_PATH_MAX); if (!pathname) { goto error; } @@ -429,7 +429,7 @@ struct consumer_socket *consumer_allocate_socket(int *fd) LTTNG_ASSERT(fd); - socket = (consumer_socket *) zmalloc(sizeof(struct consumer_socket)); + socket = zmalloc(); if (socket == NULL) { PERROR("zmalloc consumer socket"); goto error; @@ -520,7 +520,7 @@ struct consumer_output *consumer_create_output(enum consumer_dst_type type) { struct consumer_output *output = NULL; - output = (consumer_output *) zmalloc(sizeof(struct consumer_output)); + output = zmalloc(); if (output == NULL) { PERROR("zmalloc consumer_output"); goto error; @@ -1009,8 +1009,6 @@ void consumer_init_add_channel_comm_msg(struct lttcomm_consumer_msg *msg, uint64_t channel_key, uint64_t session_id, const char *pathname, - uid_t uid, - gid_t gid, uint64_t relayd_id, const char *name, unsigned int nb_init_streams, @@ -1507,7 +1505,7 @@ end: */ enum lttng_error_code consumer_snapshot_channel(struct consumer_socket *socket, uint64_t key, const struct consumer_output *output, int metadata, - uid_t uid, gid_t gid, const char *channel_path, int wait, + const char *channel_path, uint64_t nb_packets_per_stream) { int ret; @@ -1687,7 +1685,7 @@ end: * chunk each stream is currently writing to (for the rotate_pending operation). */ int consumer_rotate_channel(struct consumer_socket *socket, uint64_t key, - uid_t uid, gid_t gid, struct consumer_output *output, + struct consumer_output *output, bool is_metadata_channel) { int ret; @@ -1733,6 +1731,7 @@ int consumer_open_channel_packets(struct consumer_socket *socket, uint64_t key) int ret; lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_OPEN_CHANNEL_PACKETS, + .u = {}, }; msg.u.open_channel_packets.key = key; @@ -1788,6 +1787,7 @@ int consumer_init(struct consumer_socket *socket, int ret; struct lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_INIT, + .u = {}, }; LTTNG_ASSERT(socket); @@ -1832,6 +1832,7 @@ int consumer_create_trace_chunk(struct consumer_socket *socket, enum lttng_trace_chunk_status tc_status; struct lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_CREATE_TRACE_CHUNK, + .u = {}, }; msg.u.create_trace_chunk.session_id = session_id; @@ -1986,6 +1987,7 @@ int consumer_close_trace_chunk(struct consumer_socket *socket, enum lttng_trace_chunk_status chunk_status; lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_CLOSE_TRACE_CHUNK, + .u = {}, }; msg.u.close_trace_chunk.session_id = session_id; @@ -2112,6 +2114,7 @@ int consumer_trace_chunk_exists(struct consumer_socket *socket, enum lttng_trace_chunk_status chunk_status; lttcomm_consumer_msg msg = { .cmd_type = LTTNG_CONSUMER_TRACE_CHUNK_EXISTS, + .u = {}, }; msg.u.trace_chunk_exists.session_id = session_id;