Cleanup: apply `include-what-you-use` guideline for `uint*_t`
[lttng-ust.git] / libringbuffer / backend_types.h
index a53fb322ec109bb2fc5c9cc275e5f0118dd67bf5..3432ef078c25071be7ba6dcb216bc0afb44c23ae 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 #include <limits.h>
+#include <stdint.h>
 #include "shm_internal.h"
 #include "vatomic.h"
 
@@ -42,6 +43,16 @@ struct lttng_ust_lib_ring_buffer_backend_subbuffer {
        unsigned long id;               /* backend subbuffer identifier */
 };
 
+struct lttng_ust_lib_ring_buffer_backend_counts {
+       /*
+        * Counter specific to the sub-buffer location within the ring buffer.
+        * The actual sequence number of the packet within the entire ring
+        * buffer can be derived from the formula nr_subbuffers * seq_cnt +
+        * subbuf_idx.
+        */
+       uint64_t seq_cnt;               /* packet sequence number */
+};
+
 /*
  * Forward declaration of frontend-specific channel and ring_buffer.
  */
@@ -58,6 +69,8 @@ struct lttng_ust_lib_ring_buffer_backend {
        DECLARE_SHMP(struct lttng_ust_lib_ring_buffer_backend_subbuffer, buf_wsb);
        /* ring_buffer_backend_subbuffer for reader */
        struct lttng_ust_lib_ring_buffer_backend_subbuffer buf_rsb;
+       /* Array of lib_ring_buffer_backend_counts for the packet counter */
+       DECLARE_SHMP(struct lttng_ust_lib_ring_buffer_backend_counts, buf_cnt);
        /*
         * Pointer array of backend pages, for whole buffer.
         * Indexed by ring_buffer_backend_subbuffer identifier (id) index.
This page took 0.02297 seconds and 4 git commands to generate.