From: Mathieu Desnoyers Date: Sun, 22 May 2011 04:56:10 +0000 (-0400) Subject: Fix metadata header X-Git-Tag: v2.0-pre1~122 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=05d32c64199816da32cd95929a8ff0d0d38d7f60;p=lttng-modules.git Fix metadata header Signed-off-by: Mathieu Desnoyers --- 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);