X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fconsumer.h;h=7ff3e5dcf70cbe06f28c371480ffd4391eec75a1;hp=2dd3b81ddbb40b537b1c314f131446a609d6d406;hb=4ce514c43483ba24fd935024da5b7aca681a7e52;hpb=ba28686d644c949b91fba24738c645a62ca26286 diff --git a/src/bin/lttng-sessiond/consumer.h b/src/bin/lttng-sessiond/consumer.h index 2dd3b81dd..7ff3e5dcf 100644 --- a/src/bin/lttng-sessiond/consumer.h +++ b/src/bin/lttng-sessiond/consumer.h @@ -33,8 +33,12 @@ enum consumer_dst_type { }; struct consumer_socket { - /* File descriptor */ - int fd; + /* + * File descriptor. This is just a reference to the consumer data meaning + * that every access must be locked and check for a possible invalid value. + */ + int *fd; + /* * To use this socket (send/recv), this lock MUST be acquired. */ @@ -87,6 +91,13 @@ struct consumer_data { int err_sock; /* These two sockets uses the cmd_unix_sock_path. */ int cmd_sock; + /* + * The metadata socket object is handled differently and only created + * locally in this object thus it's the only reference available in the + * session daemon. For that reason, a static variable for the fd is + * required and the metadata socket fd points to it. + */ + int metadata_fd; struct consumer_socket metadata_sock; /* consumer error and command Unix socket path */ @@ -157,7 +168,7 @@ struct consumer_socket *consumer_find_socket(int key, struct consumer_output *consumer); struct consumer_socket *consumer_find_socket_by_bitness(int bits, struct consumer_output *consumer); -struct consumer_socket *consumer_allocate_socket(int fd); +struct consumer_socket *consumer_allocate_socket(int *fd); void consumer_add_socket(struct consumer_socket *sock, struct consumer_output *consumer); void consumer_del_socket(struct consumer_socket *sock,