From: Mathieu Desnoyers Date: Thu, 6 May 2021 20:08:37 +0000 (-0400) Subject: Rename struct channel to struct lttng_kernel_ring_buffer_channel X-Git-Tag: v2.13.0-rc2~26 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4071a6283f2291a5894dc6b46608721fc6a56239;p=lttng-modules.git Rename struct channel to struct lttng_kernel_ring_buffer_channel Signed-off-by: Mathieu Desnoyers Change-Id: Ifb737dfa71c9fdd08b62680f7782328b50a70d61 --- diff --git a/include/lttng/events-internal.h b/include/lttng/events-internal.h index 1108cf27..463bc03b 100644 --- a/include/lttng/events-internal.h +++ b/include/lttng/events-internal.h @@ -149,7 +149,7 @@ struct lttng_kernel_channel_buffer_private { enum channel_type channel_type; struct lttng_kernel_ctx *ctx; - struct channel *rb_chan; /* Ring buffer channel */ + struct lttng_kernel_ring_buffer_channel *rb_chan; /* Ring buffer channel */ unsigned int metadata_dumped:1; struct list_head node; /* Channel list in session */ struct lttng_transport *transport; @@ -308,26 +308,26 @@ struct lttng_metadata_stream { struct lttng_kernel_channel_buffer_ops_private { struct lttng_kernel_channel_buffer_ops *pub; /* Public channel buffer ops interface */ - struct channel *(*channel_create)(const char *name, + struct lttng_kernel_ring_buffer_channel *(*channel_create)(const char *name, void *priv, void *buf_addr, size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval); - void (*channel_destroy)(struct channel *chan); - struct lib_ring_buffer *(*buffer_read_open)(struct channel *chan); - int (*buffer_has_read_closed_stream)(struct channel *chan); + void (*channel_destroy)(struct lttng_kernel_ring_buffer_channel *chan); + struct lib_ring_buffer *(*buffer_read_open)(struct lttng_kernel_ring_buffer_channel *chan); + int (*buffer_has_read_closed_stream)(struct lttng_kernel_ring_buffer_channel *chan); void (*buffer_read_close)(struct lib_ring_buffer *buf); /* * packet_avail_size returns the available size in the current * packet. Note that the size returned is only a hint, since it * may change due to concurrent writes. */ - size_t (*packet_avail_size)(struct channel *chan); - wait_queue_head_t *(*get_writer_buf_wait_queue)(struct channel *chan, int cpu); - wait_queue_head_t *(*get_hp_wait_queue)(struct channel *chan); - int (*is_finalized)(struct channel *chan); - int (*is_disabled)(struct channel *chan); + size_t (*packet_avail_size)(struct lttng_kernel_ring_buffer_channel *chan); + wait_queue_head_t *(*get_writer_buf_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan, int cpu); + wait_queue_head_t *(*get_hp_wait_queue)(struct lttng_kernel_ring_buffer_channel *chan); + int (*is_finalized)(struct lttng_kernel_ring_buffer_channel *chan); + int (*is_disabled)(struct lttng_kernel_ring_buffer_channel *chan); int (*timestamp_begin) (const struct lib_ring_buffer_config *config, struct lib_ring_buffer *bufb, uint64_t *timestamp_begin); @@ -403,7 +403,7 @@ struct lttng_event_notifier_group { struct lttng_event_notifier_ht event_notifiers_ht; /* Hash table of event notifiers */ struct lttng_kernel_channel_buffer_ops *ops; struct lttng_transport *transport; - struct channel *chan; /* Ring buffer channel for event notifier group. */ + struct lttng_kernel_ring_buffer_channel *chan; /* Ring buffer channel for event notifier group. */ struct lib_ring_buffer *buf; /* Ring buffer for event notifier group. */ wait_queue_head_t read_wait; struct irq_work wakeup_pending; /* Pending wakeup irq work. */ @@ -1140,7 +1140,7 @@ int lttng_probes_init(void); void lttng_probes_exit(void); int lttng_metadata_output_channel(struct lttng_metadata_stream *stream, - struct channel *chan, bool *coherent); + struct lttng_kernel_ring_buffer_channel *chan, bool *coherent); int lttng_id_tracker_get_node_id(const struct lttng_id_hash_node *node); int lttng_id_tracker_empty_set(struct lttng_kernel_id_tracker *lf); diff --git a/include/ringbuffer/backend_types.h b/include/ringbuffer/backend_types.h index f111390c..d839f2c6 100644 --- a/include/ringbuffer/backend_types.h +++ b/include/ringbuffer/backend_types.h @@ -46,7 +46,7 @@ struct lib_ring_buffer_backend_counts { /* * Forward declaration of frontend-specific channel and ring_buffer. */ -struct channel; +struct lttng_kernel_ring_buffer_channel; struct lib_ring_buffer; struct lib_ring_buffer_backend { @@ -63,7 +63,7 @@ struct lib_ring_buffer_backend { struct lib_ring_buffer_backend_pages **array; unsigned int num_pages_per_subbuf; - struct channel *chan; /* Associated channel */ + struct lttng_kernel_ring_buffer_channel *chan; /* Associated channel */ int cpu; /* This buffer's cpu. -1 if global. */ union v_atomic records_read; /* Number of records read */ unsigned int allocated:1; /* is buffer allocated ? */ diff --git a/include/ringbuffer/config.h b/include/ringbuffer/config.h index 4ce36d18..a6821267 100644 --- a/include/ringbuffer/config.h +++ b/include/ringbuffer/config.h @@ -17,7 +17,7 @@ #include struct lib_ring_buffer; -struct channel; +struct lttng_kernel_ring_buffer_channel; struct lib_ring_buffer_config; struct lttng_kernel_ring_buffer_ctx; struct lttng_kernel_ring_buffer_ctx_private; @@ -32,9 +32,9 @@ struct lib_ring_buffer_client_cb { /* Mandatory callbacks */ /* A static inline version is also required for fast path */ - u64 (*ring_buffer_clock_read) (struct channel *chan); + u64 (*ring_buffer_clock_read) (struct lttng_kernel_ring_buffer_channel *chan); size_t (*record_header_size) (const struct lib_ring_buffer_config *config, - struct channel *chan, size_t offset, + struct lttng_kernel_ring_buffer_channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx); @@ -63,7 +63,7 @@ struct lib_ring_buffer_client_cb { * iterator. */ void (*record_get) (const struct lib_ring_buffer_config *config, - struct channel *chan, struct lib_ring_buffer *buf, + struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf, size_t offset, size_t *header_len, size_t *payload_len, u64 *timestamp); }; @@ -169,7 +169,7 @@ struct lib_ring_buffer_config { struct lttng_kernel_ring_buffer_ctx_private { /* input received by lib_ring_buffer_reserve(). */ - struct channel *chan; /* ring buffer channel */ + struct lttng_kernel_ring_buffer_channel *chan; /* ring buffer channel */ /* output from lib_ring_buffer_reserve() */ int reserve_cpu; /* processor id updated by the reserve */ diff --git a/include/ringbuffer/frontend.h b/include/ringbuffer/frontend.h index 1707d713..7dc508ff 100644 --- a/include/ringbuffer/frontend.h +++ b/include/ringbuffer/frontend.h @@ -52,7 +52,7 @@ */ extern -struct channel *channel_create(const struct lib_ring_buffer_config *config, +struct lttng_kernel_ring_buffer_channel *channel_create(const struct lib_ring_buffer_config *config, const char *name, void *priv, void *buf_addr, size_t subbuf_size, size_t num_subbuf, @@ -65,7 +65,7 @@ struct channel *channel_create(const struct lib_ring_buffer_config *config, * channel. */ extern -void *channel_destroy(struct channel *chan); +void *channel_destroy(struct lttng_kernel_ring_buffer_channel *chan); /* Buffer read operations */ @@ -83,7 +83,7 @@ void *channel_destroy(struct channel *chan); extern struct lib_ring_buffer *channel_get_ring_buffer( const struct lib_ring_buffer_config *config, - struct channel *chan, int cpu); + struct lttng_kernel_ring_buffer_channel *chan, int cpu); extern int lib_ring_buffer_open_read(struct lib_ring_buffer *buf); extern void lib_ring_buffer_release_read(struct lib_ring_buffer *buf); @@ -104,8 +104,8 @@ extern int lib_ring_buffer_get_subbuf(struct lib_ring_buffer *buf, unsigned long consumed); extern void lib_ring_buffer_put_subbuf(struct lib_ring_buffer *buf); -void lib_ring_buffer_set_quiescent_channel(struct channel *chan); -void lib_ring_buffer_clear_quiescent_channel(struct channel *chan); +void lib_ring_buffer_set_quiescent_channel(struct lttng_kernel_ring_buffer_channel *chan); +void lib_ring_buffer_clear_quiescent_channel(struct lttng_kernel_ring_buffer_channel *chan); /* * lib_ring_buffer_get_next_subbuf/lib_ring_buffer_put_next_subbuf are helpers @@ -130,7 +130,7 @@ static inline void lib_ring_buffer_put_next_subbuf(struct lib_ring_buffer *buf) buf->backend.chan)); } -extern void channel_reset(struct channel *chan); +extern void channel_reset(struct lttng_kernel_ring_buffer_channel *chan); extern void lib_ring_buffer_reset(struct lib_ring_buffer *buf); static inline @@ -164,13 +164,13 @@ int lib_ring_buffer_is_finalized(const struct lib_ring_buffer_config *config, } static inline -int lib_ring_buffer_channel_is_finalized(const struct channel *chan) +int lib_ring_buffer_channel_is_finalized(const struct lttng_kernel_ring_buffer_channel *chan) { return chan->finalized; } static inline -int lib_ring_buffer_channel_is_disabled(const struct channel *chan) +int lib_ring_buffer_channel_is_disabled(const struct lttng_kernel_ring_buffer_channel *chan) { return atomic_read(&chan->record_disabled); } diff --git a/include/ringbuffer/frontend_api.h b/include/ringbuffer/frontend_api.h index 49f0eee2..08e2f573 100644 --- a/include/ringbuffer/frontend_api.h +++ b/include/ringbuffer/frontend_api.h @@ -75,7 +75,7 @@ int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config, unsigned long *o_begin, unsigned long *o_end, unsigned long *o_old, size_t *before_hdr_pad) { - struct channel *chan = ctx->priv.chan; + struct lttng_kernel_ring_buffer_channel *chan = ctx->priv.chan; struct lib_ring_buffer *buf = ctx->priv.buf; *o_begin = v_read(config, &buf->offset); *o_old = *o_begin; @@ -143,7 +143,7 @@ int lib_ring_buffer_reserve(const struct lib_ring_buffer_config *config, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) { - struct channel *chan = ctx->priv.chan; + struct lttng_kernel_ring_buffer_channel *chan = ctx->priv.chan; struct lib_ring_buffer *buf; unsigned long o_begin, o_end, o_old; size_t before_hdr_pad = 0; @@ -231,7 +231,7 @@ static inline void lib_ring_buffer_commit(const struct lib_ring_buffer_config *config, const struct lttng_kernel_ring_buffer_ctx *ctx) { - struct channel *chan = ctx->priv.chan; + struct lttng_kernel_ring_buffer_channel *chan = ctx->priv.chan; struct lib_ring_buffer *buf = ctx->priv.buf; unsigned long offset_end = ctx->priv.buf_offset; unsigned long endidx = subbuf_index(offset_end - 1, chan); @@ -329,14 +329,14 @@ int lib_ring_buffer_try_discard_reserve(const struct lib_ring_buffer_config *con static inline void channel_record_disable(const struct lib_ring_buffer_config *config, - struct channel *chan) + struct lttng_kernel_ring_buffer_channel *chan) { atomic_inc(&chan->record_disabled); } static inline void channel_record_enable(const struct lib_ring_buffer_config *config, - struct channel *chan) + struct lttng_kernel_ring_buffer_channel *chan) { atomic_dec(&chan->record_disabled); } diff --git a/include/ringbuffer/frontend_internal.h b/include/ringbuffer/frontend_internal.h index 2624b4dc..fa186823 100644 --- a/include/ringbuffer/frontend_internal.h +++ b/include/ringbuffer/frontend_internal.h @@ -21,7 +21,7 @@ /* 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); @@ -29,35 +29,35 @@ unsigned long buf_trunc(unsigned long offset, struct channel *chan) /* 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); @@ -65,7 +65,7 @@ unsigned long subbuf_align(unsigned long offset, struct channel *chan) /* 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; } @@ -144,7 +144,7 @@ void lib_ring_buffer_switch_slow(struct lib_ring_buffer *buf, 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, @@ -161,7 +161,7 @@ void lib_ring_buffer_clear(struct lib_ring_buffer *buf); 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; @@ -198,7 +198,7 @@ void lib_ring_buffer_reserve_push_reader(struct lib_ring_buffer *buf, */ 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; @@ -217,7 +217,7 @@ void lib_ring_buffer_clear_reader(struct lib_ring_buffer *buf, 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); } @@ -238,7 +238,7 @@ unsigned long lib_ring_buffer_get_data_size(const struct lib_ring_buffer_config 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; @@ -273,7 +273,7 @@ int lib_ring_buffer_reserve_committed(const struct lib_ring_buffer_config *confi 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, @@ -300,7 +300,7 @@ void lib_ring_buffer_check_deliver(const struct lib_ring_buffer_config *config, 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) diff --git a/include/ringbuffer/frontend_types.h b/include/ringbuffer/frontend_types.h index 97fe3582..a671c33b 100644 --- a/include/ringbuffer/frontend_types.h +++ b/include/ringbuffer/frontend_types.h @@ -41,7 +41,7 @@ struct channel_iter { }; /* channel: collection of per-cpu ring buffers. */ -struct channel { +struct lttng_kernel_ring_buffer_channel { atomic_t record_disabled; unsigned long commit_count_mask; /* * Commit count mask, removing @@ -164,12 +164,12 @@ struct lib_ring_buffer { }; static inline -void *channel_get_private(struct channel *chan) +void *channel_get_private(struct lttng_kernel_ring_buffer_channel *chan) { return chan->backend.priv; } -void lib_ring_buffer_lost_event_too_big(struct channel *chan); +void lib_ring_buffer_lost_event_too_big(struct lttng_kernel_ring_buffer_channel *chan); /* * Issue warnings and disable channels upon internal error. @@ -178,14 +178,14 @@ void lib_ring_buffer_lost_event_too_big(struct channel *chan); */ #define CHAN_WARN_ON(c, cond) \ ({ \ - struct channel *__chan; \ + struct lttng_kernel_ring_buffer_channel *__chan; \ int _____ret = unlikely(cond); \ if (_____ret) { \ if (__same_type(*(c), struct channel_backend)) \ __chan = container_of((void *) (c), \ - struct channel, \ + struct lttng_kernel_ring_buffer_channel, \ backend); \ - else if (__same_type(*(c), struct channel)) \ + else if (__same_type(*(c), struct lttng_kernel_ring_buffer_channel)) \ __chan = (void *) (c); \ else \ BUG_ON(1); \ diff --git a/include/ringbuffer/iterator.h b/include/ringbuffer/iterator.h index a9879903..f5c5bcb5 100644 --- a/include/ringbuffer/iterator.h +++ b/include/ringbuffer/iterator.h @@ -20,7 +20,7 @@ * currently no data available, or -ENODATA if no data is available and buffer * is finalized. */ -extern ssize_t lib_ring_buffer_get_next_record(struct channel *chan, +extern ssize_t lib_ring_buffer_get_next_record(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf); /* @@ -39,7 +39,7 @@ extern void lib_ring_buffer_put_current_record(struct lib_ring_buffer *buf); * finalized. * Returns the current buffer in ret_buf. */ -extern ssize_t channel_get_next_record(struct channel *chan, +extern ssize_t channel_get_next_record(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer **ret_buf); /** @@ -58,8 +58,8 @@ static inline size_t read_current_record(struct lib_ring_buffer *buf, void *dest extern int lib_ring_buffer_iterator_open(struct lib_ring_buffer *buf); extern void lib_ring_buffer_iterator_release(struct lib_ring_buffer *buf); -extern int channel_iterator_open(struct channel *chan); -extern void channel_iterator_release(struct channel *chan); +extern int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan); +extern void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan); extern const struct file_operations channel_payload_file_operations; extern const struct file_operations lib_ring_buffer_payload_file_operations; @@ -67,10 +67,10 @@ extern const struct file_operations lib_ring_buffer_payload_file_operations; /* * Used internally. */ -int channel_iterator_init(struct channel *chan); -void channel_iterator_unregister_notifiers(struct channel *chan); -void channel_iterator_free(struct channel *chan); -void channel_iterator_reset(struct channel *chan); +int channel_iterator_init(struct lttng_kernel_ring_buffer_channel *chan); +void channel_iterator_unregister_notifiers(struct lttng_kernel_ring_buffer_channel *chan); +void channel_iterator_free(struct lttng_kernel_ring_buffer_channel *chan); +void channel_iterator_reset(struct lttng_kernel_ring_buffer_channel *chan); void lib_ring_buffer_iterator_reset(struct lib_ring_buffer *buf); #endif /* _LIB_RING_BUFFER_ITERATOR_H */ diff --git a/src/lib/ringbuffer/ring_buffer_backend.c b/src/lib/ringbuffer/ring_buffer_backend.c index cfd6649d..a5acbb6f 100644 --- a/src/lib/ringbuffer/ring_buffer_backend.c +++ b/src/lib/ringbuffer/ring_buffer_backend.c @@ -184,7 +184,7 @@ int lib_ring_buffer_backend_create(struct lib_ring_buffer_backend *bufb, { const struct lib_ring_buffer_config *config = &chanb->config; - bufb->chan = container_of(chanb, struct channel, backend); + bufb->chan = container_of(chanb, struct lttng_kernel_ring_buffer_channel, backend); bufb->cpu = cpu; return lib_ring_buffer_backend_allocate(config, bufb, chanb->buf_size, @@ -248,7 +248,7 @@ void lib_ring_buffer_backend_reset(struct lib_ring_buffer_backend *bufb) */ void channel_backend_reset(struct channel_backend *chanb) { - struct channel *chan = container_of(chanb, struct channel, backend); + struct lttng_kernel_ring_buffer_channel *chan = container_of(chanb, struct lttng_kernel_ring_buffer_channel, backend); const struct lib_ring_buffer_config *config = &chanb->config; /* @@ -366,7 +366,7 @@ int channel_backend_init(struct channel_backend *chanb, const struct lib_ring_buffer_config *config, void *priv, size_t subbuf_size, size_t num_subbuf) { - struct channel *chan = container_of(chanb, struct channel, backend); + struct lttng_kernel_ring_buffer_channel *chan = container_of(chanb, struct lttng_kernel_ring_buffer_channel, backend); unsigned int i; int ret; diff --git a/src/lib/ringbuffer/ring_buffer_frontend.c b/src/lib/ringbuffer/ring_buffer_frontend.c index cd8d0aaa..8d198357 100644 --- a/src/lib/ringbuffer/ring_buffer_frontend.c +++ b/src/lib/ringbuffer/ring_buffer_frontend.c @@ -79,7 +79,7 @@ DEFINE_PER_CPU(unsigned int, lib_ring_buffer_nesting); EXPORT_PER_CPU_SYMBOL(lib_ring_buffer_nesting); static -void lib_ring_buffer_print_errors(struct channel *chan, +void lib_ring_buffer_print_errors(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf, int cpu); static void _lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf, @@ -88,7 +88,7 @@ void _lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf, static int lib_ring_buffer_poll_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 consumed_old, consumed_idx, commit_count, write_offset; @@ -131,7 +131,7 @@ int lib_ring_buffer_poll_deliver(const struct lib_ring_buffer_config *config, */ void lib_ring_buffer_free(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; irq_work_sync(&buf->wakeup_pending); @@ -154,7 +154,7 @@ void lib_ring_buffer_free(struct lib_ring_buffer *buf) */ void lib_ring_buffer_reset(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned int i; @@ -193,7 +193,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_reset); * be using the iterator concurrently with reset. The previous current iterator * record is reset. */ -void channel_reset(struct channel *chan) +void channel_reset(struct lttng_kernel_ring_buffer_channel *chan) { /* * Reset iterators first. Will put the subbuffer if held for reading. @@ -217,7 +217,7 @@ static void lib_ring_buffer_pending_wakeup_buf(struct irq_work *entry) static void lib_ring_buffer_pending_wakeup_chan(struct irq_work *entry) { - struct channel *chan = container_of(entry, struct channel, wakeup_pending); + struct lttng_kernel_ring_buffer_channel *chan = container_of(entry, struct lttng_kernel_ring_buffer_channel, wakeup_pending); wake_up_interruptible(&chan->read_wait); } @@ -228,7 +228,7 @@ int lib_ring_buffer_create(struct lib_ring_buffer *buf, struct channel_backend *chanb, int cpu) { const struct lib_ring_buffer_config *config = &chanb->config; - struct channel *chan = container_of(chanb, struct channel, backend); + struct lttng_kernel_ring_buffer_channel *chan = container_of(chanb, struct lttng_kernel_ring_buffer_channel, backend); void *priv = chanb->priv; size_t subbuf_header_size; u64 tsc; @@ -334,7 +334,7 @@ free_chanbuf: static void switch_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) { struct lib_ring_buffer *buf = lttng_from_timer(buf, t, switch_timer); - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; /* @@ -356,7 +356,7 @@ static void switch_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) */ static void lib_ring_buffer_start_switch_timer(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned int flags = 0; @@ -382,7 +382,7 @@ static void lib_ring_buffer_start_switch_timer(struct lib_ring_buffer *buf) */ static void lib_ring_buffer_stop_switch_timer(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; if (!chan->switch_timer_interval || !buf->switch_timer_enabled) return; @@ -397,7 +397,7 @@ static void lib_ring_buffer_stop_switch_timer(struct lib_ring_buffer *buf) static void read_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) { struct lib_ring_buffer *buf = lttng_from_timer(buf, t, read_timer); - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; CHAN_WARN_ON(chan, !buf->backend.allocated); @@ -421,7 +421,7 @@ static void read_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) */ static void lib_ring_buffer_start_read_timer(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned int flags = 0; @@ -449,7 +449,7 @@ static void lib_ring_buffer_start_read_timer(struct lib_ring_buffer *buf) */ static void lib_ring_buffer_stop_read_timer(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; if (config->wakeup != RING_BUFFER_WAKEUP_BY_TIMER @@ -489,7 +489,7 @@ EXPORT_SYMBOL_GPL(lttng_rb_set_hp_online); int lttng_cpuhp_rb_frontend_dead(unsigned int cpu, struct lttng_cpuhp_node *node) { - struct channel *chan = container_of(node, struct channel, + struct lttng_kernel_ring_buffer_channel *chan = container_of(node, struct lttng_kernel_ring_buffer_channel, cpuhp_prepare); struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -510,7 +510,7 @@ EXPORT_SYMBOL_GPL(lttng_cpuhp_rb_frontend_dead); int lttng_cpuhp_rb_frontend_online(unsigned int cpu, struct lttng_cpuhp_node *node) { - struct channel *chan = container_of(node, struct channel, + struct lttng_kernel_ring_buffer_channel *chan = container_of(node, struct lttng_kernel_ring_buffer_channel, cpuhp_online); struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -527,7 +527,7 @@ EXPORT_SYMBOL_GPL(lttng_cpuhp_rb_frontend_online); int lttng_cpuhp_rb_frontend_offline(unsigned int cpu, struct lttng_cpuhp_node *node) { - struct channel *chan = container_of(node, struct channel, + struct lttng_kernel_ring_buffer_channel *chan = container_of(node, struct lttng_kernel_ring_buffer_channel, cpuhp_online); struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -558,7 +558,7 @@ int lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; - struct channel *chan = container_of(nb, struct channel, + struct lttng_kernel_ring_buffer_channel *chan = container_of(nb, struct lttng_kernel_ring_buffer_channel, cpu_hp_notifier); struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -617,7 +617,7 @@ static int notrace ring_buffer_tick_nohz_callback(struct notifier_block *nb, unsigned long val, void *data) { - struct channel *chan = container_of(nb, struct channel, + struct lttng_kernel_ring_buffer_channel *chan = container_of(nb, struct lttng_kernel_ring_buffer_channel, tick_nohz_notifier); const struct lib_ring_buffer_config *config = &chan->backend.config; struct lib_ring_buffer *buf; @@ -689,7 +689,7 @@ void notrace lib_ring_buffer_tick_nohz_restart(void) /* * Holds CPU hotplug. */ -static void channel_unregister_notifiers(struct channel *chan) +static void channel_unregister_notifiers(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -766,7 +766,7 @@ static void lib_ring_buffer_clear_quiescent(struct lib_ring_buffer *buf) buf->quiescent = false; } -void lib_ring_buffer_set_quiescent_channel(struct channel *chan) +void lib_ring_buffer_set_quiescent_channel(struct lttng_kernel_ring_buffer_channel *chan) { int cpu; const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -788,7 +788,7 @@ void lib_ring_buffer_set_quiescent_channel(struct channel *chan) } EXPORT_SYMBOL_GPL(lib_ring_buffer_set_quiescent_channel); -void lib_ring_buffer_clear_quiescent_channel(struct channel *chan) +void lib_ring_buffer_clear_quiescent_channel(struct lttng_kernel_ring_buffer_channel *chan) { int cpu; const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -810,7 +810,7 @@ void lib_ring_buffer_clear_quiescent_channel(struct channel *chan) } EXPORT_SYMBOL_GPL(lib_ring_buffer_clear_quiescent_channel); -static void channel_free(struct channel *chan) +static void channel_free(struct lttng_kernel_ring_buffer_channel *chan) { if (chan->backend.release_priv_ops) { chan->backend.release_priv_ops(chan->backend.priv_ops); @@ -838,20 +838,20 @@ static void channel_free(struct channel *chan) * Holds cpu hotplug. * Returns NULL on failure. */ -struct channel *channel_create(const struct lib_ring_buffer_config *config, +struct lttng_kernel_ring_buffer_channel *channel_create(const struct lib_ring_buffer_config *config, const char *name, void *priv, void *buf_addr, size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval) { int ret; - struct channel *chan; + struct lttng_kernel_ring_buffer_channel *chan; if (lib_ring_buffer_check_config(config, switch_timer_interval, read_timer_interval)) return NULL; - chan = kzalloc(sizeof(struct channel), GFP_KERNEL); + chan = kzalloc(sizeof(struct lttng_kernel_ring_buffer_channel), GFP_KERNEL); if (!chan) return NULL; @@ -959,7 +959,7 @@ EXPORT_SYMBOL_GPL(channel_create); static void channel_release(struct kref *kref) { - struct channel *chan = container_of(kref, struct channel, ref); + struct lttng_kernel_ring_buffer_channel *chan = container_of(kref, struct lttng_kernel_ring_buffer_channel, ref); channel_free(chan); } @@ -974,7 +974,7 @@ void channel_release(struct kref *kref) * They should release their handle at that point. Returns the private * data pointer. */ -void *channel_destroy(struct channel *chan) +void *channel_destroy(struct lttng_kernel_ring_buffer_channel *chan) { int cpu; const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -1027,7 +1027,7 @@ EXPORT_SYMBOL_GPL(channel_destroy); struct lib_ring_buffer *channel_get_ring_buffer( const struct lib_ring_buffer_config *config, - struct channel *chan, int cpu) + struct lttng_kernel_ring_buffer_channel *chan, int cpu) { if (config->alloc == RING_BUFFER_ALLOC_GLOBAL) return chan->backend.buf; @@ -1038,7 +1038,7 @@ EXPORT_SYMBOL_GPL(channel_get_ring_buffer); int lib_ring_buffer_open_read(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; if (!atomic_long_add_unless(&buf->active_readers, 1, 1)) return -EBUSY; @@ -1053,7 +1053,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_open_read); void lib_ring_buffer_release_read(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; CHAN_WARN_ON(chan, atomic_long_read(&buf->active_readers) != 1); lttng_smp_mb__before_atomic(); @@ -1087,7 +1087,7 @@ static void remote_mb(void *info) int lib_ring_buffer_snapshot(struct lib_ring_buffer *buf, unsigned long *consumed, unsigned long *produced) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned long consumed_cur, write_offset; int finalized; @@ -1150,7 +1150,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_snapshot); int lib_ring_buffer_snapshot_sample_positions(struct lib_ring_buffer *buf, unsigned long *consumed, unsigned long *produced) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; smp_rmb(); @@ -1178,7 +1178,7 @@ void lib_ring_buffer_move_consumer(struct lib_ring_buffer *buf, unsigned long consumed_new) { struct lib_ring_buffer_backend *bufb = &buf->backend; - struct channel *chan = bufb->chan; + struct lttng_kernel_ring_buffer_channel *chan = bufb->chan; unsigned long consumed; CHAN_WARN_ON(chan, atomic_long_read(&buf->active_readers) != 1); @@ -1200,7 +1200,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_move_consumer); #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE static void lib_ring_buffer_flush_read_subbuf_dcache( const struct lib_ring_buffer_config *config, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf) { struct lib_ring_buffer_backend_pages *pages; @@ -1232,7 +1232,7 @@ static void lib_ring_buffer_flush_read_subbuf_dcache( #else static void lib_ring_buffer_flush_read_subbuf_dcache( const struct lib_ring_buffer_config *config, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf) { } @@ -1250,7 +1250,7 @@ static void lib_ring_buffer_flush_read_subbuf_dcache( int lib_ring_buffer_get_subbuf(struct lib_ring_buffer *buf, unsigned long consumed) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned long consumed_cur, consumed_idx, commit_count, write_offset; int ret; @@ -1405,7 +1405,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_get_subbuf); void lib_ring_buffer_put_subbuf(struct lib_ring_buffer *buf) { struct lib_ring_buffer_backend *bufb = &buf->backend; - struct channel *chan = bufb->chan; + struct lttng_kernel_ring_buffer_channel *chan = bufb->chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned long read_sb_bindex, consumed_idx, consumed; @@ -1461,7 +1461,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_put_subbuf); */ static void lib_ring_buffer_print_subbuffer_errors(struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, unsigned long cons_offset, int cpu) { @@ -1488,7 +1488,7 @@ void lib_ring_buffer_print_subbuffer_errors(struct lib_ring_buffer *buf, static void lib_ring_buffer_print_buffer_errors(struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, void *priv, int cpu) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -1519,7 +1519,7 @@ void lib_ring_buffer_print_buffer_errors(struct lib_ring_buffer *buf, #ifdef LTTNG_RING_BUFFER_COUNT_EVENTS static -void lib_ring_buffer_print_records_count(struct channel *chan, +void lib_ring_buffer_print_records_count(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf, int cpu) { @@ -1541,7 +1541,7 @@ void lib_ring_buffer_print_records_count(struct channel *chan, } #else static -void lib_ring_buffer_print_records_count(struct channel *chan, +void lib_ring_buffer_print_records_count(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf, int cpu) { @@ -1549,7 +1549,7 @@ void lib_ring_buffer_print_records_count(struct channel *chan, #endif static -void lib_ring_buffer_print_errors(struct channel *chan, +void lib_ring_buffer_print_errors(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf, int cpu) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -1579,7 +1579,7 @@ void lib_ring_buffer_print_errors(struct channel *chan, */ static void lib_ring_buffer_switch_old_start(struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct switch_offsets *offsets, u64 tsc) { @@ -1624,7 +1624,7 @@ void lib_ring_buffer_switch_old_start(struct lib_ring_buffer *buf, */ static void lib_ring_buffer_switch_old_end(struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct switch_offsets *offsets, u64 tsc) { @@ -1681,7 +1681,7 @@ void lib_ring_buffer_switch_old_end(struct lib_ring_buffer *buf, */ static void lib_ring_buffer_switch_new_start(struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct switch_offsets *offsets, u64 tsc) { @@ -1726,7 +1726,7 @@ void lib_ring_buffer_switch_new_start(struct lib_ring_buffer *buf, */ static void lib_ring_buffer_switch_new_end(struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct switch_offsets *offsets, u64 tsc) { @@ -1757,7 +1757,7 @@ void lib_ring_buffer_switch_new_end(struct lib_ring_buffer *buf, static int lib_ring_buffer_try_switch_slow(enum switch_mode mode, struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct switch_offsets *offsets, u64 *tsc) { @@ -1864,7 +1864,7 @@ int lib_ring_buffer_try_switch_slow(enum switch_mode mode, */ void lib_ring_buffer_switch_slow(struct lib_ring_buffer *buf, enum switch_mode mode) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; struct switch_offsets offsets; unsigned long oldidx; @@ -1929,7 +1929,7 @@ static void remote_switch(void *info) static void _lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf, enum switch_mode mode) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; int ret; struct switch_param param; @@ -1979,7 +1979,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_switch_remote_empty); void lib_ring_buffer_clear(struct lib_ring_buffer *buf) { struct lib_ring_buffer_backend *bufb = &buf->backend; - struct channel *chan = bufb->chan; + struct lttng_kernel_ring_buffer_channel *chan = bufb->chan; lib_ring_buffer_switch_remote(buf); lib_ring_buffer_clear_reader(buf, chan); @@ -1995,7 +1995,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_clear); */ static int lib_ring_buffer_try_reserve_slow(struct lib_ring_buffer *buf, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct switch_offsets *offsets, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) @@ -2145,7 +2145,7 @@ retry: return 0; } -static struct lib_ring_buffer *get_current_buf(struct channel *chan, int cpu) +static struct lib_ring_buffer *get_current_buf(struct lttng_kernel_ring_buffer_channel *chan, int cpu) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -2155,7 +2155,7 @@ static struct lib_ring_buffer *get_current_buf(struct channel *chan, int cpu) return chan->backend.buf; } -void lib_ring_buffer_lost_event_too_big(struct channel *chan) +void lib_ring_buffer_lost_event_too_big(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; struct lib_ring_buffer *buf = get_current_buf(chan, smp_processor_id()); @@ -2175,7 +2175,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_lost_event_too_big); int lib_ring_buffer_reserve_slow(struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) { - struct channel *chan = ctx->priv.chan; + struct lttng_kernel_ring_buffer_channel *chan = ctx->priv.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; struct lib_ring_buffer *buf; struct switch_offsets offsets; @@ -2276,7 +2276,7 @@ void deliver_count_events(const struct lib_ring_buffer_config *config, 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, diff --git a/src/lib/ringbuffer/ring_buffer_iterator.c b/src/lib/ringbuffer/ring_buffer_iterator.c index 147450f8..53ce6b44 100644 --- a/src/lib/ringbuffer/ring_buffer_iterator.c +++ b/src/lib/ringbuffer/ring_buffer_iterator.c @@ -35,7 +35,7 @@ * Returns the size of the event read, -EAGAIN if buffer is empty, -ENODATA if * buffer is empty and finalized. The buffer must already be opened for reading. */ -ssize_t lib_ring_buffer_get_next_record(struct channel *chan, +ssize_t lib_ring_buffer_get_next_record(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -134,7 +134,7 @@ static int buf_is_higher(void *a, void *b) static void lib_ring_buffer_get_empty_buf_records(const struct lib_ring_buffer_config *config, - struct channel *chan) + struct lttng_kernel_ring_buffer_channel *chan) { struct lttng_ptr_heap *heap = &chan->iter.heap; struct lib_ring_buffer *buf, *tmp; @@ -178,7 +178,7 @@ void lib_ring_buffer_get_empty_buf_records(const struct lib_ring_buffer_config * static void lib_ring_buffer_wait_for_qs(const struct lib_ring_buffer_config *config, - struct channel *chan) + struct lttng_kernel_ring_buffer_channel *chan) { u64 timestamp_qs; unsigned long wait_msecs; @@ -238,7 +238,7 @@ void lib_ring_buffer_wait_for_qs(const struct lib_ring_buffer_config *config, * opened for reading. */ -ssize_t channel_get_next_record(struct channel *chan, +ssize_t channel_get_next_record(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer **ret_buf) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -337,7 +337,7 @@ ssize_t channel_get_next_record(struct channel *chan, EXPORT_SYMBOL_GPL(channel_get_next_record); static -void lib_ring_buffer_iterator_init(struct channel *chan, struct lib_ring_buffer *buf) +void lib_ring_buffer_iterator_init(struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf) { if (buf->iter.allocated) return; @@ -358,7 +358,7 @@ void lib_ring_buffer_iterator_init(struct channel *chan, struct lib_ring_buffer int lttng_cpuhp_rb_iter_online(unsigned int cpu, struct lttng_cpuhp_node *node) { - struct channel *chan = container_of(node, struct channel, + struct lttng_kernel_ring_buffer_channel *chan = container_of(node, struct lttng_kernel_ring_buffer_channel, cpuhp_iter_online); struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -379,7 +379,7 @@ int channel_iterator_cpu_hotplug(struct notifier_block *nb, void *hcpu) { unsigned int cpu = (unsigned long)hcpu; - struct channel *chan = container_of(nb, struct channel, + struct lttng_kernel_ring_buffer_channel *chan = container_of(nb, struct lttng_kernel_ring_buffer_channel, hp_iter_notifier); struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -404,7 +404,7 @@ int channel_iterator_cpu_hotplug(struct notifier_block *nb, #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */ -int channel_iterator_init(struct channel *chan) +int channel_iterator_init(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; struct lib_ring_buffer *buf; @@ -462,7 +462,7 @@ int channel_iterator_init(struct channel *chan) return 0; } -void channel_iterator_unregister_notifiers(struct channel *chan) +void channel_iterator_unregister_notifiers(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -482,7 +482,7 @@ void channel_iterator_unregister_notifiers(struct channel *chan) } } -void channel_iterator_free(struct channel *chan) +void channel_iterator_free(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -492,7 +492,7 @@ void channel_iterator_free(struct channel *chan) int lib_ring_buffer_iterator_open(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; CHAN_WARN_ON(chan, config->output != RING_BUFFER_ITERATOR); return lib_ring_buffer_open_read(buf); @@ -510,7 +510,7 @@ void lib_ring_buffer_iterator_release(struct lib_ring_buffer *buf) } EXPORT_SYMBOL_GPL(lib_ring_buffer_iterator_release); -int channel_iterator_open(struct channel *chan) +int channel_iterator_open(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; struct lib_ring_buffer *buf; @@ -543,7 +543,7 @@ error: } EXPORT_SYMBOL_GPL(channel_iterator_open); -void channel_iterator_release(struct channel *chan) +void channel_iterator_release(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; struct lib_ring_buffer *buf; @@ -569,7 +569,7 @@ EXPORT_SYMBOL_GPL(channel_iterator_release); void lib_ring_buffer_iterator_reset(struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; if (buf->iter.state != ITER_GET_SUBBUF) lib_ring_buffer_put_next_subbuf(buf); @@ -586,7 +586,7 @@ void lib_ring_buffer_iterator_reset(struct lib_ring_buffer *buf) /* Don't reset allocated and read_open */ } -void channel_iterator_reset(struct channel *chan) +void channel_iterator_reset(struct lttng_kernel_ring_buffer_channel *chan) { const struct lib_ring_buffer_config *config = &chan->backend.config; struct lib_ring_buffer *buf; @@ -615,7 +615,7 @@ ssize_t channel_ring_buffer_file_read(struct file *filp, char __user *user_buf, size_t count, loff_t *ppos, - struct channel *chan, + struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf, int fusionmerge) { @@ -744,7 +744,7 @@ ssize_t lib_ring_buffer_file_read(struct file *filp, { struct inode *inode = filp->lttng_f_dentry->d_inode; struct lib_ring_buffer *buf = inode->i_private; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; return channel_ring_buffer_file_read(filp, user_buf, count, ppos, chan, buf, 0); @@ -768,7 +768,7 @@ ssize_t channel_file_read(struct file *filp, loff_t *ppos) { struct inode *inode = filp->lttng_f_dentry->d_inode; - struct channel *chan = inode->i_private; + struct lttng_kernel_ring_buffer_channel *chan = inode->i_private; const struct lib_ring_buffer_config *config = &chan->backend.config; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) @@ -815,7 +815,7 @@ int lib_ring_buffer_file_release(struct inode *inode, struct file *file) static int channel_file_open(struct inode *inode, struct file *file) { - struct channel *chan = inode->i_private; + struct lttng_kernel_ring_buffer_channel *chan = inode->i_private; int ret; ret = channel_iterator_open(chan); @@ -836,7 +836,7 @@ release_iter: static int channel_file_release(struct inode *inode, struct file *file) { - struct channel *chan = inode->i_private; + struct lttng_kernel_ring_buffer_channel *chan = inode->i_private; channel_iterator_release(chan); return 0; diff --git a/src/lib/ringbuffer/ring_buffer_mmap.c b/src/lib/ringbuffer/ring_buffer_mmap.c index 67111933..c49e6135 100644 --- a/src/lib/ringbuffer/ring_buffer_mmap.c +++ b/src/lib/ringbuffer/ring_buffer_mmap.c @@ -27,7 +27,7 @@ static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fa #endif { struct lib_ring_buffer *buf = vma->vm_private_data; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; pgoff_t pgoff = vmf->pgoff; unsigned long *pfnp; @@ -96,7 +96,7 @@ static int lib_ring_buffer_mmap_buf(struct lib_ring_buffer *buf, struct vm_area_struct *vma) { unsigned long length = vma->vm_end - vma->vm_start; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned long mmap_buf_len; diff --git a/src/lib/ringbuffer/ring_buffer_splice.c b/src/lib/ringbuffer/ring_buffer_splice.c index b6580fa6..0ade7537 100644 --- a/src/lib/ringbuffer/ring_buffer_splice.c +++ b/src/lib/ringbuffer/ring_buffer_splice.c @@ -99,7 +99,7 @@ static int subbuf_splice_actor(struct file *in, unsigned int flags, struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; unsigned int poff, subbuf_pages, nr_pages; struct page *pages[PIPE_DEF_BUFFERS]; @@ -184,7 +184,7 @@ ssize_t lib_ring_buffer_splice_read(struct file *in, loff_t *ppos, unsigned int flags, struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; ssize_t spliced; int ret; diff --git a/src/lib/ringbuffer/ring_buffer_vfs.c b/src/lib/ringbuffer/ring_buffer_vfs.c index 9d81b33e..ef07f3fe 100644 --- a/src/lib/ringbuffer/ring_buffer_vfs.c +++ b/src/lib/ringbuffer/ring_buffer_vfs.c @@ -101,7 +101,7 @@ unsigned int lib_ring_buffer_poll(struct file *filp, poll_table *wait, struct lib_ring_buffer *buf) { unsigned int mask = 0; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; int finalized, disabled; @@ -170,7 +170,7 @@ unsigned int vfs_lib_ring_buffer_poll(struct file *filp, poll_table *wait) long lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, unsigned long arg, struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; if (lib_ring_buffer_channel_is_disabled(chan)) @@ -308,7 +308,7 @@ long vfs_lib_ring_buffer_ioctl(struct file *filp, unsigned int cmd, unsigned lon long lib_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg, struct lib_ring_buffer *buf) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; if (lib_ring_buffer_channel_is_disabled(chan)) diff --git a/src/lttng-abi.c b/src/lttng-abi.c index a78f2e33..974aaff0 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -999,7 +999,7 @@ ssize_t lttng_event_notifier_group_notif_read(struct file *filp, char __user *us size_t count, loff_t *ppos) { struct lttng_event_notifier_group *event_notifier_group = filp->private_data; - struct channel *chan = event_notifier_group->chan; + struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan; struct lib_ring_buffer *buf = event_notifier_group->buf; ssize_t read_count = 0, len; size_t read_offset; @@ -1105,7 +1105,7 @@ unsigned int lttng_event_notifier_group_notif_poll(struct file *filp, { unsigned int mask = 0; struct lttng_event_notifier_group *event_notifier_group = filp->private_data; - struct channel *chan = event_notifier_group->chan; + struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan; struct lib_ring_buffer *buf = event_notifier_group->buf; const struct lib_ring_buffer_config *config = &chan->backend.config; int finalized, disabled; @@ -1315,7 +1315,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; ret = lttng_metadata_output_channel(stream, chan, NULL); if (ret > 0) { @@ -1337,7 +1337,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; /* * Before doing the actual ring buffer flush, write up to one @@ -1364,7 +1364,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; ret = lttng_metadata_output_channel(stream, chan, &coherent); if (ret > 0) { @@ -1424,7 +1424,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; ret = lttng_metadata_output_channel(stream, chan, NULL); if (ret > 0) { @@ -1446,7 +1446,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; /* * Before doing the actual ring buffer flush, write up to one @@ -1473,7 +1473,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, { struct lttng_metadata_stream *stream = filp->private_data; struct lib_ring_buffer *buf = stream->priv; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; ret = lttng_metadata_output_channel(stream, chan, &coherent); if (ret > 0) { @@ -1720,7 +1720,7 @@ static int lttng_abi_open_event_notifier_group_stream(struct file *notif_file) { struct lttng_event_notifier_group *event_notifier_group = notif_file->private_data; - struct channel *chan = event_notifier_group->chan; + struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan; struct lib_ring_buffer *buf; int ret; void *stream_priv; @@ -2742,7 +2742,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct lib_ring_buffer *buf = filp->private_data; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops; int ret; @@ -2846,7 +2846,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct lib_ring_buffer *buf = filp->private_data; - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops; int ret; diff --git a/src/lttng-events.c b/src/lttng-events.c index 999080bc..8d2bf469 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -2880,7 +2880,7 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group * was written and a negative value on error. */ int lttng_metadata_output_channel(struct lttng_metadata_stream *stream, - struct channel *chan, bool *coherent) + struct lttng_kernel_ring_buffer_channel *chan, bool *coherent) { struct lttng_kernel_ring_buffer_ctx ctx; int ret = 0; diff --git a/src/lttng-ring-buffer-client.h b/src/lttng-ring-buffer-client.h index e8f94e24..70eb555e 100644 --- a/src/lttng-ring-buffer-client.h +++ b/src/lttng-ring-buffer-client.h @@ -69,7 +69,7 @@ struct lttng_client_ctx { size_t event_context_len; }; -static inline notrace u64 lib_ring_buffer_clock_read(struct channel *chan) +static inline notrace u64 lib_ring_buffer_clock_read(struct lttng_kernel_ring_buffer_channel *chan) { return trace_clock_read64(); } @@ -136,7 +136,7 @@ void ctx_record(struct lttng_kernel_ring_buffer_ctx *bufctx, */ static __inline__ size_t record_header_size(const struct lib_ring_buffer_config *config, - struct channel *chan, size_t offset, + struct lttng_kernel_ring_buffer_channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_kernel_ring_buffer_ctx *ctx, struct lttng_client_ctx *client_ctx) @@ -318,14 +318,14 @@ void lttng_write_event_header_slow(const struct lib_ring_buffer_config *config, static const struct lib_ring_buffer_config client_config; -static u64 client_ring_buffer_clock_read(struct channel *chan) +static u64 client_ring_buffer_clock_read(struct lttng_kernel_ring_buffer_channel *chan) { return lib_ring_buffer_clock_read(chan); } static size_t client_record_header_size(const struct lib_ring_buffer_config *config, - struct channel *chan, size_t offset, + struct lttng_kernel_ring_buffer_channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) @@ -349,7 +349,7 @@ static size_t client_packet_header_size(void) static void client_buffer_begin(struct lib_ring_buffer *buf, u64 tsc, unsigned int subbuf_idx) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; struct packet_header *header = (struct packet_header *) lib_ring_buffer_offset_address(&buf->backend, @@ -379,7 +379,7 @@ static void client_buffer_begin(struct lib_ring_buffer *buf, u64 tsc, static void client_buffer_end(struct lib_ring_buffer *buf, u64 tsc, unsigned int subbuf_idx, unsigned long data_size) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; struct packet_header *header = (struct packet_header *) lib_ring_buffer_offset_address(&buf->backend, @@ -468,7 +468,7 @@ static int client_stream_id(const struct lib_ring_buffer_config *config, struct lib_ring_buffer *buf, uint64_t *stream_id) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; struct lttng_kernel_channel_buffer *lttng_chan = channel_get_private(chan); *stream_id = lttng_chan->priv->id; @@ -532,20 +532,20 @@ void release_priv_ops(void *priv_ops) } static -void lttng_channel_destroy(struct channel *chan) +void lttng_channel_destroy(struct lttng_kernel_ring_buffer_channel *chan) { channel_destroy(chan); } static -struct channel *_channel_create(const char *name, +struct lttng_kernel_ring_buffer_channel *_channel_create(const char *name, void *priv, void *buf_addr, size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval) { struct lttng_kernel_channel_buffer *lttng_chan = priv; - struct channel *chan; + struct lttng_kernel_ring_buffer_channel *chan; chan = channel_create(&client_config, name, lttng_chan, buf_addr, subbuf_size, num_subbuf, switch_timer_interval, @@ -570,7 +570,7 @@ error: } static -struct lib_ring_buffer *lttng_buffer_read_open(struct channel *chan) +struct lib_ring_buffer *lttng_buffer_read_open(struct lttng_kernel_ring_buffer_channel *chan) { struct lib_ring_buffer *buf; int cpu; @@ -584,7 +584,7 @@ struct lib_ring_buffer *lttng_buffer_read_open(struct channel *chan) } static -int lttng_buffer_has_read_closed_stream(struct channel *chan) +int lttng_buffer_has_read_closed_stream(struct lttng_kernel_ring_buffer_channel *chan) { struct lib_ring_buffer *buf; int cpu; @@ -698,7 +698,7 @@ void lttng_channel_buffer_lost_event_too_big(struct lttng_kernel_channel_buffer } static -wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct channel *chan, int cpu) +wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct lttng_kernel_ring_buffer_channel *chan, int cpu) { struct lib_ring_buffer *buf = channel_get_ring_buffer(&client_config, chan, cpu); @@ -706,19 +706,19 @@ wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct channel *chan, int cpu } static -wait_queue_head_t *lttng_get_hp_wait_queue(struct channel *chan) +wait_queue_head_t *lttng_get_hp_wait_queue(struct lttng_kernel_ring_buffer_channel *chan) { return &chan->hp_wait; } static -int lttng_is_finalized(struct channel *chan) +int lttng_is_finalized(struct lttng_kernel_ring_buffer_channel *chan) { return lib_ring_buffer_channel_is_finalized(chan); } static -int lttng_is_disabled(struct channel *chan) +int lttng_is_disabled(struct lttng_kernel_ring_buffer_channel *chan) { return lib_ring_buffer_channel_is_disabled(chan); } diff --git a/src/lttng-ring-buffer-event-notifier-client.h b/src/lttng-ring-buffer-event-notifier-client.h index 9f438258..be083350 100644 --- a/src/lttng-ring-buffer-event-notifier-client.h +++ b/src/lttng-ring-buffer-event-notifier-client.h @@ -31,14 +31,14 @@ struct event_notifier_record_header { static const struct lib_ring_buffer_config client_config; static inline -u64 lib_ring_buffer_clock_read(struct channel *chan) +u64 lib_ring_buffer_clock_read(struct lttng_kernel_ring_buffer_channel *chan) { return 0; } static inline size_t record_header_size(const struct lib_ring_buffer_config *config, - struct channel *chan, size_t offset, + struct lttng_kernel_ring_buffer_channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) @@ -58,14 +58,14 @@ size_t record_header_size(const struct lib_ring_buffer_config *config, #include -static u64 client_ring_buffer_clock_read(struct channel *chan) +static u64 client_ring_buffer_clock_read(struct lttng_kernel_ring_buffer_channel *chan) { return 0; } static size_t client_record_header_size(const struct lib_ring_buffer_config *config, - struct channel *chan, size_t offset, + struct lttng_kernel_ring_buffer_channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) @@ -174,7 +174,7 @@ int client_instance_id(const struct lib_ring_buffer_config *config, } static void client_record_get(const struct lib_ring_buffer_config *config, - struct channel *chan, struct lib_ring_buffer *buf, + struct lttng_kernel_ring_buffer_channel *chan, struct lib_ring_buffer *buf, size_t offset, size_t *header_len, size_t *payload_len, u64 *timestamp) { @@ -217,20 +217,20 @@ void release_priv_ops(void *priv_ops) } static -void lttng_channel_destroy(struct channel *chan) +void lttng_channel_destroy(struct lttng_kernel_ring_buffer_channel *chan) { channel_destroy(chan); } static -struct channel *_channel_create(const char *name, +struct lttng_kernel_ring_buffer_channel *_channel_create(const char *name, void *priv, void *buf_addr, size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval) { struct lttng_event_notifier_group *event_notifier_group = priv; - struct channel *chan; + struct lttng_kernel_ring_buffer_channel *chan; chan = channel_create(&client_config, name, event_notifier_group, buf_addr, @@ -256,7 +256,7 @@ error: } static -struct lib_ring_buffer *lttng_buffer_read_open(struct channel *chan) +struct lib_ring_buffer *lttng_buffer_read_open(struct lttng_kernel_ring_buffer_channel *chan) { struct lib_ring_buffer *buf; @@ -267,7 +267,7 @@ struct lib_ring_buffer *lttng_buffer_read_open(struct channel *chan) } static -int lttng_buffer_has_read_closed_stream(struct channel *chan) +int lttng_buffer_has_read_closed_stream(struct lttng_kernel_ring_buffer_channel *chan) { struct lib_ring_buffer *buf; int cpu; @@ -304,7 +304,7 @@ void lttng_write_event_notifier_header(const struct lib_ring_buffer_config *conf static int lttng_event_reserve(struct lttng_kernel_ring_buffer_ctx *ctx) { - struct channel *chan = ctx->client_priv; + struct lttng_kernel_ring_buffer_channel *chan = ctx->client_priv; int ret; memset(&ctx->priv, 0, sizeof(ctx->priv)); @@ -355,7 +355,7 @@ void lttng_event_strcpy(struct lttng_kernel_ring_buffer_ctx *ctx, const char *sr } static -size_t lttng_packet_avail_size(struct channel *chan) +size_t lttng_packet_avail_size(struct lttng_kernel_ring_buffer_channel *chan) { unsigned long o_begin; struct lib_ring_buffer *buf; @@ -371,7 +371,7 @@ size_t lttng_packet_avail_size(struct channel *chan) } static -wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct channel *chan, int cpu) +wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct lttng_kernel_ring_buffer_channel *chan, int cpu) { struct lib_ring_buffer *buf = channel_get_ring_buffer(&client_config, chan, cpu); @@ -379,19 +379,19 @@ wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct channel *chan, int cpu } static -wait_queue_head_t *lttng_get_hp_wait_queue(struct channel *chan) +wait_queue_head_t *lttng_get_hp_wait_queue(struct lttng_kernel_ring_buffer_channel *chan) { return &chan->hp_wait; } static -int lttng_is_finalized(struct channel *chan) +int lttng_is_finalized(struct lttng_kernel_ring_buffer_channel *chan) { return lib_ring_buffer_channel_is_finalized(chan); } static -int lttng_is_disabled(struct channel *chan) +int lttng_is_disabled(struct lttng_kernel_ring_buffer_channel *chan) { return lib_ring_buffer_channel_is_disabled(chan); } diff --git a/src/lttng-ring-buffer-metadata-client.h b/src/lttng-ring-buffer-metadata-client.h index bd6fb200..1558d616 100644 --- a/src/lttng-ring-buffer-metadata-client.h +++ b/src/lttng-ring-buffer-metadata-client.h @@ -37,14 +37,14 @@ struct metadata_record_header { static const struct lib_ring_buffer_config client_config; static inline -u64 lib_ring_buffer_clock_read(struct channel *chan) +u64 lib_ring_buffer_clock_read(struct lttng_kernel_ring_buffer_channel *chan) { return 0; } static inline size_t record_header_size(const struct lib_ring_buffer_config *config, - struct channel *chan, size_t offset, + struct lttng_kernel_ring_buffer_channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) @@ -54,14 +54,14 @@ size_t record_header_size(const struct lib_ring_buffer_config *config, #include -static u64 client_ring_buffer_clock_read(struct channel *chan) +static u64 client_ring_buffer_clock_read(struct lttng_kernel_ring_buffer_channel *chan) { return 0; } static size_t client_record_header_size(const struct lib_ring_buffer_config *config, - struct channel *chan, size_t offset, + struct lttng_kernel_ring_buffer_channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_kernel_ring_buffer_ctx *ctx, void *client_ctx) @@ -84,7 +84,7 @@ static size_t client_packet_header_size(void) static void client_buffer_begin(struct lib_ring_buffer *buf, u64 tsc, unsigned int subbuf_idx) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; struct metadata_packet_header *header = (struct metadata_packet_header *) lib_ring_buffer_offset_address(&buf->backend, @@ -112,7 +112,7 @@ static void client_buffer_begin(struct lib_ring_buffer *buf, u64 tsc, static void client_buffer_end(struct lib_ring_buffer *buf, u64 tsc, unsigned int subbuf_idx, unsigned long data_size) { - struct channel *chan = buf->backend.chan; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; struct metadata_packet_header *header = (struct metadata_packet_header *) lib_ring_buffer_offset_address(&buf->backend, @@ -231,20 +231,20 @@ void release_priv_ops(void *priv_ops) } static -void lttng_channel_destroy(struct channel *chan) +void lttng_channel_destroy(struct lttng_kernel_ring_buffer_channel *chan) { channel_destroy(chan); } static -struct channel *_channel_create(const char *name, +struct lttng_kernel_ring_buffer_channel *_channel_create(const char *name, void *priv, void *buf_addr, size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval) { struct lttng_kernel_channel_buffer *lttng_chan = priv; - struct channel *chan; + struct lttng_kernel_ring_buffer_channel *chan; chan = channel_create(&client_config, name, lttng_chan->parent.session->priv->metadata_cache, buf_addr, @@ -270,7 +270,7 @@ error: } static -struct lib_ring_buffer *lttng_buffer_read_open(struct channel *chan) +struct lib_ring_buffer *lttng_buffer_read_open(struct lttng_kernel_ring_buffer_channel *chan) { struct lib_ring_buffer *buf; @@ -281,7 +281,7 @@ struct lib_ring_buffer *lttng_buffer_read_open(struct channel *chan) } static -int lttng_buffer_has_read_closed_stream(struct channel *chan) +int lttng_buffer_has_read_closed_stream(struct lttng_kernel_ring_buffer_channel *chan) { struct lib_ring_buffer *buf; int cpu; @@ -303,7 +303,7 @@ void lttng_buffer_read_close(struct lib_ring_buffer *buf) static int lttng_event_reserve(struct lttng_kernel_ring_buffer_ctx *ctx) { - struct channel *chan = ctx->client_priv; + struct lttng_kernel_ring_buffer_channel *chan = ctx->client_priv; int ret; memset(&ctx->priv, 0, sizeof(ctx->priv)); @@ -353,7 +353,7 @@ void lttng_event_strcpy(struct lttng_kernel_ring_buffer_ctx *ctx, const char *sr } static -size_t lttng_packet_avail_size(struct channel *chan) +size_t lttng_packet_avail_size(struct lttng_kernel_ring_buffer_channel *chan) { unsigned long o_begin; struct lib_ring_buffer *buf; @@ -369,7 +369,7 @@ size_t lttng_packet_avail_size(struct channel *chan) } static -wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct channel *chan, int cpu) +wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct lttng_kernel_ring_buffer_channel *chan, int cpu) { struct lib_ring_buffer *buf = channel_get_ring_buffer(&client_config, chan, cpu); @@ -377,19 +377,19 @@ wait_queue_head_t *lttng_get_writer_buf_wait_queue(struct channel *chan, int cpu } static -wait_queue_head_t *lttng_get_hp_wait_queue(struct channel *chan) +wait_queue_head_t *lttng_get_hp_wait_queue(struct lttng_kernel_ring_buffer_channel *chan) { return &chan->hp_wait; } static -int lttng_is_finalized(struct channel *chan) +int lttng_is_finalized(struct lttng_kernel_ring_buffer_channel *chan) { return lib_ring_buffer_channel_is_finalized(chan); } static -int lttng_is_disabled(struct channel *chan) +int lttng_is_disabled(struct lttng_kernel_ring_buffer_channel *chan) { return lib_ring_buffer_channel_is_disabled(chan); }