From: Mathieu Desnoyers Date: Fri, 28 Sep 2012 00:25:11 +0000 (-0400) Subject: Perform calculation on bit size in 64-bit X-Git-Tag: v2.1.0~11 X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=commitdiff_plain;h=f9e4e1b9f3f497eeba591ac39e7da0a8e41035be Perform calculation on bit size in 64-bit allow 32-bit architectures to have sub-buffers larger than 256MB. Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-ring-buffer-client.h b/lttng-ring-buffer-client.h index 47059b45..0b05561a 100644 --- a/lttng-ring-buffer-client.h +++ b/lttng-ring-buffer-client.h @@ -370,8 +370,10 @@ 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 * CHAR_BIT; /* in bits */ - header->ctx.packet_size = PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */ + header->ctx.content_size = + (uint64_t) data_size * CHAR_BIT; /* in bits */ + header->ctx.packet_size = + (uint64_t) 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);