Fix: consumerd: slow metadata push slows down application registration
[lttng-tools.git] / src / common / consumer / consumer.h
index c3e15e3163fb912e6da41ecba92c51434b37b864..53c39e6eb003e9530050de53e276f7ef1672fe05 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <limits.h>
 #include <poll.h>
+#include <stdint.h>
 #include <unistd.h>
 #include <urcu/list.h>
 
@@ -28,6 +29,7 @@
 #include <common/credentials.h>
 #include <common/buffer-view.h>
 #include <common/dynamic-array.h>
+#include <common/waiter.h>
 
 struct lttng_consumer_local_data;
 
@@ -184,6 +186,11 @@ struct lttng_consumer_channel {
        /* Metadata cache is metadata channel */
        struct consumer_metadata_cache *metadata_cache;
 
+       /*
+        * Wait queue awaiting updates to metadata stream's flushed position.
+        */
+       struct lttng_wait_queue metadata_pushed_wait_queue;
+
        /* For UST metadata periodical flush */
        int switch_timer_enabled;
        timer_t switch_timer;
@@ -422,6 +429,11 @@ struct lttng_consumer_stream {
        struct lttng_ht_node_u64 node_channel_id;
        /* HT node used in consumer_data.stream_list_ht */
        struct lttng_ht_node_u64 node_session_id;
+       /*
+        * List used by channels to reference streams that are not yet globally
+        * visible.
+        */
+       struct cds_list_head send_node;
        /* Pointer to associated channel. */
        struct lttng_consumer_channel *chan;
        /*
@@ -554,7 +566,6 @@ struct lttng_consumer_stream {
        char name[LTTNG_SYMBOL_NAME_LEN];
        /* Internal state of libustctl. */
        struct lttng_ust_ctl_consumer_stream *ustream;
-       struct cds_list_head send_node;
        /* On-disk circular buffer */
        uint64_t tracefile_size_current;
        uint64_t tracefile_count_current;
@@ -1014,10 +1025,16 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
                struct lttng_consumer_local_data *ctx,
                bool locked_by_caller);
 int lttng_consumer_on_recv_stream(struct lttng_consumer_stream *stream);
-void consumer_add_relayd_socket(uint64_t net_seq_idx, int sock_type,
-               struct lttng_consumer_local_data *ctx, int sock,
-               struct pollfd *consumer_sockpoll, struct lttcomm_relayd_sock *relayd_sock,
-               uint64_t sessiond_id, uint64_t relayd_session_id);
+void consumer_add_relayd_socket(uint64_t net_seq_idx,
+               int sock_type,
+               struct lttng_consumer_local_data *ctx,
+               int sock,
+               struct pollfd *consumer_sockpoll,
+               uint64_t sessiond_id,
+               uint64_t relayd_session_id,
+               uint32_t relayd_version_major,
+               uint32_t relayd_version_minor,
+               enum lttcomm_sock_proto relayd_socket_protocol);
 void consumer_flag_relayd_for_destroy(
                struct consumer_relayd_sock_pair *relayd);
 int consumer_data_pending(uint64_t id);
This page took 0.023605 seconds and 4 git commands to generate.