Fix event lost count when buffer is full
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Mar 2012 19:41:42 +0000 (15:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Mar 2012 19:41:42 +0000 (15:41 -0400)
The tracing channels should count lost events due to buffer full, and
the metadata channel should not (see comment), but not the opposite.
This was a mixup between the two.

Reported-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/ltt-ring-buffer-client.h
liblttng-ust/ltt-ring-buffer-metadata-client.h

index e041803c34705813e59ab43e0fbe09ca97f34bb1..d64af55503994038cce8f0ffc510996bc4d483e8 100644 (file)
@@ -366,11 +366,8 @@ static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t ts
        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 */
-       /*
-        * We do not care about the records lost count, because the metadata
-        * channel waits and retry.
-        */
-       (void) lib_ring_buffer_get_records_lost_full(&client_config, buf);
+
+       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);
        header->ctx.events_discarded = records_lost;
index 40f749d510e7aa7a3555f61e920aba90a28f7130..1e18df9d33a14fa4dd3969faf5bd17f4d9d0477b 100644 (file)
@@ -131,7 +131,11 @@ static void client_buffer_end(struct lttng_ust_lib_ring_buffer *buf, uint64_t ts
 
        header->content_size = data_size * CHAR_BIT;            /* in bits */
        header->packet_size = PAGE_ALIGN(data_size) * CHAR_BIT; /* in bits */
-       records_lost += lib_ring_buffer_get_records_lost_full(&client_config, buf);
+       /*
+        * We do not care about the records lost count, because the metadata
+        * channel waits and retry.
+        */
+       (void) 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);
        WARN_ON_ONCE(records_lost != 0);
This page took 0.026851 seconds and 4 git commands to generate.