Use unsigned long type for events discarded counter
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 2 May 2012 15:43:04 +0000 (11:43 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 2 May 2012 15:43:04 +0000 (11:43 -0400)
Overflows at 64-bit on 64-bit systems.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/ltt-events.c
liblttng-ust/ltt-ring-buffer-client.h

index aafa126c47a064ff5e368af93236d7f66a4790d4..226eca287df44c9f62392242d9c6342a01a49b06 100644 (file)
@@ -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,
index f18b4ed387cdf876dffebd4ae41b7a808b57b55d..0b6cd3e4536935f90bd183d006bdc6184cb4f95b 100644 (file)
@@ -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)
This page took 0.026648 seconds and 4 git commands to generate.