X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=inline;f=include%2Flttng%2Fringbuffer-config.h;h=f668e949ea982ea2cf76bb0bf4966ba29420ba7b;hb=fa194c4157f029404fe2ea10098d1bbcebcf6aa9;hp=8752e36993403ace30ba7c0efaaacd763dc32f68;hpb=b72687b85f4f07a9b63be329ad1fe95b36d24900;p=lttng-ust.git diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h index 8752e369..f668e949 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -1,33 +1,15 @@ -#ifndef _LTTNG_RING_BUFFER_CONFIG_H -#define _LTTNG_RING_BUFFER_CONFIG_H - /* - * lttng/ringbuffer-config.h + * SPDX-License-Identifier: MIT * - * Copyright (C) 2010 - Mathieu Desnoyers + * Copyright (C) 2010 Mathieu Desnoyers * * Ring buffer configuration header. Note: after declaring the standard inline * functions, clients should also include linux/ringbuffer/api.h. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. */ +#ifndef _LTTNG_RING_BUFFER_CONFIG_H +#define _LTTNG_RING_BUFFER_CONFIG_H + #include #include "lttng/ust-tracer.h" #include @@ -228,9 +210,10 @@ struct lttng_ust_lib_ring_buffer_config { * UST. Fields need to be only added at the end, never reordered, never * removed. */ -#define LTTNG_UST_RING_BUFFER_CTX_PADDING \ - (24 - sizeof(int) - sizeof(void *) - sizeof(void *)) +#define LTTNG_UST_RING_BUFFER_CTX_PADDING 64 struct lttng_ust_lib_ring_buffer_ctx { + uint32_t struct_size; /* Size of this structure. */ + /* input received by lib_ring_buffer_reserve(), saved here. */ struct channel *chan; /* channel */ void *priv; /* client private data */ @@ -257,21 +240,7 @@ struct lttng_ust_lib_ring_buffer_ctx { */ uint64_t tsc; /* time-stamp counter value */ unsigned int rflags; /* reservation flags */ - /* - * The field ctx_len is the length of struct - * lttng_ust_lib_ring_buffer_ctx as known by the user of - * lib_ring_buffer_ctx_init. - */ - unsigned int ctx_len; void *ip; /* caller ip address */ - void *priv2; /* 2nd priv data */ - char padding2[LTTNG_UST_RING_BUFFER_CTX_PADDING]; - /* - * This is the end of the initial fields expected by the original ABI - * between probes and UST. Only the fields above can be used if - * ctx_len is 0. Use the value of ctx_len to find out which of the - * following fields may be used. - */ struct lttng_ust_lib_ring_buffer_backend_pages *backend_pages; }; @@ -288,15 +257,14 @@ static inline lttng_ust_notrace void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, struct channel *chan, void *priv, size_t data_size, int largest_align, - int cpu, struct lttng_ust_shm_handle *handle, - void *priv2); + int cpu, struct lttng_ust_shm_handle *handle); static inline void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, struct channel *chan, void *priv, size_t data_size, int largest_align, - int cpu, struct lttng_ust_shm_handle *handle, - void *priv2) + int cpu, struct lttng_ust_shm_handle *handle) { + ctx->struct_size = sizeof(struct lttng_ust_lib_ring_buffer_ctx); ctx->chan = chan; ctx->priv = priv; ctx->data_size = data_size; @@ -304,10 +272,7 @@ void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, ctx->cpu = cpu; ctx->rflags = 0; ctx->handle = handle; - ctx->ctx_len = sizeof(struct lttng_ust_lib_ring_buffer_ctx); ctx->ip = 0; - ctx->priv2 = priv2; - memset(ctx->padding2, 0, LTTNG_UST_RING_BUFFER_CTX_PADDING); } /*