/* Internal helpers */
#include <wrapper/ringbuffer/frontend_internal.h>
+/* Max ring buffer nesting count, see lib_ring_buffer_get_cpu(). */
+#define RING_BUFFER_MAX_NESTING 4
+
/* Buffer creation/removal and setup operations */
/*
extern int lib_ring_buffer_snapshot(struct lib_ring_buffer *buf,
unsigned long *consumed,
unsigned long *produced);
+extern int lib_ring_buffer_snapshot_sample_positions(
+ struct lib_ring_buffer *buf,
+ unsigned long *consumed,
+ unsigned long *produced);
extern void lib_ring_buffer_move_consumer(struct lib_ring_buffer *buf,
unsigned long consumed_new);
int lib_ring_buffer_is_finalized(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf)
{
- int finalized = ACCESS_ONCE(buf->finalized);
+ int finalized = READ_ONCE(buf->finalized);
/*
* Read finalized before counters.
*/