From: Mathieu Desnoyers Date: Thu, 1 Mar 2012 18:39:04 +0000 (-0500) Subject: Fix ABI: add padding to tracepoint and ring buffer config public structures X-Git-Tag: v2.0.0-rc2~8 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2e707419baf97942e59a9d13bb23e0392bc48c15;p=lttng-ust.git Fix ABI: add padding to tracepoint and ring buffer config public structures Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h index 728738cd..5273f321 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "lttng/align.h" struct lttng_ust_lib_ring_buffer; @@ -122,6 +123,7 @@ struct lttng_ust_lib_ring_buffer_client_cb { * RING_BUFFER_WAKEUP_NONE does not perform any wakeup whatsoever. The client * has the responsibility to perform wakeups. */ +#define LTTNG_UST_RING_BUFFER_CONFIG_PADDING 32 struct lttng_ust_lib_ring_buffer_config { enum { RING_BUFFER_ALLOC_PER_CPU, @@ -175,6 +177,7 @@ struct lttng_ust_lib_ring_buffer_config { * callbacks and update the cb pointers. */ int client_type; + char padding[LTTNG_UST_RING_BUFFER_CONFIG_PADDING]; }; /* @@ -184,6 +187,7 @@ struct lttng_ust_lib_ring_buffer_config { * lib_ring_buffer_try_discard_reserve(), lib_ring_buffer_align_ctx() and * lib_ring_buffer_write(). */ +#define LTTNG_UST_RING_BUFFER_CTX_PADDING 24 struct lttng_ust_lib_ring_buffer_ctx { /* input received by lib_ring_buffer_reserve(), saved here. */ struct channel *chan; /* channel */ @@ -211,6 +215,7 @@ struct lttng_ust_lib_ring_buffer_ctx { */ uint64_t tsc; /* time-stamp counter value */ unsigned int rflags; /* reservation flags */ + char padding[LTTNG_UST_RING_BUFFER_CTX_PADDING]; }; /** @@ -235,6 +240,7 @@ void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, ctx->cpu = cpu; ctx->rflags = 0; ctx->handle = handle; + memset(ctx->padding, 0, LTTNG_UST_RING_BUFFER_CTX_PADDING); } /* diff --git a/include/lttng/tracepoint-types.h b/include/lttng/tracepoint-types.h index 37a7662b..77e2e25d 100644 --- a/include/lttng/tracepoint-types.h +++ b/include/lttng/tracepoint-types.h @@ -19,11 +19,13 @@ struct tracepoint_probe { void *data; }; +#define TRACEPOINT_PADDING 16 struct tracepoint { const char *name; int state; struct tracepoint_probe *probes; int *tracepoint_provider_ref; + char padding[TRACEPOINT_PADDING]; }; #endif /* _LTTNG_TRACEPOINT_TYPES_H */