#include <ringbuffer/config.h>
#include <ringbuffer/backend_types.h>
#include <ringbuffer/frontend_types.h>
-#include <lib/prio_heap/lttng_prio_heap.h> /* For per-CPU read-side iterator */
+#include <lttng/prio_heap.h> /* For per-CPU read-side iterator */
/* Buffer offset macros */
/* buf_trunc mask selects only the buffer number. */
static inline
-unsigned long buf_trunc(unsigned long offset, struct channel *chan)
+unsigned long buf_trunc(unsigned long offset, struct lttng_kernel_ring_buffer_channel *chan)
{
return offset & ~(chan->backend.buf_size - 1);
/* Select the buffer number value (counter). */
static inline
-unsigned long buf_trunc_val(unsigned long offset, struct channel *chan)
+unsigned long buf_trunc_val(unsigned long offset, struct lttng_kernel_ring_buffer_channel *chan)
{
return buf_trunc(offset, chan) >> chan->backend.buf_size_order;
}
/* buf_offset mask selects only the offset within the current buffer. */
static inline
-unsigned long buf_offset(unsigned long offset, struct channel *chan)
+unsigned long buf_offset(unsigned long offset, struct lttng_kernel_ring_buffer_channel *chan)
{
return offset & (chan->backend.buf_size - 1);
}
/* subbuf_offset mask selects the offset within the current subbuffer. */
static inline
-unsigned long subbuf_offset(unsigned long offset, struct channel *chan)
+unsigned long subbuf_offset(unsigned long offset, struct lttng_kernel_ring_buffer_channel *chan)
{
return offset & (chan->backend.subbuf_size - 1);
}
/* subbuf_trunc mask selects the subbuffer number. */
static inline
-unsigned long subbuf_trunc(unsigned long offset, struct channel *chan)
+unsigned long subbuf_trunc(unsigned long offset, struct lttng_kernel_ring_buffer_channel *chan)
{
return offset & ~(chan->backend.subbuf_size - 1);
}
/* subbuf_align aligns the offset to the next subbuffer. */
static inline
-unsigned long subbuf_align(unsigned long offset, struct channel *chan)
+unsigned long subbuf_align(unsigned long offset, struct lttng_kernel_ring_buffer_channel *chan)
{
return (offset + chan->backend.subbuf_size)
& ~(chan->backend.subbuf_size - 1);
/* subbuf_index returns the index of the current subbuffer within the buffer. */
static inline
-unsigned long subbuf_index(unsigned long offset, struct channel *chan)
+unsigned long subbuf_index(unsigned long offset, struct lttng_kernel_ring_buffer_channel *chan)
{
return buf_offset(offset, chan) >> chan->backend.subbuf_size_order;
}
#endif
extern
-int lib_ring_buffer_reserve_slow(struct lib_ring_buffer_ctx *ctx,
+int lib_ring_buffer_reserve_slow(struct lttng_kernel_ring_buffer_ctx *ctx,
void *client_ctx);
extern
extern
void lib_ring_buffer_check_deliver_slow(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
- struct channel *chan,
+ struct lttng_kernel_ring_buffer_channel *chan,
unsigned long offset,
unsigned long commit_count,
unsigned long idx,
static inline
void lib_ring_buffer_reserve_push_reader(struct lib_ring_buffer *buf,
- struct channel *chan,
+ struct lttng_kernel_ring_buffer_channel *chan,
unsigned long offset)
{
unsigned long consumed_old, consumed_new;
*/
static inline
void lib_ring_buffer_clear_reader(struct lib_ring_buffer *buf,
- struct channel *chan)
+ struct lttng_kernel_ring_buffer_channel *chan)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
unsigned long offset, consumed_old, consumed_new;
static inline
int lib_ring_buffer_pending_data(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
- struct channel *chan)
+ struct lttng_kernel_ring_buffer_channel *chan)
{
return !!subbuf_offset(v_read(config, &buf->offset), chan);
}
static inline
int lib_ring_buffer_reserve_committed(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
- struct channel *chan)
+ struct lttng_kernel_ring_buffer_channel *chan)
{
unsigned long offset, idx, commit_count;
static inline
void lib_ring_buffer_check_deliver(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
- struct channel *chan,
+ struct lttng_kernel_ring_buffer_channel *chan,
unsigned long offset,
unsigned long commit_count,
unsigned long idx,
static inline
void lib_ring_buffer_write_commit_counter(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
- struct channel *chan,
+ struct lttng_kernel_ring_buffer_channel *chan,
unsigned long buf_offset,
unsigned long commit_count,
struct commit_counters_hot *cc_hot)