Fix: ring buffer event counter
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 10 Mar 2022 14:58:37 +0000 (09:58 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 11 Mar 2022 16:39:49 +0000 (11:39 -0500)
When compiling with -DLTTNG_RING_BUFFER_COUNT_EVENTS, the lttng-ust
libringbuffer can count events (with additional overhead). This is never
used or enabled by default. Fix this code so it compiles again when the
define is enabled.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I3aeeff7995d66a07316cc5c535b5271536a89636

src/common/ringbuffer/backend_internal.h
src/common/ringbuffer/frontend_api.h

index 9ce9d1405662a150a55737c54746d208115ed2b2..bd4221776794d6643d379363045efa0b4aa4536c 100644 (file)
@@ -205,7 +205,7 @@ int subbuffer_id_check_index(const struct lttng_ust_ring_buffer_config *config,
 
 static inline
 int lib_ring_buffer_backend_get_pages(const struct lttng_ust_ring_buffer_config *config,
-                       struct lttng_ust_ring_buffer_ctx *ctx,
+                       const struct lttng_ust_ring_buffer_ctx *ctx,
                        struct lttng_ust_ring_buffer_backend_pages **backend_pages)
 {
        struct lttng_ust_ring_buffer_ctx_private *ctx_private = ctx->priv;
@@ -244,7 +244,7 @@ static inline
 struct lttng_ust_ring_buffer_backend_pages *
        lib_ring_buffer_get_backend_pages_from_ctx(
                const struct lttng_ust_ring_buffer_config *config __attribute__((unused)),
-               struct lttng_ust_ring_buffer_ctx *ctx)
+               const struct lttng_ust_ring_buffer_ctx *ctx)
 {
        return ctx->priv->backend_pages;
 }
@@ -256,9 +256,7 @@ struct lttng_ust_ring_buffer_backend_pages *
 #ifdef LTTNG_RING_BUFFER_COUNT_EVENTS
 static inline
 void subbuffer_count_record(const struct lttng_ust_ring_buffer_config *config,
-                           const struct lttng_ust_ring_buffer_ctx *ctx,
-                           struct lttng_ust_ring_buffer_backend *bufb,
-                           unsigned long idx, struct lttng_ust_shm_handle *handle)
+                           const struct lttng_ust_ring_buffer_ctx *ctx)
 {
        struct lttng_ust_ring_buffer_backend_pages *backend_pages;
 
@@ -272,10 +270,7 @@ void subbuffer_count_record(const struct lttng_ust_ring_buffer_config *config,
 #else /* LTTNG_RING_BUFFER_COUNT_EVENTS */
 static inline
 void subbuffer_count_record(const struct lttng_ust_ring_buffer_config *config __attribute__((unused)),
-               const struct lttng_ust_ring_buffer_ctx *ctx __attribute__((unused)),
-               struct lttng_ust_ring_buffer_backend *bufb __attribute__((unused)),
-               unsigned long idx __attribute__((unused)),
-               struct lttng_ust_shm_handle *handle __attribute__((unused)))
+               const struct lttng_ust_ring_buffer_ctx *ctx __attribute__((unused)))
 {
 }
 #endif /* #else LTTNG_RING_BUFFER_COUNT_EVENTS */
index 879461f37f1fa872b54285475f7d99c03a4f1c8b..b306986ecf3d74e05b41f66d58e9a239853ee41e 100644 (file)
@@ -257,7 +257,7 @@ void lib_ring_buffer_commit(const struct lttng_ust_ring_buffer_config *config,
        /*
         * Must count record before incrementing the commit count.
         */
-       subbuffer_count_record(config, ctx, &buf->backend, endidx, handle);
+       subbuffer_count_record(config, ctx);
 
        /*
         * Order all writes to buffer before the commit count update that will
This page took 0.026817 seconds and 4 git commands to generate.