X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=blobdiff_plain;f=lib%2Fringbuffer%2Fconfig.h;h=dd53c4be9a97772f99eca39b2c382874a0aa0bcc;hp=5a9f8962070e49af5884bdb2e0478e9f5bdc07ba;hb=5b4ea313ddc10d96388a20a42e118c758479a553;hpb=f3bc08c50e1b302bceea699027d889fd6d9af525 diff --git a/lib/ringbuffer/config.h b/lib/ringbuffer/config.h index 5a9f8962..dd53c4be 100644 --- a/lib/ringbuffer/config.h +++ b/lib/ringbuffer/config.h @@ -1,19 +1,20 @@ -#ifndef _LINUX_RING_BUFFER_CONFIG_H -#define _LINUX_RING_BUFFER_CONFIG_H - -/* - * linux/ringbuffer/config.h +/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only) * - * Copyright (C) 2010 - Mathieu Desnoyers + * lib/ringbuffer/config.h * * Ring buffer configuration header. Note: after declaring the standard inline * functions, clients should also include linux/ringbuffer/api.h. * - * Dual LGPL v2.1/GPL v2 license. + * Copyright (C) 2010-2012 Mathieu Desnoyers */ +#ifndef _LIB_RING_BUFFER_CONFIG_H +#define _LIB_RING_BUFFER_CONFIG_H + #include #include +#include +#include struct lib_ring_buffer; struct channel; @@ -33,10 +34,9 @@ struct lib_ring_buffer_client_cb { u64 (*ring_buffer_clock_read) (struct channel *chan); size_t (*record_header_size) (const struct lib_ring_buffer_config *config, struct channel *chan, size_t offset, - size_t data_size, size_t *pre_header_padding, - unsigned int rflags, - struct lib_ring_buffer_ctx *ctx); + struct lib_ring_buffer_ctx *ctx, + void *client_ctx); /* Slow path only, at subbuffer switch */ size_t (*subbuffer_header_size) (void); @@ -94,7 +94,7 @@ struct lib_ring_buffer_client_cb { * * wakeup: * - * RING_BUFFER_WAKEUP_BY_TIMER uses per-cpu deferrable timers to poll the + * RING_BUFFER_WAKEUP_BY_TIMER uses per-cpu timers to poll the * buffers and wake up readers if data is ready. Mainly useful for tracers which * don't want to call into the wakeup code on the tracing path. Use in * combination with "read_timer_interval" channel_create() argument. @@ -188,6 +188,8 @@ struct lib_ring_buffer_ctx { */ u64 tsc; /* time-stamp counter value */ unsigned int rflags; /* reservation flags */ + /* Cache backend pages pointer chasing. */ + struct lib_ring_buffer_backend_pages *backend_pages; }; /** @@ -195,7 +197,7 @@ struct lib_ring_buffer_ctx { * @ctx: ring buffer context to initialize * @chan: channel * @priv: client private data - * @data_size: size of record data payload + * @data_size: size of record data payload. It must be greater than 0. * @largest_align: largest alignment within data payload types * @cpu: processor id */ @@ -210,6 +212,8 @@ void lib_ring_buffer_ctx_init(struct lib_ring_buffer_ctx *ctx, ctx->data_size = data_size; ctx->largest_align = largest_align; ctx->cpu = cpu; + ctx->rflags = 0; + ctx->backend_pages = NULL; } /* @@ -229,6 +233,10 @@ void lib_ring_buffer_ctx_init(struct lib_ring_buffer_ctx *ctx, #define RING_BUFFER_RFLAG_FULL_TSC (1U << 0) #define RING_BUFFER_RFLAG_END (1U << 1) +#ifndef LTTNG_TRACER_CORE_H +#error "lttng-tracer-core.h is needed for RING_BUFFER_ALIGN define" +#endif + /* * We need to define RING_BUFFER_ALIGN_ATTR so it is known early at * compile-time. We have to duplicate the "config->align" information and the @@ -293,6 +301,6 @@ int lib_ring_buffer_check_config(const struct lib_ring_buffer_config *config, return 0; } -#include "../../wrapper/ringbuffer/vatomic.h" +#include -#endif /* _LINUX_RING_BUFFER_CONFIG_H */ +#endif /* _LIB_RING_BUFFER_CONFIG_H */