Version 2.2.3
[lttng-ust.git] / include / lttng / ringbuffer-config.h
index 24fb1cc4c35cd9a51d1fcb9fae3733da358abb13..ca52fc71fb02e90776e9d6157c9e100b5682f3fa 100644 (file)
  *
  * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
  */
 
 #include <errno.h>
 #include <urcu/arch.h>
 #include <string.h>
 #include "lttng/align.h"
+#include <lttng/ust-compiler.h>
 
 struct lttng_ust_lib_ring_buffer;
 struct channel;
 struct lttng_ust_lib_ring_buffer_config;
 struct lttng_ust_lib_ring_buffer_ctx;
-struct lttng_ust_shm_handle *handle;
+struct lttng_ust_shm_handle;
 
 /*
  * Ring buffer client callbacks. Only used by slow path, never on fast path.
@@ -187,6 +196,10 @@ struct lttng_ust_lib_ring_buffer_config {
  * Context passed to lib_ring_buffer_reserve(), lib_ring_buffer_commit(),
  * lib_ring_buffer_try_discard_reserve(), lib_ring_buffer_align_ctx() and
  * lib_ring_buffer_write().
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
  */
 #define LTTNG_UST_RING_BUFFER_CTX_PADDING      24
 struct lttng_ust_lib_ring_buffer_ctx {
@@ -228,6 +241,11 @@ struct lttng_ust_lib_ring_buffer_ctx {
  * @largest_align: largest alignment within data payload types
  * @cpu: processor id
  */
+static inline lttng_ust_notrace
+void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx,
+                             struct channel *chan, void *priv,
+                             size_t data_size, int largest_align,
+                             int cpu, struct lttng_ust_shm_handle *handle);
 static inline
 void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx,
                              struct channel *chan, void *priv,
@@ -275,6 +293,8 @@ void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx,
  * Calculate the offset needed to align the type.
  * size_of_type must be non-zero.
  */
+static inline lttng_ust_notrace
+unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type);
 static inline
 unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type)
 {
@@ -289,6 +309,8 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type)
  * Calculate the offset needed to align the type.
  * size_of_type must be non-zero.
  */
+static inline lttng_ust_notrace
+unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type);
 static inline
 unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type)
 {
@@ -301,6 +323,9 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type)
  * lib_ring_buffer_align_ctx - Align context offset on "alignment"
  * @ctx: ring buffer context.
  */
+static inline lttng_ust_notrace
+void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx,
+                          size_t alignment);
 static inline
 void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx,
                           size_t alignment)
@@ -313,6 +338,10 @@ void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx,
  * lib_ring_buffer_check_config() returns 0 on success.
  * Used internally to check for valid configurations at channel creation.
  */
+static inline lttng_ust_notrace
+int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config *config,
+                            unsigned int switch_timer_interval,
+                            unsigned int read_timer_interval);
 static inline
 int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config *config,
                             unsigned int switch_timer_interval,
This page took 0.025784 seconds and 4 git commands to generate.