Move to kernel style SPDX license identifiers
[lttng-ust.git] / libringbuffer / backend_types.h
index a53fb322ec109bb2fc5c9cc275e5f0118dd67bf5..f821c27fdd0684695866148da84a6e1fd8599e62 100644 (file)
@@ -1,29 +1,16 @@
-#ifndef _LTTNG_RING_BUFFER_BACKEND_TYPES_H
-#define _LTTNG_RING_BUFFER_BACKEND_TYPES_H
-
 /*
- * linux/ringbuffer/backend_types.h
- *
- * Ring buffer backend (types).
+ * SPDX-License-Identifier: LGPL-2.1-only
  *
  * Copyright (C) 2008-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; only
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Ring buffer backend (types).
  */
 
+#ifndef _LTTNG_RING_BUFFER_BACKEND_TYPES_H
+#define _LTTNG_RING_BUFFER_BACKEND_TYPES_H
+
 #include <limits.h>
+#include <stdint.h>
 #include "shm_internal.h"
 #include "vatomic.h"
 
@@ -42,6 +29,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 +55,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.024096 seconds and 4 git commands to generate.