From: Mathieu Desnoyers Date: Wed, 2 May 2012 15:43:04 +0000 (-0400) Subject: Use unsigned long type for events discarded counter X-Git-Tag: v2.1.0-rc1~89 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=18fc8d7163331ebf5fabd2e638c0b3e52cd40e53;p=lttng-ust.git Use unsigned long type for events discarded counter Overflows at 64-bit on 64-bit systems. Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index aafa126c..226eca28 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -1020,7 +1020,7 @@ int _ltt_stream_packet_context_declare(struct ltt_session *session) "struct packet_context {\n" " uint64_clock_monotonic_t timestamp_begin;\n" " uint64_clock_monotonic_t timestamp_end;\n" - " uint32_t events_discarded;\n" + " unsigned long events_discarded;\n" " uint32_t content_size;\n" " uint32_t packet_size;\n" " uint32_t cpu_id;\n" @@ -1131,6 +1131,7 @@ int _ltt_session_metadata_statedump(struct ltt_session *session) "typealias integer { size = 16; align = %u; signed = false; } := uint16_t;\n" "typealias integer { size = 32; align = %u; signed = false; } := uint32_t;\n" "typealias integer { size = 64; align = %u; signed = false; } := uint64_t;\n" + "typealias integer { size = %u; align = %u; signed = false; } := unsigned long;\n" "typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n" "typealias integer { size = 27; align = 1; signed = false; } := uint27_t;\n" "\n" @@ -1149,6 +1150,8 @@ int _ltt_session_metadata_statedump(struct ltt_session *session) lttng_alignof(uint16_t) * CHAR_BIT, lttng_alignof(uint32_t) * CHAR_BIT, lttng_alignof(uint64_t) * CHAR_BIT, + sizeof(unsigned long) * CHAR_BIT, + lttng_alignof(unsigned long) * CHAR_BIT, CTF_SPEC_MAJOR, CTF_SPEC_MINOR, uuid_s, diff --git a/liblttng-ust/ltt-ring-buffer-client.h b/liblttng-ust/ltt-ring-buffer-client.h index f18b4ed3..0b6cd3e4 100644 --- a/liblttng-ust/ltt-ring-buffer-client.h +++ b/liblttng-ust/ltt-ring-buffer-client.h @@ -51,7 +51,7 @@ struct packet_header { /* Stream packet context */ uint64_t timestamp_begin; /* Cycle count at subbuffer start */ uint64_t timestamp_end; /* Cycle count at subbuffer end */ - uint32_t events_discarded; /* + unsigned long events_discarded; /* * Events lost in this subbuffer since * the beginning of the trace. * (may overflow)