X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fconsumer.c;h=718b57e53e87d14e05ce2c46ffb8d0f94fc97bb2;hb=73535baf93cafc2a3e56a4e713e342ab7325f8dd;hp=552ff95cb2b08711624d5a2ad76261cc789b0535;hpb=04ed9e10dfa0b3c88d4a7abe9fa59b8e03b7e49a;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 552ff95cb..718b57e53 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -370,10 +370,10 @@ struct consumer_socket *consumer_find_socket_by_bitness(int bits, switch (bits) { case 64: - consumer_fd = uatomic_read(&ust_consumerd64_fd); + consumer_fd = uatomic_read(&the_ust_consumerd64_fd); break; case 32: - consumer_fd = uatomic_read(&ust_consumerd32_fd); + consumer_fd = uatomic_read(&the_ust_consumerd32_fd); break; default: assert(0); @@ -938,21 +938,23 @@ void consumer_init_ask_channel_comm_msg(struct lttcomm_consumer_msg *msg, { assert(msg); - /* Zeroed structure */ + /* Zeroed structure */ memset(msg, 0, sizeof(struct lttcomm_consumer_msg)); msg->u.ask_channel.buffer_credentials.uid = UINT32_MAX; msg->u.ask_channel.buffer_credentials.gid = UINT32_MAX; - if (trace_chunk) { + if (trace_chunk) { uint64_t chunk_id; enum lttng_trace_chunk_status chunk_status; chunk_status = lttng_trace_chunk_get_id(trace_chunk, &chunk_id); assert(chunk_status == LTTNG_TRACE_CHUNK_STATUS_OK); LTTNG_OPTIONAL_SET(&msg->u.ask_channel.chunk_id, chunk_id); - } - msg->u.ask_channel.buffer_credentials.uid = buffer_credentials->uid; - msg->u.ask_channel.buffer_credentials.gid = buffer_credentials->gid; + } + msg->u.ask_channel.buffer_credentials.uid = + lttng_credentials_get_uid(buffer_credentials); + msg->u.ask_channel.buffer_credentials.gid = + lttng_credentials_get_gid(buffer_credentials); msg->cmd_type = LTTNG_CONSUMER_ASK_CHANNEL_CREATION; msg->u.ask_channel.subbuf_size = subbuf_size; @@ -1026,14 +1028,14 @@ void consumer_init_add_channel_comm_msg(struct lttcomm_consumer_msg *msg, /* Zeroed structure */ memset(msg, 0, sizeof(struct lttcomm_consumer_msg)); - if (trace_chunk) { + if (trace_chunk) { uint64_t chunk_id; enum lttng_trace_chunk_status chunk_status; chunk_status = lttng_trace_chunk_get_id(trace_chunk, &chunk_id); assert(chunk_status == LTTNG_TRACE_CHUNK_STATUS_OK); LTTNG_OPTIONAL_SET(&msg->u.channel.chunk_id, chunk_id); - } + } /* Send channel */ msg->cmd_type = LTTNG_CONSUMER_ADD_CHANNEL; @@ -1151,12 +1153,10 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, char output_path[LTTNG_PATH_MAX] = {}; uint64_t relayd_session_id; - ret = relayd_create_session(rsock, - &relayd_session_id, + ret = relayd_create_session(rsock, &relayd_session_id, session_name, hostname, base_path, - session_live_timer, - consumer->snapshot, session_id, - sessiond_uuid, current_chunk_id, + session_live_timer, consumer->snapshot, + session_id, the_sessiond_uuid, current_chunk_id, session_creation_time, session_name_contains_creation_time, output_path); @@ -1179,7 +1179,9 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock, msg.u.relayd_sock.net_index = consumer->net_seq_index; msg.u.relayd_sock.type = type; msg.u.relayd_sock.session_id = session_id; - memcpy(&msg.u.relayd_sock.sock, rsock, sizeof(msg.u.relayd_sock.sock)); + msg.u.relayd_sock.major = rsock->major; + msg.u.relayd_sock.minor = rsock->minor; + msg.u.relayd_sock.relayd_socket_protocol = rsock->sock.proto; DBG3("Sending relayd sock info to consumer on %d", *consumer_sock->fd_ptr); ret = consumer_send_msg(consumer_sock, &msg); @@ -1930,9 +1932,9 @@ int consumer_create_trace_chunk(struct consumer_socket *socket, assert(domain_dirfd >= 0); msg.u.create_trace_chunk.credentials.value.uid = - chunk_credentials.uid; + lttng_credentials_get_uid(&chunk_credentials); msg.u.create_trace_chunk.credentials.value.gid = - chunk_credentials.gid; + lttng_credentials_get_gid(&chunk_credentials); msg.u.create_trace_chunk.credentials.is_set = 1; }