Fix: header size larger than 256 bytes
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 25 Oct 2015 15:25:31 +0000 (11:25 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 25 Oct 2015 15:30:17 +0000 (11:30 -0400)
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 <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ring-buffer-client.h
liblttng-ust/lttng-ring-buffer-metadata-client.h

index 70235b8a812508bebdee4c456a312a8f0ce6a4dc..3f1e2656437a13b20d4fcbfd8f2b429622b83c78 100644 (file)
@@ -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)
index ed8db359fa1a089563ec09652b8b2e167d959bf5..f3c4a67c8843ea0e9514ff994e04ed16ef979c08 100644 (file)
@@ -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)
This page took 0.026209 seconds and 4 git commands to generate.