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.8.0-rc1~60 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c1cc82b8a2ebe795ef7b3cf3cb49c9de599dbdbb;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 4fffab98..e882f493 100644 --- a/lttng-ring-buffer-client.h +++ b/lttng-ring-buffer-client.h @@ -124,7 +124,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 3c9a3d8f..fe1abb7b 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)