From: Mathieu Desnoyers Date: Wed, 2 May 2012 15:43:47 +0000 (-0400) Subject: Use unsigned long type for events discarded counter X-Git-Tag: v2.1.0-rc1~25 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a9afe705296f44144aaf3d2626a14bb8cfd2016a;p=lttng-modules.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/lttng-events.c b/lttng-events.c index 2fedbea5..9d933935 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -815,7 +815,7 @@ int _lttng_stream_packet_context_declare(struct lttng_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" @@ -926,6 +926,7 @@ int _lttng_session_metadata_statedump(struct lttng_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" @@ -944,6 +945,8 @@ int _lttng_session_metadata_statedump(struct lttng_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/lttng-ring-buffer-client.h b/lttng-ring-buffer-client.h index cf42e688..9016b438 100644 --- a/lttng-ring-buffer-client.h +++ b/lttng-ring-buffer-client.h @@ -60,7 +60,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)