SoW-2019-0002: Dynamic Snapshot
[deliverable/lttng-modules.git] / lib / ringbuffer / iterator.h
index 6ed5b3b64f70230733abc227c3850b51e1aa984b..2c945b8200e08a555e906dbb888741fa345ff3b7 100644 (file)
@@ -1,31 +1,15 @@
-#ifndef _LIB_RING_BUFFER_ITERATOR_H
-#define _LIB_RING_BUFFER_ITERATOR_H
-
-/*
+/* SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1)
+ *
  * lib/ringbuffer/iterator.h
  *
  * Ring buffer and channel iterators.
  *
  * Copyright (C) 2010-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>
  */
 
+#ifndef _LIB_RING_BUFFER_ITERATOR_H
+#define _LIB_RING_BUFFER_ITERATOR_H
+
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/ringbuffer/frontend.h>
 #include <wrapper/ringbuffer/vfs.h>
 extern ssize_t lib_ring_buffer_get_next_record(struct channel *chan,
                                               struct lib_ring_buffer *buf);
 
+/*
+ * Ensure that the current subbuffer is put after client code has read the
+ * payload of the current record. Has an effect when the end of subbuffer is
+ * reached. It is not required if get_next_record is called successively.
+ * However, it should be invoked before returning data to user-space to ensure
+ * that the get/put subbuffer state is quiescent.
+ */
+extern void lib_ring_buffer_put_current_record(struct lib_ring_buffer *buf);
+
 /*
  * channel_get_next_record advances the buffer read position to the next record.
  * It returns either the size of the next record, -EAGAIN if there is currently
This page took 0.033566 seconds and 5 git commands to generate.