From 8ca68914bea06267bce3cacdec8c821a7821e1a9 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 25 Oct 2015 11:25:31 -0400 Subject: [PATCH] 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 --- liblttng-ust/lttng-ring-buffer-client.h | 2 +- liblttng-ust/lttng-ring-buffer-metadata-client.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) -- 2.34.1