lib ring buffer: move subbuffer_consume_record into LTTNG_RING_BUFFER_COUNT_EVENTS...
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 3 Feb 2020 19:49:16 +0000 (14:49 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 18 Nov 2020 18:03:27 +0000 (13:03 -0500)
When event accounting is disabled, counting of event records consumed by
the iterator should be disabled as well, otherwise it triggers
CHAN_WARN_ON() because the accounting of events produced is not
performed.

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

include/ringbuffer/backend_internal.h

index c76b25a85ed2eeffa1f3ccd99dccaa0e2b6bcea8..fd24c6741551f79aec2560dd598f65209dcfc5a5 100644 (file)
@@ -236,14 +236,6 @@ void subbuffer_count_record(const struct lib_ring_buffer_config *config,
        sb_bindex = subbuffer_id_get_index(config, bufb->buf_wsb[idx].id);
        v_inc(config, &bufb->array[sb_bindex]->records_commit);
 }
-#else /* LTTNG_RING_BUFFER_COUNT_EVENTS */
-static inline
-void subbuffer_count_record(const struct lib_ring_buffer_config *config,
-                           struct lib_ring_buffer_backend *bufb,
-                           unsigned long idx)
-{
-}
-#endif /* #else LTTNG_RING_BUFFER_COUNT_EVENTS */
 
 /*
  * Reader has exclusive subbuffer access for record consumption. No need to
@@ -262,6 +254,19 @@ void subbuffer_consume_record(const struct lib_ring_buffer_config *config,
        _v_dec(config, &bufb->array[sb_bindex]->records_unread);
        v_inc(config, &bufb->records_read);
 }
+#else /* LTTNG_RING_BUFFER_COUNT_EVENTS */
+static inline
+void subbuffer_count_record(const struct lib_ring_buffer_config *config,
+                           struct lib_ring_buffer_backend *bufb,
+                           unsigned long idx)
+{
+}
+static inline
+void subbuffer_consume_record(const struct lib_ring_buffer_config *config,
+                             struct lib_ring_buffer_backend *bufb)
+{
+}
+#endif /* #else LTTNG_RING_BUFFER_COUNT_EVENTS */
 
 static inline
 unsigned long subbuffer_get_records_count(
This page took 0.026984 seconds and 4 git commands to generate.