Consumer: strip ring buffer header when consuming ctf2 ring buffer packet
[deliverable/lttng-tools.git] / src / common / consumer / consumer.hpp
index 4bcfe5d9529cc6460f293dc7fbc47e0e04728e2a..891b650b53ef0cb37630d34cba848e2fef5feaba 100644 (file)
@@ -253,6 +253,9 @@ struct lttng_consumer_channel {
        uint64_t lost_packets;
 
        bool streams_sent_to_relayd;
+       uint64_t last_consumed_size_sample_sent;
+
+       int trace_format;
 };
 
 struct stream_subbuffer {
@@ -345,8 +348,7 @@ typedef int (*extract_subbuffer_info_cb)(
  *
  * Stream and channel locks are acquired during this call.
  */
-typedef int (*pre_consume_subbuffer_cb)(struct lttng_consumer_stream *,
-               const struct stream_subbuffer *);
+typedef int (*pre_consume_subbuffer_cb)(struct lttng_consumer_stream *, struct stream_subbuffer *);
 
 /*
  * Consume subbuffer contents.
@@ -449,7 +451,11 @@ struct lttng_consumer_stream {
        /* Amount of bytes written to the output */
        uint64_t output_written;
        int shm_fd_is_copy;
-       int data_read;
+       /*
+        * When a stream's pipe is hung up, a final flush is performed (see hangup_flush_done). This
+        * indicates whether or not the data resulting from this flush is still to be consumed.
+        */
+       int has_data_left_to_be_read_before_teardown;
        int hangup_flush_done;
 
        /*
@@ -968,7 +974,8 @@ struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key,
                unsigned int live_timer_interval,
                bool is_in_live_session,
                const char *root_shm_path,
-               const char *shm_path);
+               const char *shm_path,
+               int trace_format);
 void consumer_del_stream(struct lttng_consumer_stream *stream,
                struct lttng_ht *ht);
 void consumer_del_metadata_stream(struct lttng_consumer_stream *stream,
@@ -1075,11 +1082,12 @@ enum lttcomm_return_code lttng_consumer_trace_chunk_exists(
 void lttng_consumer_cleanup_relayd(struct consumer_relayd_sock_pair *relayd);
 enum lttcomm_return_code lttng_consumer_init_command(
                struct lttng_consumer_local_data *ctx,
-               const lttng_uuid sessiond_uuid);
+               const lttng_uuid& sessiond_uuid);
 int lttng_consumer_clear_channel(struct lttng_consumer_channel *channel);
 enum lttcomm_return_code lttng_consumer_open_channel_packets(
                struct lttng_consumer_channel *channel);
 int consumer_metadata_wakeup_pipe(const struct lttng_consumer_channel *channel);
 void lttng_consumer_sigbus_handle(void *addr);
+void sample_and_send_channel_buffer_stats(struct lttng_consumer_channel *channel);
 
 #endif /* LIB_CONSUMER_H */
This page took 0.061691 seconds and 5 git commands to generate.