From 05d32c64199816da32cd95929a8ff0d0d38d7f60 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 22 May 2011 00:56:10 -0400 Subject: [PATCH] Fix metadata header Signed-off-by: Mathieu Desnoyers --- ltt-events.c | 2 +- ltt-ring-buffer-client.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ltt-events.c b/ltt-events.c index 8a6f8e99..71fb8c70 100644 --- a/ltt-events.c +++ b/ltt-events.c @@ -169,12 +169,12 @@ struct ltt_channel *ltt_channel_create(struct ltt_session *session, goto nomem; chan->session = session; init_waitqueue_head(&chan->notify_wait); + chan->id = session->free_chan_id++; chan->chan = transport->ops.channel_create("[lttng]", chan, buf_addr, subbuf_size, num_subbuf, switch_timer_interval, read_timer_interval); if (!chan->chan) goto create_error; - chan->id = session->free_chan_id++; chan->ops = &transport->ops; list_add(&chan->list, &session->chan); mutex_unlock(&sessions_mutex); diff --git a/ltt-ring-buffer-client.h b/ltt-ring-buffer-client.h index caf949cd..0177d48b 100644 --- a/ltt-ring-buffer-client.h +++ b/ltt-ring-buffer-client.h @@ -304,8 +304,8 @@ static void client_buffer_end(struct lib_ring_buffer *buf, u64 tsc, unsigned long records_lost = 0; header->ctx.timestamp_end = tsc; - header->ctx.content_size = data_size; - header->ctx.packet_size = PAGE_ALIGN(data_size); + header->ctx.content_size = data_size * CHAR_BIT; /* in bits */ + header->ctx.packet_size = PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */ records_lost += lib_ring_buffer_get_records_lost_full(&client_config, buf); records_lost += lib_ring_buffer_get_records_lost_wrap(&client_config, buf); records_lost += lib_ring_buffer_get_records_lost_big(&client_config, buf); -- 2.34.1