From: Mathieu Desnoyers Date: Thu, 20 Feb 2014 03:20:18 +0000 (-0500) Subject: Revert "Fix: assign a trace handle to every live trace" X-Git-Tag: v1.2.0-rc2~27 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=5ce3f408681be4086fe7b10c2867bad6e4273765 Revert "Fix: assign a trace handle to every live trace" This reverts commit 42423b0a691fb4b2efbb5a45eb7eefa5f350ec30. Signed-off-by: Mathieu Desnoyers --- diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c index 70a656e7..1266a95d 100644 --- a/formats/lttng-live/lttng-live-comm.c +++ b/formats/lttng-live/lttng-live-comm.c @@ -1187,8 +1187,6 @@ void add_traces(gpointer key, gpointer value, gpointer user_data) struct bt_mmap_stream *new_mmap_stream; struct bt_mmap_stream_list mmap_list; struct lttng_live_ctx *ctx = NULL; - struct bt_trace_descriptor *td; - struct bt_trace_handle *handle; /* * We don't know how many streams we will receive for a trace, so @@ -1233,12 +1231,15 @@ void add_traces(gpointer key, gpointer value, gpointer user_data) fprintf(stderr, "[error] Error adding trace\n"); goto end_free; } - handle = (struct bt_trace_handle *) g_hash_table_lookup( - bt_ctx->trace_handles, - (gpointer) (unsigned long) ret); - td = handle->td; - trace->handle = handle; + if (bt_ctx->current_iterator) { + struct bt_trace_descriptor *td; + struct bt_trace_handle *handle; + + handle = (struct bt_trace_handle *) g_hash_table_lookup( + bt_ctx->trace_handles, + (gpointer) (unsigned long) ret); + td = handle->td; bt_iter_add_trace(bt_ctx->current_iterator, td); } diff --git a/formats/lttng-live/lttng-live.h b/formats/lttng-live/lttng-live.h index 071f2881..137a296d 100644 --- a/formats/lttng-live/lttng-live.h +++ b/formats/lttng-live/lttng-live.h @@ -67,7 +67,6 @@ struct lttng_live_ctf_trace { struct lttng_live_viewer_stream *metadata_stream; GPtrArray *streams; FILE *metadata_fp; - struct bt_trace_handle *handle; int trace_id; int in_use; };