Add a packet sequence number
[lttng-modules.git] / lib / ringbuffer / backend_types.h
index 1577c812bb93c1df71cb5f736d8c1de6c8a933f6..8c53d0754eee633e4bf958c11a82f77fbb95322e 100644 (file)
@@ -44,6 +44,16 @@ struct lib_ring_buffer_backend_subbuffer {
        unsigned long id;               /* backend subbuffer identifier */
 };
 
+struct 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.
  */
@@ -55,6 +65,8 @@ struct lib_ring_buffer_backend {
        struct lib_ring_buffer_backend_subbuffer *buf_wsb;
        /* ring_buffer_backend_subbuffer for reader */
        struct lib_ring_buffer_backend_subbuffer buf_rsb;
+       /* Array of lib_ring_buffer_backend_counts for the packet counter */
+       struct 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.022991 seconds and 4 git commands to generate.