Fix large event header event id
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 3 Jun 2011 17:35:31 +0000 (13:35 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 3 Jun 2011 17:35:31 +0000 (13:35 -0400)
Was incorrectly writing 32-bit when reserving only 16.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ltt-ring-buffer-client.h

index c97b87430eb0eabe79a43e8687567cbddbc7a934..1c9308e04f7151e9d38db7aeb83609bdca8c51c3 100644 (file)
@@ -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, &timestamp, 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, &timestamp, sizeof(timestamp));
                } else {
This page took 0.026697 seconds and 4 git commands to generate.