From: Mathieu Desnoyers Date: Mon, 3 Feb 2020 19:49:16 +0000 (-0500) Subject: lib ring buffer: move subbuffer_consume_record into LTTNG_RING_BUFFER_COUNT_EVENTS... X-Git-Tag: v2.13.0-rc1~145 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=935150def277f182d0e189068ae4d45a48e2b927;p=lttng-modules.git lib ring buffer: move subbuffer_consume_record into LTTNG_RING_BUFFER_COUNT_EVENTS ifdef 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 Change-Id: Id8b9e657ee420886b409be1f05ef08a0807fefdc --- diff --git a/include/ringbuffer/backend_internal.h b/include/ringbuffer/backend_internal.h index c76b25a8..fd24c674 100644 --- a/include/ringbuffer/backend_internal.h +++ b/include/ringbuffer/backend_internal.h @@ -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(