From 9dcb02efd18948134deb8469a39478f250033269 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 25 Aug 2011 12:16:40 -0400 Subject: [PATCH] Fix metadata wait handling Signed-off-by: Mathieu Desnoyers --- include/ust/wait.h | 2 +- libust/ltt-ring-buffer-client.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/ust/wait.h b/include/ust/wait.h index e92d5285..21ced509 100644 --- a/include/ust/wait.h +++ b/include/ust/wait.h @@ -38,7 +38,7 @@ } \ __pollret = poll(NULL, 0, 10); /* wait 10ms */ \ if (__pollret < 0) { \ - __ret = __pollret; \ + __ret = -errno; \ break; \ } \ __timeout -= 10; \ diff --git a/libust/ltt-ring-buffer-client.h b/libust/ltt-ring-buffer-client.h index 5260197a..2fe854a3 100644 --- a/libust/ltt-ring-buffer-client.h +++ b/libust/ltt-ring-buffer-client.h @@ -335,7 +335,11 @@ static void client_buffer_end(struct lib_ring_buffer *buf, u64 tsc, 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 */ - 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); header->ctx.events_discarded = records_lost; -- 2.34.1