Fix: perform relayd socket pair cleanup on control socket error
[lttng-tools.git] / src / common / consumer / consumer.h
index fb535fba6004d10491c04d0cb10ba95d3c4ec7ae..4cc40a431ee7ba86b0a54913aa73b43bdc3216f4 100644 (file)
@@ -65,6 +65,7 @@ enum lttng_consumer_command {
        LTTNG_CONSUMER_SET_CHANNEL_ROTATE_PIPE,
        LTTNG_CONSUMER_ROTATE_CHANNEL,
        LTTNG_CONSUMER_ROTATE_RENAME,
+       LTTNG_CONSUMER_ROTATE_PENDING_RELAY,
        LTTNG_CONSUMER_MKDIR,
 };
 
@@ -415,6 +416,11 @@ struct lttng_consumer_stream {
        uint64_t last_discarded_events;
        /* Copy of the sequence number of the last packet extracted. */
        uint64_t last_sequence_number;
+       /*
+        * Session's current trace archive id at the time of the creation of
+        * this stream.
+        */
+       uint64_t trace_archive_id;
        /*
         * Index file object of the index file for this stream.
         */
@@ -472,7 +478,7 @@ struct consumer_relayd_sock_pair {
        /* Network sequence number. */
        uint64_t net_seq_idx;
        /* Number of stream associated with this relayd */
-       unsigned int refcount;
+       int refcount;
 
        /*
         * This flag indicates whether or not we should destroy this object. The
@@ -506,6 +512,7 @@ struct consumer_relayd_sock_pair {
        /* Session id on both sides for the sockets. */
        uint64_t relayd_session_id;
        uint64_t sessiond_session_id;
+       struct lttng_consumer_local_data *ctx;
 };
 
 /*
@@ -727,7 +734,8 @@ struct lttng_consumer_stream *consumer_allocate_stream(uint64_t channel_key,
                int cpu,
                int *alloc_ret,
                enum consumer_channel_type type,
-               unsigned int monitor);
+               unsigned int monitor,
+               uint64_t trace_archive_id);
 struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key,
                uint64_t session_id,
                const char *pathname,
@@ -828,8 +836,11 @@ int lttng_consumer_rotate_ready_streams(uint64_t key,
                struct lttng_consumer_local_data *ctx);
 int lttng_consumer_rotate_rename(const char *current_path, const char *new_path,
                uid_t uid, gid_t gid, uint64_t relayd_id);
+int lttng_consumer_rotate_pending_relay( uint64_t session_id,
+               uint64_t relayd_id, uint64_t chunk_id);
 void lttng_consumer_reset_stream_rotate_state(struct lttng_consumer_stream *stream);
 int lttng_consumer_mkdir(const char *path, uid_t uid, gid_t gid,
                uint64_t relayd_id);
+void lttng_consumer_cleanup_relayd(struct consumer_relayd_sock_pair *relayd);
 
 #endif /* LIB_CONSUMER_H */
This page took 0.02502 seconds and 5 git commands to generate.