From: Mathieu Desnoyers Date: Fri, 3 Jun 2011 17:35:31 +0000 (-0400) Subject: Fix large event header event id X-Git-Tag: v2.0-pre1~64 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7e8557491dbb640a5f2a2bea000f32a0e567b5ee;p=lttng-modules.git Fix large event header event id Was incorrectly writing 32-bit when reserving only 16. Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-ring-buffer-client.h b/ltt-ring-buffer-client.h index c97b8743..1c9308e0 100644 --- a/ltt-ring-buffer-client.h +++ b/ltt-ring-buffer-client.h @@ -186,8 +186,9 @@ void ltt_write_event_header(const struct lib_ring_buffer_config *config, case 2: /* large */ { uint32_t timestamp = (uint32_t) ctx->tsc; + uint16_t id = event_id; - lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id)); + lib_ring_buffer_write(config, ctx, &id, sizeof(id)); lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint32_t)); lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp)); break; @@ -237,8 +238,9 @@ void ltt_write_event_header_slow(const struct lib_ring_buffer_config *config, { if (!(ctx->rflags & (RING_BUFFER_RFLAG_FULL_TSC | LTT_RFLAG_EXTENDED))) { uint32_t timestamp = (uint32_t) ctx->tsc; + uint16_t id = event_id; - lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id)); + lib_ring_buffer_write(config, ctx, &id, sizeof(id)); lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint32_t)); lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp)); } else {