X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Fbackend_internal.h;h=a325875cbd98eafdddad0f9d453fbaeed40bcb40;hb=6ba6fd60507f8e045bdc4f1be14e9d99c6a15f7f;hp=766fde2d30d851d79bcd05770be5b8786c991807;hpb=0466ac28c41336fd6d373cc8b0b26ef132225b9f;p=lttng-ust.git diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index 766fde2d..a325875c 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -24,48 +24,48 @@ /* Ring buffer and channel backend create/free */ -__attribute__((visibility("hidden"))) int lib_ring_buffer_backend_create(struct lttng_ust_lib_ring_buffer_backend *bufb, struct channel_backend *chan, int cpu, struct lttng_ust_shm_handle *handle, - struct shm_object *shmobj); + struct shm_object *shmobj) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) -void channel_backend_unregister_notifiers(struct channel_backend *chanb); +void channel_backend_unregister_notifiers(struct channel_backend *chanb) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) -void lib_ring_buffer_backend_free(struct lttng_ust_lib_ring_buffer_backend *bufb); +void lib_ring_buffer_backend_free(struct lttng_ust_lib_ring_buffer_backend *bufb) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) int channel_backend_init(struct channel_backend *chanb, const char *name, const struct lttng_ust_lib_ring_buffer_config *config, size_t subbuf_size, size_t num_subbuf, struct lttng_ust_shm_handle *handle, - const int *stream_fds); + const int *stream_fds) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) void channel_backend_free(struct channel_backend *chanb, - struct lttng_ust_shm_handle *handle); + struct lttng_ust_shm_handle *handle) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) void lib_ring_buffer_backend_reset(struct lttng_ust_lib_ring_buffer_backend *bufb, - struct lttng_ust_shm_handle *handle); + struct lttng_ust_shm_handle *handle) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) -void channel_backend_reset(struct channel_backend *chanb); +void channel_backend_reset(struct channel_backend *chanb) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) -int lib_ring_buffer_backend_init(void); +int lib_ring_buffer_backend_init(void) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) -void lib_ring_buffer_backend_exit(void); +void lib_ring_buffer_backend_exit(void) + __attribute__((visibility("hidden"))); -__attribute__((visibility("hidden"))) extern void _lib_ring_buffer_write(struct lttng_ust_lib_ring_buffer_backend *bufb, size_t offset, const void *src, size_t len, - ssize_t pagecpy); + ssize_t pagecpy) + __attribute__((visibility("hidden"))); /* * Subbuffer ID bits for overwrite mode. Need to fit within a single word to be @@ -122,8 +122,9 @@ unsigned long subbuffer_id(const struct lttng_ust_lib_ring_buffer_config *config * bits are identical, else 0. */ static inline -int subbuffer_id_compare_offset(const struct lttng_ust_lib_ring_buffer_config *config, - unsigned long id, unsigned long offset) +int subbuffer_id_compare_offset( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + unsigned long id, unsigned long offset) { return (id & SB_ID_OFFSET_MASK) == (offset << SB_ID_OFFSET_SHIFT); } @@ -207,11 +208,12 @@ int lib_ring_buffer_backend_get_pages(const struct lttng_ust_lib_ring_buffer_con struct lttng_ust_lib_ring_buffer_ctx *ctx, struct lttng_ust_lib_ring_buffer_backend_pages **backend_pages) { - struct lttng_ust_lib_ring_buffer_backend *bufb = &ctx->buf->backend; - struct channel_backend *chanb = &ctx->chan->backend; - struct lttng_ust_shm_handle *handle = ctx->handle; + struct lttng_ust_lib_ring_buffer_ctx_private *ctx_private = ctx->priv; + struct lttng_ust_lib_ring_buffer_backend *bufb = &ctx_private->buf->backend; + struct channel_backend *chanb = &ctx_private->chan->backend; + struct lttng_ust_shm_handle *handle = ctx_private->chan->handle; size_t sbidx; - size_t offset = ctx->buf_offset; + size_t offset = ctx_private->buf_offset; struct lttng_ust_lib_ring_buffer_backend_subbuffer *wsb; struct lttng_ust_lib_ring_buffer_backend_pages_shmp *rpages; unsigned long sb_bindex, id; @@ -227,7 +229,7 @@ int lib_ring_buffer_backend_get_pages(const struct lttng_ust_lib_ring_buffer_con rpages = shmp_index(handle, bufb->array, sb_bindex); if (caa_unlikely(!rpages)) return -1; - CHAN_WARN_ON(ctx->chan, + CHAN_WARN_ON(ctx_private->chan, config->mode == RING_BUFFER_OVERWRITE && subbuffer_id_is_noref(config, id)); _backend_pages = shmp(handle, rpages->shmp); @@ -240,10 +242,11 @@ int lib_ring_buffer_backend_get_pages(const struct lttng_ust_lib_ring_buffer_con /* Get backend pages from cache. */ static inline struct lttng_ust_lib_ring_buffer_backend_pages * - lib_ring_buffer_get_backend_pages_from_ctx(const struct lttng_ust_lib_ring_buffer_config *config, + lib_ring_buffer_get_backend_pages_from_ctx( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), struct lttng_ust_lib_ring_buffer_ctx *ctx) { - return ctx->backend_pages; + return ctx->priv->backend_pages; } /* @@ -268,10 +271,11 @@ void subbuffer_count_record(const struct lttng_ust_lib_ring_buffer_config *confi } #else /* LTTNG_RING_BUFFER_COUNT_EVENTS */ static inline -void subbuffer_count_record(const struct lttng_ust_lib_ring_buffer_config *config, - const struct lttng_ust_lib_ring_buffer_ctx *ctx, - struct lttng_ust_lib_ring_buffer_backend *bufb, - unsigned long idx, struct lttng_ust_shm_handle *handle) +void subbuffer_count_record(const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), + const struct lttng_ust_lib_ring_buffer_ctx *ctx __attribute__((unused)), + struct lttng_ust_lib_ring_buffer_backend *bufb __attribute__((unused)), + unsigned long idx __attribute__((unused)), + struct lttng_ust_shm_handle *handle __attribute__((unused))) { } #endif /* #else LTTNG_RING_BUFFER_COUNT_EVENTS */ @@ -439,7 +443,8 @@ unsigned long subbuffer_get_data_size( } static inline -void subbuffer_inc_packet_count(const struct lttng_ust_lib_ring_buffer_config *config, +void subbuffer_inc_packet_count( + const struct lttng_ust_lib_ring_buffer_config *config __attribute__((unused)), struct lttng_ust_lib_ring_buffer_backend *bufb, unsigned long idx, struct lttng_ust_shm_handle *handle) { @@ -543,7 +548,7 @@ void lib_ring_buffer_set_noref_offset(const struct lttng_ust_lib_ring_buffer_con static inline int update_read_sb_index(const struct lttng_ust_lib_ring_buffer_config *config, struct lttng_ust_lib_ring_buffer_backend *bufb, - struct channel_backend *chanb, + struct channel_backend *chanb __attribute__((unused)), unsigned long consumed_idx, unsigned long consumed_count, struct lttng_ust_shm_handle *handle) @@ -595,7 +600,11 @@ int update_read_sb_index(const struct lttng_ust_lib_ring_buffer_config *config, #define inline_memcpy(dest, src, n) memcpy(dest, src, n) #endif -static inline __attribute__((always_inline)) +static inline +void lttng_inline_memcpy(void *dest, const void *src, + unsigned long len) + __attribute__((always_inline)); +static inline void lttng_inline_memcpy(void *dest, const void *src, unsigned long len) { @@ -635,7 +644,7 @@ do { \ * write len bytes to dest with c */ static inline -void lib_ring_buffer_do_memset(char *dest, int c, unsigned long len) +void lib_ring_buffer_do_memset(char *dest, char c, unsigned long len) { unsigned long i;