projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: agent port file is o+w when launching as root
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
consumer.cpp
diff --git
a/src/bin/lttng-sessiond/consumer.cpp
b/src/bin/lttng-sessiond/consumer.cpp
index 238da05085739aaca35506b543b10380e89c1197..c0f8eb5894e8fae8cb070109d4820ebec62ddff2 100644
(file)
--- a/
src/bin/lttng-sessiond/consumer.cpp
+++ b/
src/bin/lttng-sessiond/consumer.cpp
@@
-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.
*/
* Allocate the string ourself to make sure we never exceed
* LTTNG_PATH_MAX.
*/
- pathname =
(char *) zmalloc
(LTTNG_PATH_MAX);
+ pathname =
calloc<char>
(LTTNG_PATH_MAX);
if (!pathname) {
goto error;
}
if (!pathname) {
goto error;
}
@@
-414,7
+414,7
@@
struct consumer_socket *consumer_find_socket(int key,
&iter);
node = lttng_ht_iter_get_node_ulong(&iter);
if (node != NULL) {
&iter);
node = lttng_ht_iter_get_node_ulong(&iter);
if (node != NULL) {
- socket =
caa_container_of(node, struct consumer_socket,
node);
+ socket =
lttng::utils::container_of(node, &consumer_socket::
node);
}
return socket;
}
return socket;
@@
-429,7
+429,7
@@
struct consumer_socket *consumer_allocate_socket(int *fd)
LTTNG_ASSERT(fd);
LTTNG_ASSERT(fd);
- socket =
(consumer_socket *) zmalloc(sizeof(struct consumer_socket)
);
+ socket =
zmalloc<consumer_socket>(
);
if (socket == NULL) {
PERROR("zmalloc consumer socket");
goto error;
if (socket == NULL) {
PERROR("zmalloc consumer socket");
goto error;
@@
-481,9
+481,9
@@
void consumer_del_socket(struct consumer_socket *sock,
static void destroy_socket_rcu(struct rcu_head *head)
{
struct lttng_ht_node_ulong *node =
static void destroy_socket_rcu(struct rcu_head *head)
{
struct lttng_ht_node_ulong *node =
-
caa_container_of(head, struct lttng_ht_node_ulong,
head);
+
lttng::utils::container_of(head, <tng_ht_node_ulong::
head);
struct consumer_socket *socket =
struct consumer_socket *socket =
-
caa_container_of(node, struct consumer_socket,
node);
+
lttng::utils::container_of(node, &consumer_socket::
node);
free(socket);
}
free(socket);
}
@@
-520,7
+520,7
@@
struct consumer_output *consumer_create_output(enum consumer_dst_type type)
{
struct consumer_output *output = NULL;
{
struct consumer_output *output = NULL;
- output =
(consumer_output *) zmalloc(sizeof(struct consumer_output)
);
+ output =
zmalloc<consumer_output>(
);
if (output == NULL) {
PERROR("zmalloc consumer_output");
goto error;
if (output == NULL) {
PERROR("zmalloc consumer_output");
goto error;
@@
-566,7
+566,7
@@
void consumer_destroy_output_sockets(struct consumer_output *obj)
static void consumer_release_output(struct urcu_ref *ref)
{
struct consumer_output *obj =
static void consumer_release_output(struct urcu_ref *ref)
{
struct consumer_output *obj =
-
caa_container_of(ref, struct consumer_output,
ref);
+
lttng::utils::container_of(ref, &consumer_output::
ref);
consumer_destroy_output_sockets(obj);
consumer_destroy_output_sockets(obj);
@@
-924,7
+924,7
@@
void consumer_init_ask_channel_comm_msg(struct lttcomm_consumer_msg *msg,
const char *name,
uint64_t relayd_id,
uint64_t key,
const char *name,
uint64_t relayd_id,
uint64_t key,
-
unsigned char *
uuid,
+
const lttng_uuid&
uuid,
uint32_t chan_id,
uint64_t tracefile_size,
uint64_t tracefile_count,
uint32_t chan_id,
uint64_t tracefile_size,
uint64_t tracefile_count,
@@
-979,7
+979,7
@@
void consumer_init_ask_channel_comm_msg(struct lttcomm_consumer_msg *msg,
msg->u.ask_channel.ust_app_uid = ust_app_uid;
msg->u.ask_channel.blocking_timeout = blocking_timeout;
msg->u.ask_channel.ust_app_uid = ust_app_uid;
msg->u.ask_channel.blocking_timeout = blocking_timeout;
-
memcpy(msg->u.ask_channel.uuid, uuid, sizeof(msg->u.ask_channel.uuid)
);
+
std::copy(uuid.begin(), uuid.end(), msg->u.ask_channel.uuid
);
if (pathname) {
strncpy(msg->u.ask_channel.pathname, pathname,
if (pathname) {
strncpy(msg->u.ask_channel.pathname, pathname,
@@
-1782,7
+1782,7
@@
error_socket:
}
int consumer_init(struct consumer_socket *socket,
}
int consumer_init(struct consumer_socket *socket,
- const lttng_uuid sessiond_uuid)
+ const lttng_uuid
&
sessiond_uuid)
{
int ret;
struct lttcomm_consumer_msg msg = {
{
int ret;
struct lttcomm_consumer_msg msg = {
@@
-1793,7
+1793,7
@@
int consumer_init(struct consumer_socket *socket,
LTTNG_ASSERT(socket);
DBG("Sending consumer initialization command");
LTTNG_ASSERT(socket);
DBG("Sending consumer initialization command");
-
lttng_uuid_copy(msg.u.init.sessiond_uuid,
sessiond_uuid);
+
std::copy(sessiond_uuid.begin(), sessiond_uuid.end(), msg.u.init.
sessiond_uuid);
health_code_update();
ret = consumer_send_msg(socket, &msg);
health_code_update();
ret = consumer_send_msg(socket, &msg);
This page took
0.026305 seconds
and
4
git commands to generate.