From: Mathieu Desnoyers Date: Sun, 25 Oct 2015 15:23:31 +0000 (-0400) Subject: Fix: header size larger than 256 bytes X-Git-Tag: v2.7.1~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=930e21f56c95bbb79f1399aa87e12254101e99b1;p=lttng-modules.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/lttng-ring-buffer-client.h b/lttng-ring-buffer-client.h index 7055e770..a675e48c 100644 --- a/lttng-ring-buffer-client.h +++ b/lttng-ring-buffer-client.h @@ -122,7 +122,7 @@ void ctx_record(struct lib_ring_buffer_ctx *bufctx, * contains. */ static __inline__ -unsigned char record_header_size(const struct lib_ring_buffer_config *config, +size_t record_header_size(const struct lib_ring_buffer_config *config, struct channel *chan, size_t offset, size_t *pre_header_padding, struct lib_ring_buffer_ctx *ctx) diff --git a/lttng-ring-buffer-metadata-client.h b/lttng-ring-buffer-metadata-client.h index 9e035304..4945ce46 100644 --- a/lttng-ring-buffer-metadata-client.h +++ b/lttng-ring-buffer-metadata-client.h @@ -55,7 +55,7 @@ u64 lib_ring_buffer_clock_read(struct channel *chan) } static inline -unsigned char record_header_size(const struct lib_ring_buffer_config *config, +size_t record_header_size(const struct lib_ring_buffer_config *config, struct channel *chan, size_t offset, size_t *pre_header_padding, struct lib_ring_buffer_ctx *ctx)