X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;h=3f8df6410de3fd90106e248e366d57eae33b975c;hb=2b5f1a27dceffd016755c0a62c9686c3b61f6aaa;hp=0f59aa24f51decc781c760ddef1007399851355d;hpb=6fe2f807dfffcf5b3444118c58ec01cca0e43837;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index 0f59aa24f..3f8df6410 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -129,7 +130,7 @@ int kernel_consumer_add_channel(struct consumer_socket *sock, /* Prep channel message structure */ consumer_init_channel_comm_msg(&lkm, LTTNG_CONSUMER_ADD_CHANNEL, - channel->fd, + channel->key, ksession->id, pathname, ksession->uid, @@ -160,7 +161,7 @@ int kernel_consumer_add_channel(struct consumer_socket *sock, status = notification_thread_command_add_channel( notification_thread_handle, session->name, ksession->uid, ksession->gid, - channel->channel->name, channel->fd, + channel->channel->name, channel->key, LTTNG_DOMAIN_KERNEL, channel->channel->attr.subbuf_size * channel->channel->attr.num_subbuf); rcu_read_unlock(); @@ -178,6 +179,8 @@ error: /* * Sending metadata to the consumer with command ADD_CHANNEL and ADD_STREAM. + * + * The consumer socket lock must be held by the caller. */ int kernel_consumer_add_metadata(struct consumer_socket *sock, struct ltt_kernel_session *session, unsigned int monitor) @@ -211,7 +214,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, /* Prep channel message structure */ consumer_init_channel_comm_msg(&lkm, LTTNG_CONSUMER_ADD_CHANNEL, - session->metadata->fd, + session->metadata->key, session->id, pathname, session->uid, @@ -236,7 +239,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, /* Prep stream message structure */ consumer_init_stream_comm_msg(&lkm, LTTNG_CONSUMER_ADD_STREAM, - session->metadata->fd, + session->metadata->key, session->metadata_stream_fd, 0); /* CPU: 0 for metadata. */ @@ -282,7 +285,7 @@ int kernel_consumer_add_stream(struct consumer_socket *sock, /* Prep stream consumer message */ consumer_init_stream_comm_msg(&lkm, LTTNG_CONSUMER_ADD_STREAM, - channel->fd, + channel->key, stream->fd, stream->cpu); @@ -336,6 +339,8 @@ error: /* * Send all stream fds of kernel channel to the consumer. + * + * The consumer socket lock must be held by the caller. */ int kernel_consumer_send_channel_stream(struct consumer_socket *sock, struct ltt_kernel_channel *channel, struct ltt_kernel_session *session, @@ -388,6 +393,8 @@ error: /* * Send all stream fds of the kernel session to the consumer. + * + * The consumer socket lock must be held by the caller. */ int kernel_consumer_send_session(struct consumer_socket *sock, struct ltt_kernel_session *session) @@ -432,7 +439,7 @@ int kernel_consumer_send_session(struct consumer_socket *sock, * Inform the relay that all the streams for the * channel were sent. */ - ret = kernel_consumer_streams_sent(sock, session, chan->fd); + ret = kernel_consumer_streams_sent(sock, session, chan->key); if (ret < 0) { goto error; } @@ -457,11 +464,11 @@ int kernel_consumer_destroy_channel(struct consumer_socket *socket, assert(channel); assert(socket); - DBG("Sending kernel consumer destroy channel key %d", channel->fd); + DBG("Sending kernel consumer destroy channel key %" PRIu64, channel->key); memset(&msg, 0, sizeof(msg)); msg.cmd_type = LTTNG_CONSUMER_DESTROY_CHANNEL; - msg.u.destroy_channel.key = channel->fd; + msg.u.destroy_channel.key = channel->key; pthread_mutex_lock(socket->lock); health_code_update(); @@ -486,11 +493,11 @@ int kernel_consumer_destroy_metadata(struct consumer_socket *socket, assert(metadata); assert(socket); - DBG("Sending kernel consumer destroy channel key %d", metadata->fd); + DBG("Sending kernel consumer destroy channel key %" PRIu64, metadata->key); memset(&msg, 0, sizeof(msg)); msg.cmd_type = LTTNG_CONSUMER_DESTROY_CHANNEL; - msg.u.destroy_channel.key = metadata->fd; + msg.u.destroy_channel.key = metadata->key; pthread_mutex_lock(socket->lock); health_code_update();