[lttng-dev] [BABELTRACE PATCH 3/3] Handle empty streams on iterator init

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Nov 27 12:41:25 EST 2013


All 3 patches merged, thanks!

Mathieu

----- Original Message -----
> From: "Julien Desfossez" <jdesfossez at efficios.com>
> To: "mathieu desnoyers" <mathieu.desnoyers at efficios.com>
> Cc: lttng-dev at lists.lttng.org, "Julien Desfossez" <jdesfossez at efficios.com>
> Sent: Wednesday, November 27, 2013 11:40:12 AM
> Subject: [BABELTRACE PATCH 3/3] Handle empty streams on iterator init
> 
> In live trace streaming, we can create an iterator with inactive
> streams. This patch allows inactive streams to be considered as valid.
> 
> Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
> ---
>  lib/iterator.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/iterator.c b/lib/iterator.c
> index 155fcbe..3280f4a 100644
> --- a/lib/iterator.c
> +++ b/lib/iterator.c
> @@ -725,7 +725,7 @@ int bt_iter_init(struct bt_iter *iter,
>  				if (ret == EOF) {
>  					ret = 0;
>  					continue;
> -				} else if (ret) {
> +				} else if (ret != 0 && ret != EAGAIN) {
>  					goto error;
>  				}
>  				/* Add to heap */
> @@ -821,6 +821,13 @@ reinsert:
>  	removed = bt_heap_replace_max(iter->stream_heap, file_stream);
>  	assert(removed == file_stream);
>  
> +	file_stream = bt_heap_maximum(iter->stream_heap);
> +	if (file_stream->pos.content_size == 0) {
> +		ret = EAGAIN;
> +	} else {
> +		ret = 0;
> +	}
> +
>  end:
>  	return ret;
>  }
> --
> 1.8.3.2
> 
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list