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

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

index 2fedbea59202df8da309a6b24fb348b37db1092c..9d933935dbf87a6fa6707ee88b9d415df79dfbdd 100644 (file)
@@ -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,
index cf42e688eccf5364e4874fd3ab0f24d4634b6240..9016b438746bd3ecad15351c6e4b6b4d1f2cac2f 100644 (file)
@@ -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)
This page took 0.028449 seconds and 4 git commands to generate.