From: Mathieu Desnoyers Date: Sun, 25 Oct 2015 15:25:31 +0000 (-0400) Subject: Fix: header size larger than 256 bytes X-Git-Tag: v2.7.1~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=826c6c686f16b9aeb3100f3f880d630911691cf1;p=lttng-ust.git Fix: header size larger than 256 bytes When adding large context (e.g. callstack), headers larger than 256 bytes cause discrepancy between calculated size and size written into the trace buffers. This generates a corrupted trace and triggers a warning in ring buffer backend, which triggers a safety net disabling tracing for the current channel. Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/lttng-ring-buffer-client.h b/liblttng-ust/lttng-ring-buffer-client.h index 70235b8a..3f1e2656 100644 --- a/liblttng-ust/lttng-ring-buffer-client.h +++ b/liblttng-ust/lttng-ring-buffer-client.h @@ -110,7 +110,7 @@ void ctx_record(struct lttng_ust_lib_ring_buffer_ctx *bufctx, * contains. */ static __inline__ -unsigned char record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, +size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_ust_lib_ring_buffer_ctx *ctx) diff --git a/liblttng-ust/lttng-ring-buffer-metadata-client.h b/liblttng-ust/lttng-ring-buffer-metadata-client.h index ed8db359..f3c4a67c 100644 --- a/liblttng-ust/lttng-ring-buffer-metadata-client.h +++ b/liblttng-ust/lttng-ring-buffer-metadata-client.h @@ -52,7 +52,7 @@ static inline uint64_t lib_ring_buffer_clock_read(struct channel *chan) } static inline -unsigned char record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, +size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, size_t offset, size_t *pre_header_padding, struct lttng_ust_lib_ring_buffer_ctx *ctx)