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:20 +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 7dfb144d1f99e3ef8055384366535a3afcdcee02..e6bdd1d148779c93ec9ab63c500ec279e5af4d86 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 3352e1f29649cd4154d6e81ed2fd61da60f64d16..e71a0e90ded17146d7631b5d3645381dde63a3a8 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.026093 seconds and 4 git commands to generate.