Move to kernel style SPDX license identifiers
[lttng-ust.git] / libringbuffer / frontend.h
index 89613d4cc64823a943ad3f42d17be83e0140d3c9..bac86d17cdbcdd925637e114f5ab2eadb7dc44ef 100644 (file)
@@ -1,34 +1,19 @@
-#ifndef _LTTNG_RING_BUFFER_FRONTEND_H
-#define _LTTNG_RING_BUFFER_FRONTEND_H
-
 /*
- * libringbuffer/frontend.h
- *
- * Ring Buffer Library Synchronization Header (API).
+ * SPDX-License-Identifier: LGPL-2.1-only
  *
  * Copyright (C) 2005-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
- *
- *
- * Author:
- *     Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Ring Buffer Library Synchronization Header (API).
  *
  * See ring_buffer_frontend.c for more information on wait-free algorithms.
  */
 
+#ifndef _LTTNG_RING_BUFFER_FRONTEND_H
+#define _LTTNG_RING_BUFFER_FRONTEND_H
+
+#include <stddef.h>
+#include <stdint.h>
+
 #include <urcu/compiler.h>
 #include <urcu/uatomic.h>
 
@@ -64,7 +49,9 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff
                                void *buf_addr,
                                size_t subbuf_size, size_t num_subbuf,
                                unsigned int switch_timer_interval,
-                               unsigned int read_timer_interval);
+                               unsigned int read_timer_interval,
+                               const int *stream_fds, int nr_stream_fds,
+                               int64_t blocking_timeout);
 
 /*
  * channel_destroy finalizes all channel's buffers, waits for readers to
@@ -130,6 +117,11 @@ extern int lib_ring_buffer_snapshot(struct lttng_ust_lib_ring_buffer *buf,
                                    unsigned long *consumed,
                                    unsigned long *produced,
                                    struct lttng_ust_shm_handle *handle);
+extern int lib_ring_buffer_snapshot_sample_positions(
+                                   struct lttng_ust_lib_ring_buffer *buf,
+                                   unsigned long *consumed,
+                                   unsigned long *produced,
+                                   struct lttng_ust_shm_handle *handle);
 extern void lib_ring_buffer_move_consumer(struct lttng_ust_lib_ring_buffer *buf,
                                          unsigned long consumed_new,
                                          struct lttng_ust_shm_handle *handle);
@@ -161,9 +153,14 @@ static inline
 void lib_ring_buffer_put_next_subbuf(struct lttng_ust_lib_ring_buffer *buf,
                                     struct lttng_ust_shm_handle *handle)
 {
+       struct channel *chan;
+
+       chan = shmp(handle, buf->backend.chan);
+       if (!chan)
+               return;
        lib_ring_buffer_put_subbuf(buf, handle);
-       lib_ring_buffer_move_consumer(buf, subbuf_align(buf->cons_snapshot,
-                                                       shmp(handle, buf->backend.chan)), handle);
+       lib_ring_buffer_move_consumer(buf, subbuf_align(buf->cons_snapshot, chan),
+                       handle);
 }
 
 extern void channel_reset(struct channel *chan);
This page took 0.02663 seconds and 4 git commands to generate.