From 3054461acbbd00cc70e9e3046050f074e9eec4c9 Mon Sep 17 00:00:00 2001 From: compudj Date: Thu, 25 Aug 2005 18:33:16 +0000 Subject: [PATCH] seek position fixed for state git-svn-id: http://ltt.polymtl.ca/svn@1078 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/state.c | 13 ++++++++----- ltt/branches/poly/lttv/lttv/tracecontext.c | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 6ee5e32e..b107c25b 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -438,8 +438,10 @@ static void state_save(LttvTraceState *self, LttvAttribute *container) *(value.v_uint) = tfcs->process->pid; value = lttv_attribute_add(tracefile_tree, LTTV_STATE_EVENT, LTTV_POINTER); - /* Only save the position of the tfs is in the pqueue */ - if(!g_tree_lookup(self->parent.ts_context->pqueue, &tfcs->parent)) { + /* Only save the position if the tfs has not infinite time. */ + //if(!g_tree_lookup(self->parent.ts_context->pqueue, &tfcs->parent) + // && current_tfcs != tfcs) { + if(ltt_time_compare(tfcs->parent.timestamp, ltt_time_infinite) == 0) { *(value.v_pointer) = NULL; } else { LttEvent *e = ltt_tracefile_get_event(tfcs->parent.tf); @@ -1549,9 +1551,10 @@ void lttv_state_save_add_event_hooks(LttvTracesetState *self) ts = (LttvTraceState *)self->parent.traces[i]; nb_tracefile = ts->parent.tracefiles->len; + guint *event_count = g_new(guint, 1); + *event_count = 0; + for(j = 0 ; j < nb_tracefile ; j++) { - guint *event_count = g_new(guint, 1); - *event_count = 0; tfs = LTTV_TRACEFILE_STATE(g_array_index(ts->parent.tracefiles, LttvTracefileContext*, j)); @@ -1637,9 +1640,9 @@ void lttv_state_save_remove_event_hooks(LttvTracesetState *self) LttvTracefileContext*, j)); event_count = lttv_hooks_remove(tfs->parent.event, state_save_event_hook); - g_free(event_count); } + g_free(event_count); } } diff --git a/ltt/branches/poly/lttv/lttv/tracecontext.c b/ltt/branches/poly/lttv/lttv/tracecontext.c index fca7dacc..1084ad60 100644 --- a/ltt/branches/poly/lttv/lttv/tracecontext.c +++ b/ltt/branches/poly/lttv/lttv/tracecontext.c @@ -764,7 +764,7 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, read_ret = ltt_tracefile_read(tfc->tf); if(likely(!read_ret)) { - g_debug("An event is ready"); + //g_debug("An event is ready"); tfc->timestamp = ltt_event_time(e); g_assert(ltt_time_compare(tfc->timestamp, ltt_time_infinite) != 0); g_tree_insert(pqueue, tfc, tfc); @@ -1066,7 +1066,7 @@ LttvTracesetContextPosition *lttv_traceset_context_position_new() return pos; } -/* Save all positions, the ones not in the pqueue will have NULL +/* Save all positions, the ones with infinite time will have NULL * ep. */ void lttv_traceset_context_position_save(const LttvTracesetContext *self, LttvTracesetContextPosition *pos) -- 2.34.1